Repository navigation
Conversation
|
Verified
I ran Word 3 is written by lane 3. Complementing the lanes-0–7 mask leaves lanes 8–31 set, so the wave-wide SCC selects 9 even though lane 3's own result bit is zero. The other seven words stayed equal. AI-assisted hardware verification using the PR's synthetic fixture. |
b9c3664 to
e3b5c3b
Compare
Two wave64 findings of tools/cf_diff.py with new mask shapes:
- A register written to exec_lo (s_and_b32 exec_lo, exec_lo, vcc_lo;
s_mov_b32 exec_lo, s0) set all 64 lanes, and any op but s_mov_b32
into exec_hi was rejected ("destination exec_hi"). dst() now writes
one half through exec_half_write; the other half keeps its lanes.
- The SCC of a 32-bit op on one half of a mask (vcc_lo/hi, exec_lo/hi,
a half-mask SGPR) took the lane's own bit. scc_logic now votes over
that half (scc_any_half). The half comes from the sources, or from an
EXEC/VCC destination; an SGPR destination's old half is ignored.
A program with no SCC reader (s_cbranch_scc*, s_cselect, s_addc/subb,
s_cmov*, an scc operand) skips the vote, so --wave64-emulate does not
pay an exchange for an SCC nobody reads (keeps
test_wave64_emulate_reuses_a_mask_exchange at its counts).
Fuzzer: cf_ref treats every _b32 op as a 32-bit word op (halves
included) and models s_cmp_eq/lg_u64 and s_cselect_b64; cf_diff adds
e64 compares into SGPR masks (saveexec, v_cndmask), constant EXEC,
half-EXEC ops, half-mask SCC, s_cmp on masks and s_cselect between
masks, and counts literals in instruction sizes. GPU test
cs_w64_exec_half (wave64 dump; expected 1 0 1 1 0 3 9 9).
Depends on: ItsNotRexed#615
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IAmNotSiob
left a comment
There was a problem hiding this comment.
nice cleanup, s_not_b32 now goes through scc_logic like the other bitwise ops. tests pass with main (805) :) AI-assisted review (Claude Code).
|
Ran a separate seed on |
|
Tested e3b5c3b on RTX 4090 (driver 621.14, 32-wide subgroups), Windows 11 26200: pass
No game files used. AI-assisted run (Claude Code). |
|
Tested
The CONFLICTING status against |
Two wave64 findings of tools/cf_diff.py with new mask shapes:
- A register written to exec_lo (s_and_b32 exec_lo, exec_lo, vcc_lo;
s_mov_b32 exec_lo, s0) set all 64 lanes, and any op but s_mov_b32
into exec_hi was rejected ("destination exec_hi"). dst() now writes
one half through exec_half_write; the other half keeps its lanes.
- The SCC of a 32-bit op on one half of a mask (vcc_lo/hi, exec_lo/hi,
a half-mask SGPR) took the lane's own bit. scc_logic now votes over
that half (scc_any_half). The half comes from the sources, or from an
EXEC/VCC destination; an SGPR destination's old half is ignored.
A program with no SCC reader (s_cbranch_scc*, s_cselect, s_addc/subb,
s_cmov*, an scc operand) skips the vote, so --wave64-emulate does not
pay an exchange for an SCC nobody reads (keeps
test_wave64_emulate_reuses_a_mask_exchange at its counts).
Fuzzer: cf_ref treats every _b32 op as a 32-bit word op (halves
included) and models s_cmp_eq/lg_u64 and s_cselect_b64; cf_diff adds
e64 compares into SGPR masks (saveexec, v_cndmask), constant EXEC,
half-EXEC ops, half-mask SCC, s_cmp on masks and s_cselect between
masks, and counts literals in instruction sizes. GPU test
cs_w64_exec_half (wave64 dump; expected 1 0 1 1 0 3 9 9).
Depends on: ItsNotRexed#615
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e3b5c3b to
15a9482
Compare
|
Tested
AI-assisted (Claude Code). |
15a9482 to
13ff681
Compare
|
Rebased onto The translator half of this PR is on
Tested (WSL Ubuntu, CPU): AI-assisted (Claude Code). |
|
Tested 13ff681 on Apple M2 with MoltenVK 1.4.2 (macOS 26.4 (25E246), subgroup 4..32, device Vulkan 1.4.357): cs_scc_mask32 passes bit-exact; full suite 153/218 passed, 58 skipped, 7 failed vs base 98fa503 152/217, 58 skipped, 7 failed A/B; no regression.
No game data; synthetic fixture and counts only. AI-assisted. |
…_mask32 GPU test The translator side of this PR (s_not_b32 on a wave32 lane mask votes its SCC) landed on main through ItsNotRexed#3225 (SweatierKey), so the branch now keeps main's tools/rdna2spirv.py and adds the checks around it: - tools/cf_ref.py models s_not_b32/b64; tools/cf_diff.py generates s_not in the sccmask/csel shapes; tests/test_cf_diff.py has the two s_not regression cases (they fail with the old per-lane SCC). - runtime/test/shaders/cs_scc_mask32.asm: @kotorvr's compute test for s_and + s_cselect, s_andn2 + s_cbranch_scc1, s_not, s_or, s_xnor, registered as a wave32 dump in check.py and run_gpu_tests.py (skipped below 32 lanes). - docs/design.md: s_not_b32 in the rule, the GPU results and @kotorvr's corpus count. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13ff681 to
b748ddc
Compare
…alf GPU test The translator side of this PR (wave64 32-bit ops on one half of EXEC/VCC: exec_lo writes and the half's SCC vote) landed on main through ItsNotRexed#3225 (SweatierKey), so the branch now keeps main's tools/rdna2spirv.py. The new shapes below pass on it; they found both bugs on the translator before ItsNotRexed#3225: - A register written to exec_lo set all 64 lanes, and any op but s_mov_b32 into exec_hi was rejected ("destination exec_hi"). - The SCC of a 32-bit op on one half of a mask took the lane's own bit. Fuzzer: cf_ref treats every _b32 op as a 32-bit word op (halves included) and models s_cmp_eq/lg_u64 and s_cselect_b64; cf_diff adds e64 compares into SGPR masks (saveexec, v_cndmask), constant EXEC, half-EXEC ops, half-mask SCC, s_cmp on masks and s_cselect between masks, and counts literals in instruction sizes. GPU test cs_w64_exec_half (wave64 dump; expected 1 0 1 1 0 3 9 9). Depends on: ItsNotRexed#615 AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased the FUZZ-8 stack onto Tests (WSL Ubuntu, llvm-mc 21, CPU only; the PC's RTX 5070 Ti not used): on #615's head, |
|
Tested b748ddc on Intel UHD Graphics 630 (CFL GT2), Mesa ANV, subgroup 8..32: run_gpu_tests.py --filter scc_mask32 prints "PASS cs_scc_mask32 7 0 0 9 11 13 7 13" and "1/2 passed, 1 skipped". ps_scc_mask32 skips because the device has no VK_KHR_fragment_shader_barycentric, so it is not checked here. With LEONIDA_VK_DEVICE=NoSuchDevice both rows fail with "no Vulkan physical device matches". tests/test_cf_ref.py runs 26 tests OK, tests/test_run_gpu_tests.py 47 OK and tests/test_cf_diff.py 48 passed under pytest. The two new s_not cases were not run separately, and the 800-program cf_diff sweep was not run. AI-assisted. |
Item: FUZZ-8 follow-up, claimed in #374: #374 (comment)
What
Update 2026-11-23: this PR no longer changes
tools/rdna2spirv.py. #3225 (SweatierKey,99c048f7) makess_not_b32on a wave32 lane mask vote its SCC as well. It landed while this PR waited, and the rebase ontomain98fa503fkeepsmain's translator. What's left is the fuzzer coverage and @kotorvr's GPU test.@kotorvr found in #477 that
s_not_b32had its own handler, which still set SCC from the invocation's own bit after #477 moved the 32-bit SOP2 forms to the wave vote.s_not_b32 s11, s8withs8= lanes 0-7 should give SCC = 1 in every lane (lanes 8-31 are set). Lanes 0-7 saw 0. That is fixed onmainnow.Impact is small. @kotorvr counted no wave32
s_not_b32onexec_lo/vcc_lowhose SCC is read in the corpus.tools/cf_ref.pymodelss_not_b32/s_not_b64(SOP1: D = ~S0, SCC = D != 0).tools/cf_diff.pygeneratess_notin thesccmaskandcselshapes.tests/test_cf_diff.py: two new regression cases (s_not_b32+s_cbranch_scc0,s_not_b32+s_cselect_b32). They pass onmainin both forms and fail with the old per-lane SCC.runtime/test/shaders/cs_scc_mask32.asm: @kotorvr's compute test from FUZZ-8: control-flow/EXEC differential fuzzer; wave32 SCC of mask ops is wave-wide #477, with credit, unchanged apart from a header line. It coverss_and+s_cselect,s_andn2+s_cbranch_scc1,s_not,s_orands_xnor; expected7 0 0 9 11 13 7 13. It's registered as a wave32 dump incheck.pyandscripts/run_gpu_tests.py. On FUZZ-8: control-flow/EXEC differential fuzzer; wave32 SCC of mask ops is wave-wide #477's head @kotorvr measured7 0 0 4 11 13 7 13(out[3] is thes_notcase), and onmainbefore FUZZ-8: control-flow/EXEC differential fuzzer; wave32 SCC of mask ops is wave-wide #477,3 5 5 4 6 2 3 2.docs/design.md:s_not_b32in the SCC row, the FUZZ-8: control-flow/EXEC differential fuzzer; wave32 SCC of mask ops is wave-wide #477 GPU results and @kotorvr's corpus count (1,794 of 4,828 wave32 shaders uses_andn2_b32 sN, sN, exec_lo+s_cbranch_scc0/1).Plain-data
s_not_b32SCC is unchanged, so this doesn't overlap #568 (single-lane tests of the same ops).Tests
13ff6814(rebased onto98fa503f):tests/test_cf_diff.py,test_cf_ref.py,test_run_gpu_tests.pyandtests/semantic/test_spirv_wave_interp.pygive 129 passed, 132 subtests. The fullpytest tests --ignore=tests/semanticon the stack tip shows only the 7 failures plainmainhas.cf_diff.py: 800 programs over the stack tip (seeds 4242/4243, wave32/64, depth 4 dispatch loop): 0 mismatches.cs_scc_mask32prints7 0 0 9 11 13 7 13in testers' runs (NVIDIA, RDNA2/3/4, Apple M2/MoltenVK; see the comments). I didn't run it myself (no Vulkan SDK on this PC; RTX 5070 Ti).AI-assisted (Claude Code). No game data.
🤖 Generated with Claude Code