Repository navigation
Conversation
… its sides are inert (SHADER-10) A v_cmp of values that are the same in every active lane, made under a narrowed EXEC (and LLVM's s_and_b64 vcc, exec, s[..] form of it), gives every active lane or none. A half with an active lane then votes as the wave does; only a half with none can vote no while the wave votes yes, and it runs the other side with every lane off. The vccz/vccnz branch is now tier A when every block between it and its join has no effect EXEC does not mask (exp, s_endpgm, s_sendmsg, scalar stores and atomics, s_barrier, s_setreg and mode ops, v_writelane, ds_append/consume, GDS, indirect jumps) and never sets EXEC past what it was at the branch. Scalars a side defines are the vote's, so a read past the join stays stale-scalar. Tests: five UniformVote cases on the wave interpreter (two accepted forms, three near misses that differ at 64 lanes against two waves of 32); test_c_compare_under_a_narrowed_exec now reports stale-scalar (still tier C). New GPU fixture ps_w64_a_uniform_vote_narrowed (tier C on main): derived words and byte-identical images on an NVIDIA RTX 5090 (617.42, 32-wide) and an AMD Raphael iGPU (gfx1036, Windows driver 2026.04.17, fragment stage 64-wide by default, lane-id probe 63). Semantic suite passes except test_float_nan_fract, which fails the same way on main. Corpus count not measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I found an earlier implementation of the narrowed-EXEC uniform-compare rule in #6963 (14:59 UTC claim). Both PRs branch directly from Both positive fixtures were tier C on the base and passed as tier A on both PRs, including the LLVM-form nested restore. All three negative fixtures stayed tier C on both PRs. The one differing assertion was diagnostic: the A merge of the two heads conflicts in five files, including an add/add of the identically named GPU fixture and overlapping edits to |
|
Tested
So the narrowed-EXEC uniform vote draws the same at 64 lanes and as two halves on RDNA2 hardware, and the new rule doesn't move any existing fixture to another tier.
AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
… VCC form (SHADER-10) s_cbranch_scc0/scc1 on the SCC of `s_and_b64 vcc, exec, s[..]`, or of `s_cmp_lg/eq_u64 mask, 0` on the compare's SGPR pair, is the same vote as the vccz/vccnz form: tier A when both sides are inert for a half with no active lane. A write to the mask register before the branch still ends the vote (SHADER-820). Tests: two accepted SCC forms (tier C before, A now, equal at 64 lanes against two waves of 32) and two near misses (an SCC side restoring the outer EXEC differs; a branch after the mask is rewritten stays C). Fixture tiers unchanged (A 10, B 8, C 12). Semantic suite: only test_float_nan_fract fails, as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: SHADER-10 (part of unsafe-vote-branch), #8186 (comment)
Depends on: conflicts with #8521, #8361 and #8337 in the SHADER-10 row of
docs/design.mdonly (the one-line table row); the code merges cleanly with each.What and why
unsafe-vote-branchis the largest tier C reason in the SHADER-10 census (8,285 shaders). Main accepts a vote on a wave-uniform compare only while EXEC is the launch mask; the same compare under a narrowed EXEC was always tier C.Such a compare (sources the same in every active lane, i.e.
st["ua"]; also LLVM'ss_and_b64 vcc, exec, s[..]form) gives every active lane or none. A 32-lane half with an active lane therefore votes as the wave does; only a half with no active lane can vote no while the wave votes yes, and it runs the other side with every lane off. So thes_cbranch_vccz/vccnzis now tier A when every block between the branch and its join (immediate post-dominator):exp,s_endpgm,s_sendmsg, scalar stores/atomics,s_barrier,s_setregand the mode ops,v_writelane,ds_append/ds_consume/GDS, indirect jumps;confine_step: narrowings, and restores of masks saved inside, as in a nested if);and EXEC at the branch is the compare's EXEC or a narrowing of it. The same vote taken through SCC (
s_cbranch_scc0/scc1after thes_and_b64 vcc, exec, s[..]that set it, or afters_cmp_lg/eq_u64 mask, 0of the compare's pair) is judged alike; a write to the mask register before the branch still ends the vote (SHADER-820). A scalar either side defines is treated as the vote's (voted), so a read past the join stays tier Cstale-scalar.Changes:
tools/wave64_halves.py(newUVOTENtag,uniform_cmp(active=True),agrees,inert_sides, cachedipdoms), the contract row indocs/design.md, interpreter tests, and a new GPU fixtureruntime/test/shaders/ps_w64_a_uniform_vote_narrowed.asm(registered inw64_graphics.pyandtests/test_wave64_halves_fixtures.py).Tested
python -I tests/semantic/test_wave64_halves.py: 134 OK. NewUniformVotecases on the wave interpreter (64 lanes against two waves of 32, s4 = 9 and s4 = 1): four accepted forms (if/else; LLVM form with a nested saveexec/restore; SCC of that AND; SCC ofs_cmp_lg_u64) equal, each tier C onmain; near misses (a side restoring the outer EXEC, the same on the SCC form, av_writelaneside, a varying compare under a narrowed EXEC) differ and stay tier C, and an SCC branch after its mask is rewritten stays tier C.test_c_compare_under_a_narrowed_execstill differs and is tier C, now reported asstale-scalarinstead ofunsafe-vote-branch.tests/semantic/test_wave64_halves_soundness.py: 33 OK.python -I scripts/run_semantic_tests.py tests/semantic: 433 files, 5830 tests; onlytest_float_nan_fractfails, identically on cleanmain(3 failures, NaN payloads, unrelated).python -m compileall -q make_game.py tools tests: clean.ps_w64_c_vote_stale,ps_w64_c_vote_else,ps_w64_a_uniform_vote). The new fixture is tier Cunsafe-vote-branchonmain, tier A here.build.py(llvm-mc 21.1.8 fromscripts/build_llvm_mc.ps1, Vulkan SDK 1.4.363): 31 shaders, 31 translated, 31 pass spirv-val.w64_graphics.py, Windows 11:ps_w64_a_uniform_vote_narrowed.ps_w64_c_lane_idprobe reaches lane 63; 31 on the RTX 5090), so its default draw is the 64-lane reference. The new fixture's 4096 pixels are byte-identical on the two GPUs and equal the derived words;ps_w64_c_vote_elseandps_w64_c_vote_stalediffer between them.tests/test_wave64_halves_fixtures.py(pytest not installed here). Not checked: that the hardware actually leaves a half with no active pixel (the fixture narrows by whole 4-pixel rows/columns to make it likely). Corpus count not measured (no game files here); someone with the corpus can rerun--census.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed.🤖 Generated with Claude Code