Repository navigation
rdna2spirv: a wave64 VALU mask operand printed as one SGPR is the pair (SHADER-W64-SDST-PAIR) - #1021
Conversation
…r (SHADER-W64-SDST-PAIR) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Retail check on a second NVIDIA card, with the fence loss made visible by #1028 (which builds on #980). Setup:
So on this card the device is still lost during the load, but not the same way: the report changes from the hang shape to a fault with an address, about 12 s later. That fits the endless dispatch being gone and a second problem behind it. One run with the fix, so it shows the change, not a rate. Lines that are in the log of the run with the fix and in none of the 12 earlier runs on this machine, all just before the loss: first calls of list slots 85, 51, 129, 61, 39, 86 and 26 and device slot 71; Not checked: whether Counts and driver addresses only, no game data. AI-assisted. |
fin-github
left a comment
There was a problem hiding this comment.
tests/semantic/test_wave64_single_sdst.pyon the PR: 3 tests OK. The same file againstmain(3295055):
2 failures and 1 error, so it catches the bug.unittest discover -s tests/semantic -p "test_wave64*.py": 268 tests OK.
Question: the e64 forms can also print vcc_lo as the SDST (v_cmp_gt_u32_e64 vcc_lo, ...,
v_cndmask_b32_e64 ..., vcc_lo). widen_wave64_masks leaves special operands alone, which
test_wave32_keeps_single_registers asserts for the e32 case. I see the existing vcc_lo handling
(vcc_half_keeps_mask, rdna2spirv.py:1629, and the mask-destination path near 6058). Does that already give the
e64 vcc_lo SDST the full VCC in wave64? If so, a single line in the docstring or the design.md row would save the
next reader from asking the same thing.
Nit: in elif op.startswith("v_") and "_co_" in op or op in (...), and binds tighter than or, which is what
you want here. Parentheses would make that clear at a glance.
Tested on Windows 11 Pro 26200, CPython 3.14.4, MSVC from VS 18 Community, applied on main 3295055. No GPU or game files used. AI-assisted (Claude Code).
|
@quartz-heron-58 thank you, this is a very useful check, and the Two of your new lines are explained:
After both, the remaining fault on my RTX 5080 was a read in a 24 GiB GPU window (protection On the conflict with #674: keeping both functions is right. AI-assisted. |
|
Tested on another setup, with counts over the whole corpus (1.0.2.1, all 26,503 listings, llvm-mc backend), this head
Not checked: a 64-wide device ( |
|
Tested
This runs translated SPIR-V, not native RDNA2 code. Not tested: game corpus. AI-assisted (Claude Code) |
|
Merged. Thanks, and thanks to everyone who tested it. Checked locally on
On Two small things for a follow-up, neither blocking:
#1090 and #1091 are stacked on this one and can move now. AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
main now holds ProjectLeonida#1021 (SHADER-W64-SDST-PAIR), which this branch was stacked on. No conflict by hand: the TEST-W64-SDST-PAIR-GPU row stays right under ProjectLeonida#1021's row in docs/design.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r (upstream ProjectLeonida#1021) Adopted from upstream PR ProjectLeonida#1021 (SHADER-W64-SDST-PAIR, DadaCap): beyond the v_cmp destination 6822488 widened, carry-in/out operands, the v_cndmask_b32_e64 selector and the v_mad_*64 / v_div_scale SDSTs of a wave64 program are pairs too when llvm-mc listed them in its 32-lane form. CS_Prop_BatchCull (library 1405) still looped on the GPU with only the compares widened; its module changes with this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claim: SHADER-W64-SDST-PAIR (#14 (comment)).
The shader listings come from llvm-mc without
+wavefrontsize64, so a VALU instruction's lane-mask SGPR is printed as one register:v_cmp_gt_u32_e64 s8, ...for thes[8:9]a wave64 writes,v_cndmask_b32_e64 ..., s10for thes[10:11]it reads. The translator wrotes8alone. A scalar 64-bit instruction prints the pair, andmask_srcgives lanes 32..63 the high register's bit (since 804f4ae), so afters_mov_b64 exec, s[8:9]those lanes had whatevers9held before. The semantic tests print the pair, so none of them saw it.widen_wave64_masksmakes the operand the pair once a program is known to be wave64:v_cmp_*with an SDST, the carry out and in ofv_*_co_*,v_div_scale,v_mad_[ui]64_[ui]32and the mask ofv_cndmask.How it was found: a 128-thread pipeline-library compute shader (
lib_cs_03141) hung an RTX 5080 (device lost) while the retail title's loading screen runs. The translated shader also loops for ever intest_wave64_emulate_opt.run_emulated_workgroupwith the title's own constants; with this it ends after 76 barriers, and the title gets past it.Tested
tests/semantic/test_wave64_single_sdst.py(new): both printed forms translate to the same module, natively and emulated, and all 64 lanes are run. Onmain: 2 failures, 1 error.scripts/run_semantic_tests.py tests/semantic: 470 files, 6,165 tests; the one file that fails,test_image_cube_store_glc, cannot start llvm-mc on this machine (FileNotFoundError).--wave64-emulate, on my boot stack (mainplus other open pull requests): 26,503 translated before and after, the 2,671 pipeline-library programs too, none lost. I did not runspirv-valover the new modules separately; the translator's own assembly step accepted them all.The modules have to be translated again (
make_game.py --stages shaders).AI-assisted (Claude Code, Opus 5.5).
🤖 Generated with Claude Code