Repository navigation
Conversation
|
Independent RTX 5070 / 621.24 check of I also ran a variant that writes the first kill predicate to VCC instead of replacing EXEC, then uses The GPU here is 32-wide only, so I compared to the fixture's pixel reference. I used synthetic listings with the fixture's branch layout and did not rerun the AMD assembler or native wave64 hardware comparison. |
|
Tested This fixture is run by Tier A means the image is identical at the required 64-wide and at 32-wide, and it matches the words the fixture derives, so the pixel-kill early exit is exact at both widths here too. Tier C fixtures still skip on this card (it cannot require both sizes and there is no |
|
Tested
One note for other testers: AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
|
Note 🤖 Claude Opus 5.5 responding on behalf of labj1987 Thanks @TurboSosiska304 and @Yourrespawn. On the |
461a72e to
97575d5
Compare
|
Tested The claim is "exact on 32-wide subgroups", so I ran the new fixture as the two-device comparison
So the discarded pixel's early exit really produces the same image in one 64-lane wave and in two 32-lane halves, on a driver other than the one you ran. Targeted corpus check (own 1.0.2.1 copy, counts only). A full re-translation is ~2 h here, so I took shard 0 of my translated corpus and selected the 93 shaders whose only tier-C reason is
That is 83.9% of that bucket promoted, which is the same direction and a comparable rate to your +1,022 of 11,405. I did not reproduce the corpus-wide 2,117 → 3,139 (no full run here), and I note the 15 that stay C with the same single reason in case that residual is expected: if AI-assisted. |
|
Corpus census on my own 1.0.2.1 copy: your numbers reproduce exactly. AI-assisted; counts only, no game data. I translated the 11,405 wave64 VS/PS/GS shaders (gs 195, ps 10,031, vs 1,179) with base
Per shader (base vs head
Together with the GPU fixture runs above, that covers the game-copy part of the queue entry. |
97575d5 to
8722380
Compare
|
Measured with ps_oracle (#3061) on gfx1036 (AMD Radeon iGPU, Windows driver 26.10.1). I ran this PR's |
|
AI-assisted review (Claude Code). I used no game files. All listings are hand-written. Head What I ran
Result: pass. Each listing that this head moves from tier C to tier A gives equal results. Each listing whose results differ stays tier C. Tier A here (tier C
Tier C here, and the results differ, 11 listings:
Tier C here although the results are equal, 2 listings (conservative, no defect): Notes
|
A wave64 pixel shader that kills pixels with `s_andn2_b64 live, live, exec/vcc` and branches with `s_cbranch_scc0` to a block that only empties EXEC from that mask, exports and ends was tier C unsafe-vote-branch. It is exact on 32-wide subgroups: a half whose live mask is empty writes nothing in the exit and discards its pixels, and in the wave its lanes stay off to the end. The rule accepts it only when: - the branch tests the mask's own "not empty": the last SCC writer is a 64-bit logic op into that mask (or s_cmp_lg_u64 mask, 0) and nothing rewrites the mask before the branch (or vccz/vccnz); - the exit only sets EXEC from that mask (or 0), exports and ends: no other code, store or successor; - the run side narrows EXEC into the mask's whole quads before anything but mask arithmetic runs and keeps it inside on every path, loops included (a must-dataflow over narrowings and copies, unions and s_wqm of registers known to be inside); - no `exp ... vm` can run before the vote (a latched vm export would keep the pixels alive in the wave). Tests: classification of the kill (wqm + s_and, v_cmpx + s_mov, direct s_and / s_mov / s_wqm exec, exit through exec 0, an if/endif after it) and near misses (exit with code, a store, an SGPR write, another mask, a jump back; a run side that does not narrow or widens again; the mask rewritten after the vote; SCC = mask == 0; a vm export before the vote; a shared exit), and 64 vs 2x32 vertex runs. GPU fixture ps_w64_a_discard: RX 580 (RADV, required size 64) and RTX 5070 (32, against the 580 reference) equal the derived words. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row matches the code The run side of a pixel kill's early exit was rejected when its first narrowing was `s_and_saveexec_b64 sN, <wqm mask>` (OFF_OK had only s_mov/s_and/s_wqm), which also left confine_step's `old_inside or ok(x)` branch unreachable. Allow s_and/s_andn2 _saveexec/_wrexec while EXEC is not yet inside: their new EXEC is S0 & EXEC or S0 & ~EXEC, so it is inside when S0 is, and the saved old EXEC is not treated as inside. s_or_saveexec first stays tier C, as does a restore of the saved EXEC. The design.md row now says the exit may export (an export is not required) and lists every EXEC write the must-dataflow keeps inside. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inned by a test The kill rule's vote has no join: its run side is the rest of the program and ends it. A check of the votes whose run side must rejoin the skipped path with EXEC restored and must not end the program (SHADER-747, the `accepted` table of ItsNotRexed#4541) would make every kill exit tier C `unconfined-vote-side`. vote() now records the votes the kill rule accepts in `kill_exits` (mask registers, run side, exit), and KillExit.test_kill_vote_is_not_a_skip_region pins it: a kill with an if/endif on its run side stays tier A, its vote is the only one in `kill_exits`, its run side never reaches the exit, and it is not in an `accepted` table if the analysis has one. Whichever of ItsNotRexed#2674 and ItsNotRexed#4541 merges second has to keep the kill votes out of `accepted` (checked: ItsNotRexed#4541's tool patch on top of this branch passes with them left out and fails with them added). Also renames confined/confine_step to kill_confined/kill_confine_step: ItsNotRexed#4541 adds its own confine_step, which would silently replace ours on merge (every kill became analysis-error). AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8722380 to
aa1446d
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of labj1987 Rebased on
|
|
AI-assisted (Claude Code). No game files; hand-written listings; CPU wave interpreter only (Windows 11, Python 3.14.7). I ran the 24 kill listings of my review again at the rebased head |
# Conflicts: # docs/design.md
main now has ItsNotRexed#2469 and ItsNotRexed#2674 in tools/wave64_halves.py and a memory in tests/semantic/spirv_wave_interp.py (TEST-722), so: - tools/wave64_halves.py: both sides kept (mem_writes next to pure_spill_vgprs; uniform_load after the scaled lane-count tag). - tests/semantic/spirv_wave_interp.py: main's memory replaces the read-only memory of this branch. One correction: main has the PhysicalStorageBuffer branch of OpLoad inside OpAccessChain, behind a return, so a load through such a pointer raises IndexError. The branch is moved to OpLoad. - tests/semantic/test_spirv_wave_interp.py: main's file, plus MemoryLoad (3 tests; 2 of them raise IndexError with main's interpreter). - tests/semantic/test_wave64_uniform_load.py: each wave gets its own copy of the memory. - docs/design.md: main's SHADER-10 row, with the sentence of ItsNotRexed#4373 and the text of this branch put back. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
main now has ItsNotRexed#2469 and ItsNotRexed#2674 in tools/wave64_halves.py: analyse() keeps its new scalar_spills key next to the optional why key, and the SHADER-10 row is main's text with the --why sentence put back. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested Corpus (counts only):
GPU (test programs built from
AI-assisted (Claude Code). |
… unsafe-vote-branch Rebased on main, which added test_c_mask_redefined_or_not_the_vote (ItsNotRexed#2674's kill rule): a mask rewritten after its vote must be tier C with reason unsafe-vote-branch. Dropping the SCC vote tag made it tier C with tainted-branch instead. put() now turns the tag into ('stale_vote', ...), and s_cbranch_scc* on a stale vote reports unsafe-vote-branch; no other SCC reader sees a vote. docs/design.md wording follows.
|
Note 🤖 Claude Opus 5.5 responding on behalf of labj1987 Closing: |
SHADER-439 (claimed in #1902, carried to #2516).
tools/wave64_halves.pycalled the pixel kill early exitunsafe-vote-branch, so most alpha-tested wave64 pixel shaders were tier C (not exact on 32-wide subgroups) although they are exact.The pattern. After a kill,
s_andn2_b64 live, live, execdrops the killed lanes ands_cbranch_scc0jumps to an exit when none are left:s_mov_b64 exec, live(empty),exp null done vm,s_endpgm. A 32-lane half whose live mask is empty takes that exit alone and writes nothing. In the wave its lanes are off on the run side anyway, because it narrows EXEC towqm(live)and quads never span the halves. So the output is the same.The rule (non-EXEC votes in
Analysis.vote), tier A when all hold:kill_vote: the vote is the mask's own "not empty": the last SCC writer in the block is a 64-bit logic op writing the voted mask (ors_cmp_lg_u64 mask, 0), and nothing after it rewrites the pair.inert_exit: the exit only sets EXEC from the mask or 0, may export, and ends.confined: a must-dataflow over every block reachable from the run side keeps EXEC insidewqm(mask)(loops included; and/andn2 saveexec and wrexec allowed as the first narrowing).exp ... vmin a block that can reach the vote.The tool also no longer tags SCC as a vote for
s_mov_b64/s_cselect_b64, which don't write SCC (a branch on a stale SCC after such a copy came out tier A).Corpus (own 1.0.2.1 copy, counts only,
--censuson main ec8ec4c vs this branch): wave64 graphics tier A 2,117 -> 3,139 of 11,405 (18.6% -> 27.5%; C 9,271 -> 8,249).Tested
tests/semantic: new classKillExit(16 tests) plustest_mov_of_a_mask_is_not_a_vote. Tier A forms (wqm +s_and/s_mov/s_wqmexec,v_cmpx, saveexec first, exit throughexec 0, kill then if/endif) and near misses that stay C (exit with code of its own, store, SGPR write, other mask, export before narrowing; run side that doesn't narrow, widens again or narrows to another mask; mask rewritten after the vote;s_cmp_eq;vmexport before the vote). Wave-interpreter runs, 64 lanes against two waves of 32: the kill shader is equal, the widening variant differs. The tier A and execution tests fail without the change. All 4,153 semantic tests pass (rebased on ec8ec4c),pytest tests/test_wave64_halves_fixtures.pypasses,compileallclean.ps_w64_a_discard(three kills, whole 32-lane halves discarded, a separate exit per kill): ok on an RTX 5070 (32 only, NVIDIA 620.73.04) and an RX 580 (RADV, 64 only), and the 5070 run equals the RX 580 64-lane reference (W64G_REF). The 64-lane reference run usedvk_harnesswith TEST-319: GPU-check the wave64 graphics permutes on NVIDIA, and stop refusing lane-id bpermute addresses #2260's single-size change; on main the RX 580 run is skipped. On llvmpipe (8-wide) it was ok at the first commit.Review: a separate reviewer approved; its nits (saveexec as the first narrowing, design.md wording) are fixed. It also found two older false tier A cases in SCC vote tagging that this PR doesn't touch; they're claimed separately and fixed in the PR that follows.
May need a small rebase against #2469 (same test file). No game data. AI-assisted (Claude Code).
🤖 Generated with Claude Code