Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 91203dd7 on Windows 11: pytest tests/test_cf_diff.py tests/test_cf_ref.py tests/test_run_gpu_tests.py tests/semantic/test_spirv_wave_interp.py -q -> 187 passed, 112 subtests passed; compileall and git diff --check clean.
The new whole-quad mode cases run s_wqm inside control flow through the fuzzer/reference and wave interpreter, including the partial-quad and 32/64-lane shapes the translator's GPU fixtures cover only as single instructions. The branch carries #4077's commits; only the final WQM commit is new, as stated. No blocking issue.
|
Automated test:
Same machine and setup as my earlier manual reports. AI-assisted (Claude Code). |
|
Tested at the head ( The rule is right: a 600-run campaign (seeds 301-303, depth 3, structured + dispatch-loop) gave 0 mismatch/skip; Two notes: changing the shape list alters the seeded RNG stream, so old seed 301 no longer replays identically - worth saying in the body; and the diff against Approve. AI-assisted review, no game files, no GPU. |
|
Tested 91203dd on Windows 11, AMD Radeon iGPU gfx1036 (RDNA2, driver 26.10.1, subgroup 32..64) and RTX 5080 (driver 616.92, subgroup 32), translator and runtime from this head (MSVC, RelWithDebInfo),
No negative control run. AI-assisted. |
|
Thanks @tupacfan04. Both points are right, and I've added a Notes section to this PR's description and to #4077 and #4134: seeds don't replay across the stack (each added shape changes the generator's random stream), and "no translator change" holds for this commit only; the diff against main still carries #615/#663's |
|
Rebased in order onto the new #663 after the latest merge round (force-pushed to the fork). No conflicts in this PR's own files; #615/#663 now keep |
|
Tested Scope: the 32-wide half only (NVIDIA Volta). The AMD / 64-wide half still needs someone with an AMD GPU. Setup: the PR diff applied to
No game files. AI-assisted (Claude Code); I ran the commands above and checked the numbers against the logs. |
|
Tested fb61f96 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested fb61f96 merged with main af70fc7 on Linux (WSL), Python 3.12.16: pass CPU/semantic only, no GPU runs (
No issues found. |
|
Tested fb61f96 on AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.6) and NVIDIA GeForce RTX 4070 Laptop (620.70.06), CachyOS Linux 7.3.4: pass. No GPU fixture and no translator change in this PR over #663 (nothing under CPU (on this head, Sensitivity: with Synthetic inputs only, no game data. AI-assisted. |
|
Tested
|
|
Tested fb61f96 on AMD Radeon RX 9070 XT (RADV GFX1201) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. 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>
…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>
Two loop shapes: per-lane trip counts closed by s_cbranch_vccnz (the wave loops while any lane wants to, EXEC unchanged), and loops that drop finished lanes with v_cmpx and close on s_cbranch_execnz. cf_ref models s_andn1/andn2_wrexec (EXEC = ~S0 & EXEC / S0 & ~EXEC, D = EXEC, SCC). No new findings: 2,600 cases with the loop shapes (structured, dispatch loop, depth 4) and s_andn2_wrexec in both wave sizes and forms match. s_andn1_wrexec and the xor/orn2/nand/nor/xnor/andn1/orn1 saveexec forms are not translated (Unsupported); every corpus shader translates, so the game does not use them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two new program shapes cover translator rules the fuzzer did not reach: - mread: s_bcnt1 / s_ff1 of EXEC, VCC or an SGPR compare mask into a uniform SGPR (wave64: _b64, or _b32 on one half), added to every active lane, optionally followed by s_cmp on it and a branch. - waterfall: v_readfirstlane of a lane value -> v_cmp_eq -> s_and_saveexec -> body -> s_xor exec, closed by s_cbranch_execnz or by the SCC of the s_xor (the descriptor-per-group-of-lanes loop). cf_ref models v_readfirstlane_b32 (lowest active lane, lane 0 when none), s_bcnt1_i32_b32/b64 (SCC = count != 0) and s_ff1_i32_b32/b64 (-1 when no bit is set); a _b32 form reads one 32-bit word, one half of the mask in wave64. Both shapes are sensitive: with v_readfirstlane read per lane (the pre-2026-11-21 translation) or s_bcnt1 counting the lane's own bit, seed 3 gives 5 and 4 mismatches of 120. Waterfalls take v1/v2/v3 (8 or 16 distinct values); v8 (one value per lane) nested inside other loops ran past the wave interpreter's step limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `wqm` shape: s_wqm of EXEC after narrowing it to a compare, or of VCC into EXEC, around a body [-> s_cbranch_execz / scc0 / scc1], with EXEC restored by s_mov; or s_wqm of a compare into an SGPR feeding an SCC branch (SCC = some quad has a lane on). Wave64 also gets the _b32 form on one half. Nested inside a divergent if, it turns quad-mates the if had turned off back on, which the translator must do through %active. - cf_ref: s_wqm_b32/b64 (each 4-bit group all ones when any bit of it is set; SCC = D != 0; a _b32 form is one 32-bit word). - spirv_wave_interp: OpGroupNonUniformQuadSwap (direction 0/1/2 reads lane ^ 1 / ^ 2 / ^ 3) and QuadBroadcast (lane 4n + index); the translator's WQM path in fragment shaders uses QuadSwap. With s_wqm put back to the identity it was before SHADER-34, 12 of the 38 generated WQM programs of seed 3 mismatch; test_whole_quad_mode_cases_ catch_an_identity_wqm pins one of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto
No game files. AI-assisted (Claude Code). |
|
Tested ab3f2c1 on AMD Radeon RX 5700 XT (RDNA1), Mesa RADV 26.2.5, Linux (CachyOS 7.3), i7-7700K: pass (AMD wave64 half)
AI-assisted (Claude Code), run by a person; built and run in a sandbox without network. |
|
Tested ab3f2c1 on AMD Radeon 8060S (Strix Halo, gfx1151, subgroup 32..64), RADV Mesa 26.3.1, Arch Linux container on Ubuntu 24.04.5 / kernel 7.0.0-38; LLVM 23.1.5, SPIRV-Tools v2026.4: pass.
Synthetic fixtures only, no game files. AI-assisted (Claude Code). |
|
checked: #4104 | with: applied the diff on main 5d74c27, ran tests/test_cf_diff.py + test_cf_ref.py + test_run_gpu_tests.py (201 passed, 161 subtests) and a live fuzz cf_diff.py --programs 200 --seed 11 --wave both --depth 4 (400 pass, 0 mismatch, 0 skipped) | on: Windows 11, RX 9060 XT | result: PASS AI-assisted check. |
|
Tested
No game files. AI-assisted (Claude Code). |
Claimed in the coordination issue: #3918 (comment) (FUZZ-8 follow-up).
Depends on: #4077 (→ #663 → #615). Review only the last commit,
cf_diff: whole-quad mode in the FUZZ-8 fuzzer.What
The translator's whole-quad-mode rule (
docs/design.md, "Whole-quad mode") is GPU-checked as single instructions (ps_wqm,cs_wqm_w32,cs_wqm_w64,cs_wqm_w64_half). Nothing ran it inside control flow until now. This adds:wqmshape intools/cf_diff.py:s_wqmof EXEC after narrowing it to a compare, or of VCC into EXEC, around a body, optionally skipped withs_cbranch_execz/scc0/scc1. EXEC is restored withs_mov.s_wqmof a compare into an SGPR feeding an SCC branch (SCC = some quad has a lane on)._b32form on one half.if, it turns quad-mates theifhad turned off back on, which the translator must do through%active.tools/cf_ref.py:s_wqm_b32/b64. Each 4-bit group of D is all ones when any bit of that group in S0 is set; SCC = D ≠ 0; a_b32form is one 32-bit word.tests/semantic/spirv_wave_interp.py:OpGroupNonUniformQuadSwap(direction 0/1/2 reads lane ^ 1 / ^ 2 / ^ 3) andOpGroupNonUniformQuadBroadcast(lane 4n + index), per the SPIR-V spec. The translator's WQM path in fragment shaders uses QuadSwap. A swap with an invocation that isn't running is an undefined value, as for Shuffle.No translator change.
Sensitivity
With
s_wqmput back to the identity it was before #156 SHADER-34, 12 of the 38 generated WQM programs in seed 3 mismatch. With the current translator all 38 match.test_whole_quad_mode_cases_catch_an_identity_wqmpins one of them.Tested
--dispatch-loop(100 programs), wave32 and wave64. 1,500 runs: 0 mismatches, 0 skips.tests/test_cf_diff.py::test_whole_quad_mode(4 cases × both waves × both forms),test_whole_quad_mode_on_one_halfand the sensitivity test;tests/test_cf_ref.py::WholeQuadModeTests(exact masks and SCC; WQM of EXEC turns on lanes 8–11 from lane 9);tests/semantic/test_spirv_wave_interp.py::QuadOps(swap and broadcast words in wave32 and wave64; a swap across a selection is undefined).pytest tests/test_cf_diff.py tests/test_cf_ref.py tests/test_cf_ref_edge_fixes.py tests/semantic/test_spirv_wave_interp.pygives 152 passed. The rest of the suite is unchanged from FUZZ-8: wave64 half-mask shapes in the fuzzer + cs_w64_exec_half GPU test (translator fix landed in #3225) #663: its full run fails onlytest_u16_high_half(fixed by Translator: constants assemble asks for late are defined too #3902),test_mutationsand twotest_cmp_class_f64subtests, and plain mainaa2988ccfails those too.No GPU test: this PR changes only the CPU fuzzer, reference and interpreter. My GPU is an RTX 5070 Ti, but this PC has no Vulkan SDK.
AI-assisted (Claude Code). No game files were used.
Notes
mainalso carries FUZZ-8: s_not_b32 lane-mask SCC in the fuzzer + @kotorvr's cs_scc_mask32 GPU test (translator fix landed in #3225) #615 and FUZZ-8: wave64 half-mask shapes in the fuzzer + cs_w64_exec_half GPU test (translator fix landed in #3225) #663, whosetools/rdna2spirv.pychange is the SCC/half-mask fix reviewed there. This PR's own commit touches only the fuzzer, the reference and the tests.