Repository navigation
rdna2spirv: preserve DST_SEL=1 on out-of-bounds buffer_load_format (SHADER-429) - #2467
Conversation
|
Independent GPU check of e701a6f against its parent 4947579, on Windows 11 build 26300, RTX 5070, driver 621.24. A hand-written compute probe passed the source V# in live user SGPRs and selected (X, 0, 1, 1). Each dispatch had 2 in-bounds lanes and 30 out-of-bounds lanes in the same wave, using RAW bounds. I tested R32_FLOAT, R32_UINT, R8_UNORM and RGBA8_UINT with both full-width and D16 destinations, checking every returned word and the untouched heap. The two modules for each revision passed Vulkan 1.2
All 34 formatted buffer semantic tests passed on the PR. The GPU probe covered descriptor bounds with aligned source offsets. Synthetic inputs only. AI-assisted review. |
|
Read the patch and ran the tests on Windows (Python 3.15, no GPU claim here — this is the CPU side of the rule). Fail-before / pass-after, checked: at So the new tests do catch the old behaviour, and only the two channels the V# sets to The change itself looks right: gating Three things I would add before this merges:
Nit, not a blocker: the gate now costs four |
|
Tested e701a6f on AMD Radeon RX 9070 XT (RADV GFX1201) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
|
Heads-up for the coordinator, separate from the review above: @timelery posted |
|
Tested Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows
This head changes 5 suite modules compared with AI-assisted (Claude Code); I checked the results. |
|
Tested e701a6f on an RTX 5090 (driver 616.92), Windows 11, Vulkan SDK 1.4.363. The GPU test programs were built from the same tree:
AI-assisted (Claude Code). |
|
Tested e701a6f on an RX 9070 (RDNA4), AMD 26.11.1 (LLPC), Vulkan 1.4.359, Windows 11: pass
AI-assisted |
|
Tested e701a6f on RTX 4080 SUPER (Ada, subgroup 32), NVIDIA 621.24 (Vulkan 1.4.357), Windows 11 Pro build 26300; MSVC 14.44, Vulkan SDK 1.4.363.0,
|
Item: SHADER-429, claimed in #2300 (finding by @timelery).
Resolves: SHADER-429
What was wrong
In
tools/rdna2spirv.py(buffer_load_format), thein_b(in-bounds) check was evaluated viaOpSelectover the final post-swizzle registerr:As reported and measured by @timelery on RDNA2 (
gfx1036), when an access falls out of bounds (or is unaligned), raw data channels read0but the V# descriptor'sDST_SELstill applies. Therefore, channels configured withDST_SEL=1must return the constant1.0f(0x3F800000or0x3C00in d16) or integer1(0x0001in d16). Evaluatingin_bafter the swizzle erroneously forced all channels to0.The change
in_bis now applied directly to the raw fetched buffer components (comps[0..3]):DST_SEL=0remain0, whileDST_SEL=1evaluates todst1intact both in standard format and when packed viad16.tests/semantic/test_buffer_load_format.py:test_dst_sel_one_out_of_bounds: verifiesFMT_F32,FMT_U32,FMT_UNORM8,FMT_UINT8X4out-of-bounds loads return0for memory channels but preserve1.0f/1forDST_SEL=1.test_dst_sel_one_out_of_bounds_d16: verifies packedd16destinations preserve0x3C003C00(f16) and0x00010001(u16).Verification
tests/semantic/test_buffer_load_format.py): 34/34 tests PASSED (1.27s).tests/test_translate.py): PASSED (0 errors).python -m compileall -q make_game.py tools testsclean (0 errors).19.44.35225), Python 3.13, NVIDIA GeForce RTX 2070 SUPER (Driver 595.79, Vulkan 1.4).