Repository navigation
rdna2spirv: read image_get_resinfo's T# word 3 from a VCCTuple list - #7508
ABilenduke wants to merge 1 commit into
Conversation
image_misc checks the T# with desc_lookup_sgpr, which accepts an LLVM
VCCTuple list ([s100,...,s105,vcc_lo,vcc_hi]), but image_get_resinfo then
read word 3 as load_reg("sgpr", a[2]["r"] + 3). For a list that adds an
int to a list: a TypeError the CLI's per-shader loop does not catch, so
one such shader killed its whole shard. Read the word through sgpr_word
like the other image paths (ItsNotRexed#6805 already did this for the coherent
image_load). The new test translates both with a VCCTuple T#.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent CPU review at
|
|
Checked I checked the retail inputs to see whether they exercise the fix. Across 26,503 carved shader listings, 384 contain AI-assisted QA. |
|
Independent Linux check (WSL2, CPython 3.14.4) merged into main |
|
Tested f9616cd on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass
AI-assisted (OpenCode). |
|
Tested f9616cd (merged onto main 976b3ec) on NVIDIA GeForce RTX 2060 (Turing), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 (10.0.26300), subgroup size 32: pass (no regression) What I ran:
No GPU test changed status against main. This PR adds no GPU fixture of its own, so the run checks that the change breaks none of the existing GPU tests; it does not exercise the new rule directly. Unit tests changed by the PR: The one failure on both sides is AI-assisted run (Claude Code); the numbers are from my machine. |
|
Tested on NVIDIA GeForce GTX 1080 (Pascal, subgroup 32..32, no mesh shaders or fragment barycentrics), Linux (Ubuntu 26.04.1), driver 580.178.04, llvm-mc 21. No game files.
Every PASS/FAIL/SKIP row and its words are identical to main: no regression on this GPU. This run does not by itself check the new rule (I did not look for a fixture that reaches it); the PR's own semantic tests were not run. AI-assisted. |
Claimed in the coordination issue as: #7333 (comment) (found in a code audit; no item ID yet)
Depends on: #5247 (conflicts: it rewrites the same image_get_resinfo call and keeps a[2]["r"] + 3; whichever lands second needs the sgpr_word change)
What and why
image_miscchecks the T# withdesc_lookup_sgpr(a[2], 8), which accepts an LLVM VCCTuple list ([s100,...,s105,vcc_lo,vcc_hi], parsed as{"k": "slist", "r": [...]}bytools/shader_ir.py).image_get_resinfothen read T# word 3 asself.load_reg("sgpr", a[2]["r"] + 3)(tools/rdna2spirv.py:13172). For an slist this adds an int to a list and raisesTypeError. The per-shader CLI loop catches onlyUnsupportedand(IndexError, KeyError, ValueError), so the error ends the whole--shardrun andmake_game.pyfails the shaders stage. One shader should have been counted, not the whole stage lost.Fix: read the word through
self.sgpr_word(a[2], 3), which handles boths[x:y]and slist operands. The other image paths already do this, and #6805 made the same change for the coherentimage_load(glc). The CLIexceptclause is left as it is.The new test
test_slist_tsharp_resinfo_and_coherent_loadsits intests/semantic/test_fspx_rules.py, next to the existing VCCTupleimage_loadcheck. It translatesimage_get_resinfowith a VCCTuple T# and checks for the descriptor lookup,OpImageQuerySizeLodandOpImageQueryLevels. It also translates aglc dlcimage_loadwith the same T#, as a regression guard for the half #6805 fixed. All inputs are written by hand, with no game data.AI-assisted (Claude Code).
Tested
Windows 11, Python 3.14. No GPU was needed: these are CPU-only translation tests. (The machine has an RTX 5070 Ti, driver 32.0.16.2124.)
python -B -m unittest discover -s tests/semantic -p test_fspx_rules.py -k test_slist_tsharp_resinfoerrored withTypeError: can only concatenate list (not "int") to listatrdna2spirv.py:13172python -B -m unittest discover -s tests/semantic -p test_fspx_rules.py: 10 tests OKpython -B -m unittest discover -s tests/semantic -p test_mem_crash_forms.py: 1 test OKpython -B -m unittest discover -s tests/semantic -p test_sampled_dynamic_index.py: 6 tests OKpython -I tests/test_image_query_translate.py: 10 tests OKpython -m compileall -q tools/rdna2spirv.py tests/semantic/test_fspx_rules.py: OKtests/test_translate.pywas not run because pytest is not installed.image_get_resinfowith a VCCTuple T#, which used to crash the translator.AI-assisted: yes (Claude Code found, fixed and tested this; reviewed before opening)
Checklist
docs/design.md, with how it was confirmed. (Not applicable: no new rule; this fixes a crash/path handling in existing code.)🤖 Generated with Claude Code