Repository navigation
crosslane_fuzz: --ext adds wave64 carries, DS permutes, mask SALU with SCC probes and SI_LOOP loops (model checked on RDNA2) - #3734
Conversation
…h SCC and loops Wave64 programs get v_*_co(_ci)_u32 through SGPR pairs and VCC, ds_bpermute_b32, ds_permute_b32, ds_swizzle_b32, lane selects of 64 and up, the b64 mask ops with an SCC probe, the saveexec/wrexec family, s_bfm_b64, s_wqm_b64 and SI_LOOP-shaped loops. Seeds without the flag, and wave32 programs, are unchanged. The model was checked on RDNA2 (gfx1036): 100/100 programs. AI-assisted.
|
Tested bf73f8e on AMD Radeon 610M iGPU (RDNA2 gfx1036, RADV Mesa 26.2.6, subgroup 32..64) and NVIDIA RTX 4070 Ti (615.78.08, subgroup 32..32), Fedora 45: pass, 0 mismatches anywhere. Model against hardware. This is an independent run of the model on gfx1036, through
Seed 21 reproduces the description's 100/100 with 29 hypothesis programs, all confirmed. Translator (
Also:
AI-assisted (Claude Code); numbers copied from the run logs. |
|
Tested bf73f8e on AMD Radeon RX 9070 XT (RDNA4, gfx1201), AMD 26.11.2 (LLPC), Windows 11: pass on your seeds. I found one translator gap on other seeds; it isn't caused by this PR. The runtime was built at f847748, this PR's base.
The two rejected programs come from a translator gap.
I'm claiming the translator fix: a missing offset will be read as AI-assisted (Claude Code). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested Windows 11 (26200), MSVC 14.50 (VS 2026), Ninja RelWithDebInfo. Two GPUs: Ryzen 7 9700X iGPU (RDNA2, AMD 32.0.21042.62, 64-wide subgroup) and RTX 3070 (NVIDIA 610.74, 32-wide), picked with
Not checked: AI-assisted; measured on my PC. |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-XLFUZZ-W64EXT, #3381 (comment)
What and why
tools/crosslane_fuzz.py(FUZZ-7) covers lane selects, ballots,v_mbcnt, permlane and DPP, but several wave64 cross-half paths of the translator had no random coverage: carries through 64-bit masks, the DS lane permutes, SCC of the 64-bit mask ops, and loops whose lanes leave on different iterations.--extadds them to wave64 programs:v_add_co,v_sub_co,v_subrev_co_u32and the_ciforms, carry in and out in SGPR pairs or VCC.ds_bpermute_b32,ds_permute_b32(address permutations and colliding addresses),ds_swizzle_b32(QUAD_PERM,BITMASK_PERM,SWAP,REVERSE,BROADCAST).v_readlane/v_writelanewith an SGPR lane select of 64 and up.s_bcnt0/1,s_ff0/1,s_and/or/xor/andn2_b64, all tens_*_saveexec_b64forms,s_andn1/andn2_wrexec_b64,s_wqm_b64,s_cmp_eq/lg_u64,s_bitcmp0/1_b64, each followed by ans_cselect_b32so the SCC is stored;s_cselect_b64between masks;s_mov_b64 exec, mask;s_bfm_b64.s_andn2_b64 exec,s_cbranch_execnzback to the head, around one to four of the other ops.resolve_branchesand the native kernel text learn backward branches (branch_offsetsis the pure part, unit-tested).Without the flag, and for wave32 programs with it, a seed gives the same program as before (
test_dpp_seeds_are_unchangedandtest_programs_are_reproduciblestill pass). An EXEC-offds_swizzle_b32source is tagged like the permlane case, so such programs are filedhyp_onlyuntil #2780 lands. Left out on purpose: 32-bit ops on one half of a mask (#663, #3225) and carries with a DPP source (#3553), which are known open differences.Tool, tests and docs only; no translator change.
Tested
python -I tests/test_crosslane_fuzz.py: 71 tests OK (15 new inExt: each op's model against hand-computed values, the loop's trip counts, forward and backward branch offsets, a label for every loop in the native kernel text, wave32 and no-flag seeds unchanged).--self-testOK.tests/test_docs_*.pyOK.--ext --dpp --wave 64 --oracle hw --programs 100 --seed 21 --no-maskdatamatches 100/100 (groups of one to three waves and partial waves; 29 programs with a hypothesis op, all confirmed).--w64-native) 85 match, 0 mismatch, 15hyp_only;--wave64-emulatethe same. The 15 reach an EXEC-offv_permlaneords_swizzle_b32source (Translator: v_permlane16/x16 FI=0 and BOUND_CTRL for source lanes off in EXEC (SHADER-74) #580, SHADER-503: zero inactive source lanes in DS_SWIZZLE_B32 #2780).--ext --dpp --wave 64 --modes emulate --programs 60 --seed 23: 46 match, 0 mismatch, 14hyp_only.s_bfm_b64's size masked with 31 instead of 63 intools/rdna2spirv.py,--ext --wave 64 --modes emulate --programs 30 --seed 22reports a mismatch (program 2200084, abfmprogram, lanes 62-63); reverted, the same run has none.What the hardware run settled is written up in
docs/shader_validation.md(FUZZ-7): the DS ops needs_waitcnt lgkmcnt(0)before their result is used, they stay inside the 32-lane half, collidingds_permute_b32senders resolve to the highest lane, and an EXEC-off source reads 0.Checklist
AI-assisted.