Repository navigation
wave64_halves: allow two-sided EXEC-narrowing vote branches (SHADER-739) - #5747
sb17-stack wants to merge 1 commit into
Conversation
|
Independent CPU soundness verification on Linux (Python 3.13.5, head
|
|
Tested a46a6ac with the Python translator tests only, no GPU: test_wave64_halves.py and test_wave64_halves_soundness.py run 132 tests OK, including test_vote_if_else_both_sides_narrow_exec. With the translator tools from the base commit 3faac55 the new test file also passes ("Ran 31 tests", OK), and a probe of the saveexec-shaped vote on both the base and head tools prints tier A with no reasons, so the new test does not fail without the change. I could not find the 3 line-ending tests the description names. AI-assisted. |
|
Tested
|
Kam471
left a comment
There was a problem hiding this comment.
Head a46a6ac7a277, based on 3faac557b (1,806 commits behind 561b65a). Cherry-pick onto 561b65a is clean.
Commands: python -I -m pytest tests/semantic/test_wave64_halves*.py -q -> 159 passed, 22 subtests on the merged tree (132 on the stale head); python tests/semantic/test_wave64_halves_soundness.py -> 34 OK; git diff --check clean.
Corpus: re-analysed all 14,532 VS/PS/GS listings with wave64_halves.analyse (300/300 sampled tiers equal the stored index): 0 tier moves (0 C->A, 0 C->B, no A/B->C) and 0 reason changes. #5429 is unchanged by this PR: A 5,054 / B 106 / C 8,245. Current 561b65a baseline is A 5,059 / B 101 / C 8,245 (5 A/B drift, no C change).
Verdict: request changes.
narrows_notalso acceptss_andn2_b64 exec, exec, reg: that isEXEC & ~reg, so a 32-wide all-no half runs the else block (saveexec/wrexecarereg & ~EXECand zero it). Synthetic if/else: tier A here, but 64-wave output 4/1 vs two 32-wave 4/10; base is tier Cunsafe-vote-branch. Drop that arm or prove its else side inert.- The added test does not exercise the change:
s_cbranch_vccz 2lands on thes_mov_b64 exec/s_branchbefore the else block, so main already returns tier A. Offset 4 reachess_andn2(base C -> PR A); it still never coverss_andn2_b64. docs/design.md:463still says the vote's other side must be the join with no code of its own.- Merge-tree conflict with #4541 (same
vote()/test area): needs rebase/merge order.
|
Hardware confirmation of @SweatierKey's counterexample, as a wave64 pixel shader on a GPU that can require both 64 and 32 on the fragment stage: AMD Radeon RX 7600 (RDNA3, gfx1102, subgroup 32..64), AMD 26.11.2 (LLPC), Windows 11 10.0.26300. I wrote the counterexample as a Translator tier (build.py index):
GPU,
At 64 the pixel's whole wave takes the
ps_w64_c_vote_narrow2.asm (hand-written, no game data)Run with an AI assistant (Claude). |
|
Verdict: needs changes. Windows 11 and Python 3.15.2, synthetic CPU fixtures. Tested PR head Three additional counterexamples reproduce beyond the previously reported live else-arm value:
The PR classifies all three cases as tier A. Current main and the local comparison commit AI-assisted. |
|
Tested a46a6ac on AMD gfx1036 (26.11.2) and RTX 4070 Ti SUPER (621.14), Windows 11: pass.
Setup: Windows 11. GPUs are an AMD Ryzen 7 9800X3D iGPU (RDNA2 gfx1036, driver 26.11.2, subgroup 32..64) and an RTX 4070 Ti SUPER (NVIDIA 621.14, subgroup 32). Each PR was tested in its own worktree with:
Baseline is main
The NVIDIA failure is |
Allows
Analysis.vote()intools/wave64_halves.pyto accept structured two-sided vote branches where one branch narrowsEXECtoregand the other narrowsEXECto~reg(s_andn2_saveexec_b64,s_andn2_wrexec_b64, ors_andn2_b64) before reaching a common join block.Analysis.narrows_not()and two-sided narrowing/join check intools/wave64_halves.py.test_vote_if_else_both_sides_narrow_execintests/semantic/test_wave64_halves_soundness.py.test_wave64_halves*.pytests and 3 line-ending tests pass; synthetic inputs only, no game data.SHADER-739