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 |
…low-up to ItsNotRexed#477) s_not_b32 has its own handler and still set SCC from the lane's own bit after ItsNotRexed#477 moved the SOP2 forms to the wave vote. It now goes through scc_logic too (one or two sources). Reported by @kotorvr in ItsNotRexed#477. - 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 (and 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. - docs/design.md: s_not_b32 in the rule, the ItsNotRexed#477 GPU results and @kotorvr's corpus count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es, as main's new rule) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
|
Rebased onto main
The earlier GPU results still apply: the shader and the translator rule didn't change. Tested in WSL Ubuntu (Python 3.14, llvm-mc 21) together with #663: |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 15a9482 (merge base aa2988c) on NVIDIA GeForce RTX 5080, Linux 580.65.06: pass Tested the PR head merged with current main
Line-by-line against my main run (results that differ from main):
PR-specific: Not run: the full AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). |
Item: FUZZ-8 follow-up, claimed in #374: #374 (comment)
What
@kotorvr found in #477 that
s_not_b32has 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). Before this change, lanes 0-7 saw 0. It now goes throughscc_logiclike the SOP2 forms: a subgroup vote in wave32 when the source holds a lane mask or the result goes to EXEC, andD != 0otherwise.s_not_b64already voted.Impact is small. @kotorvr counted no wave32
s_not_b32onexec_lo/vcc_lowhose SCC is read in the corpus. This just closes the gap.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 in 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
pytest tests --ignore=tests/semanticgives 1870 passed, 44 skipped, 1 xfailed;unittest discover -s tests/semanticOK;tests/test_run_gpu_tests.pyOK.cf_diff.py: 800 cases with--spirv-val, 800 in the dispatch-loop form, and 400 more after rebasing, all 0 mismatches.build.py cs_scc_mask32 ps_scc_mask32: both translate and pass spirv-val.cs_scc_mask32should printout[0..7] = 7 0 0 9 11 13 7 13on any GPU; wave32 runs natively on NVIDIA.AI-assisted (Claude Code). No game data.
🤖 Generated with Claude Code