Repository navigation
Conversation
…TORE-OOB) RDNA2 (gfx1036, tools/hw_oracle) leaves memory unchanged for an image_store at x/y past the edge, at -1 or at the row pitch. OpImageWrite out of range is undefined in Vulkan, so every write is now behind an unsigned coordinate < OpImageQuerySize test per axis (1D, 2D, 2D array, 3D).
|
Tested 33c80b5 (merged on This confirms the fix for the failure I reported on #5250. |
|
Tested
So Apple reproduces the #5250 regression @CharlyRien saw on the RTX 3090: the float-view query suppresses valid integer writes. This head fixes it. Other runs:
AI-assisted. |
|
Windows GPU recheck of the revised The stock fixture had 0/64 mismatches each for float, uint, and sint. Keeping the same harness and fixture and regenerating only the shader with the #5250 translator gave 0/64 float mismatches and 63/64 in each integer view. All stores target valid coordinates in their selected 8×8 views. This confirms the revised 1×1 float mip still catches querying the wrong view. Both modules passed |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head 1b7fc6c495.
Commands:
python tests/semantic/test_image_store_bounds.py-> Ran 1 test, OK;python -I tests/test_semantic_translator_use.py-> OK;git diff --check-> clean.- GPU:
$env:LLVM_MC='wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc'; $env:LEONIDA_VK_DEVICE='RTX 5070 Ti'; python -I scripts/run_gpu_tests.py --build build --filter cs_imgstore-> PASS (1/1). - Control with the dependency's translator
5dd8051cb+ this fixture -> FAIL (0/1), so the 1x1 float view in slots 2/3 really catches a bounds query through the wrong class. - Control with main's translator -> PASS, expected: main has no store bounds guard at all, so nothing is dropped.
The semantic test shows 3 OpImageWrite and 3 OpImageQuerySize, one per typed view, each write inside its own bounds branch for 1D/2D/2D-array/3D.
Dependency: #5250 is still open and is the first commit here; merge it first or rebase. The CMake-listed GPU fixture is cs_imgstore, which is what I ran.
Verdict: LGTM after #5250.
|
Checked the emitted store guards across all 2,449 retail shader listings containing The corpus exercised 7,611 stores: 6,658 2D, 181 2D-array, 765 3D and seven 1D. Across all 22,833 emitted float/uint/sint write branches, the size query used the exact image SSA value used by the write. In every branch, the conditional entering the write block included an unsigned bounds test for each coordinate axis against the corresponding component of that query. This covers the real 1D and layered cases alongside the unequal-view GPU fixture already reported here. CachyOS Linux, CPU translation and SPIR-V inspection. AI-assisted. |
#5385 (head 1b7fc6c, open)Tested 1b7fc6c on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
What changed
The float, unsigned and signed storage images use separate descriptor arrays. The old bounds check always queried the float array before choosing the typed write, so a smaller float fallback could suppress valid integer writes. Each typed branch now queries the dimensions of the same view it writes through.
The change adds translator coverage for 1D, 2D, 2D-array and 3D stores, a Vulkan regression fixture with unequal typed-view extents, and a design-contract update.
Claim: #5256 claim
Depends on: #5250
This branch is based on the current head of #5250 and should merge after that dependency.
Validation
python -I tests/semantic/test_image_store_bounds.py -v— PASS, 1 test.python -I tests/test_design_contract_rows.py— PASS, 4 tests.python -I tests/test_docs_design_rows.py— PASS, 4 tests.python -I tests/test_docs_table_rows.py— PASS, 2 tests.python -I -m compileall -q tools tests— PASS.cs_imgstorewithruntime/test/shaders/build.py— 1 shader translated;spirv-valpassed.vk_store_test.cppand rancs_imgstore— PASS, zero bad texels in float, uint and sint views.5dd8051with the same fixture reported 63 bad texels in each integer view; the regression is detected.spirv-val.git diff --check— PASS.PATH.AI-assisted.