Repository navigation
GPU test cs_w64x_maskbits: s_bcnt0/s_ff0/s_flbit scans of 64-bit masks in a wave64 - #2546
evilclanker9000 wants to merge 8 commits into
Conversation
v_add_co_u32, v_add_co_ci_u32, v_sub_co_u32, v_subrev_co_u32, v_sub_co_ci_u32 and v_subrev_co_ci_u32 with the carry-out in an SGPR pair or in VCC and the carry-in from an SGPR pair or from VCC, per lane of one 64-lane group. The carry-in mask differs between the two halves, so a mask cut to its low word or with its words swapped shows. The test dumps 922 words (13 ops x 64 lanes, a flag word per lane, s_bcnt1 / s_ff1 of every mask), derived from the ISA pseudocode in the .asm header. The wave32 counterpart is cs_w32_dot4_carry (ItsNotRexed#2311). check.py gets W64X_FULL for wave64 tests judged on a whole dump (--require-wave64, a skip on a device without 64-wide subgroups, no flag with LEONIDA_W64_EMULATE=1). AI-assisted.
v_cmp i32/u32/i64/u64/f32 (NaN, infinity, class) into SGPR pairs and into VCC, the 64-bit SALU logic ops on those masks (s_and/or/xor/andn2/orn2/nor/xnor_b64), and v_cndmask with the masks as selectors, per lane of one 64-lane group. The inputs differ between the two halves, so a mask cut to its low word, with its words swapped, or from a 64-bit compare of the low words alone is a different mask. The test dumps 430 words (a flag word per lane, five v_cndmask selections, s_bcnt1 / s_ff1 of every mask), derived from the ISA pseudocode in the .asm header. AI-assisted.
AI-assisted.
AI-assisted.
s_bcnt0_i32_b64 (and its SCC), s_ff0_i32_b64 on v_cmp masks, s_mov_b32 data pairs and EXEC with little or nothing in the low half, and s_flbit_i32_b64 / s_flbit_i32_i64 on the data pairs. Expected words are derived by hand in the .asm header; the same shader is a tests/semantic fixture. AI-assisted.
|
Tested 867fceb on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Tested Test programs built from The scalar bit scans of the 64-bit masks ( |
|
Tested
AI-assisted (Claude Code). |
|
Tested on Windows 11 with two GPUs on one machine (MSVC 14.51, llvm-mc 23.1.6): |
|
Tested 867fceb on an RTX 5090 (driver 616.92), Windows 11, Vulkan SDK 1.4.363. The GPU test programs were built from the same tree:
The three new AI-assisted (Claude Code). |
Conflicts: scripts/run_gpu_tests.py tests/test_shader_checks.py AI-assisted.
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 49dcdf4 on AMD Radeon RX 7900 XTX (RDNA3, Navi 31; native wave32 and wave64), AMD driver 26.11.2, Vulkan 1.4.359, Windows 11: pass.
Tools: llvm-mc 21.1.8 (WSL), Vulkan SDK 1.4.363.0, MSVC 14.44. |
|
Tested
I did not run the semantic suite or the rest of |
|
Tested The three new fixtures,
Finding: the merge of elif name == "cs_fmt_sint32":
problem = fmt_sint32_test(a.build, spirv_dir, cs_env)
elif name in dict(W64X_FULL):
...
results.append((name, ok, problem or f"{len(want)}/{len(want)} dumped words exact"))
results.append((name, not problem, problem or "64/64 dumped words exact"))That last line belonged to
Moving the Read, not measured: Not checked: the description's translator negative controls were not repeated. GitHub reports the branch as mergeable. |
scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py tests/test_shader_checks.py AI-assisted.
|
Tested
AI-assisted (Claude Code). Synthetic shaders only, no game files. |
|
Tested
Counts and pass/fail only; no game data. No code changes. AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested Built the full fixture corpus with The 8 skips are environmental, none from this PR: 3 mesh fixtures ( |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-W64-LANEOPS, #2300 (comment)
Depends on: #2455 (stacked on it, which is stacked on #2415: the branch adds an entry to
W64X_FULLincheck.py; until they land the diff shows their commits too).What and why
The scalar bit scans
s_bcnt1_i32_b64ands_ff1_i32_b64are used in many wave64 tests, buts_bcnt0_i32_b64,s_ff0_i32_b64and the 64-bits_flbitops have no wave64 GPU test (s_flbit_i32_b64/i64only run in the wave32cs_w32_salu64). A translation that scans only the low word, swaps the words, or counts the zeros of one word is wrong only for values with bits in the upper 32 lanes. This addscs_w64x_maskbits, one 64-lane group, 64 words:s_bcnt0_i32_b64(value and the SCC it writes) ands_ff0_i32_b64of 13 values:v_cmplane masks with only the high half set (lanes 32..63, lane 40, lanes 62 and 63, lane 32), a low-half-only mask, all lanes, no lane, lanes 0..39 (the first zero is in the high half), ands_mov_b32data pairs.s_flbit_i32_b64ands_flbit_i32_i64of five data pairs (bit 55,0xffffffff_00000000, all but bit 63, only bit 63, bit 40).bcnt0/ff0/SCC read from EXEC itself with EXEC set byv_cmpxto lanes 32..63, 62..63, lane 32, 0..39 and 0..31.The
.asmheader gives the ISA definitions, every value as a 64-bit constant and each result derived by hand;W64X_MASKBITS_WORDSincheck.pyis the same formulas in plain Python. The same shader is a semantic fixture (test_w64x_maskbits_fixture.py: hand constants, a bit-by-bit model, and the translated shader run on 64 lanes in the wave interpreter).No translator change.
s_flbit_i32_b64/i64of a lane mask or EXEC is stillUnsupportedby design (#210, docs/design.md), so those two run on data pairs only.Tested
compute subgroup size: 64):run_gpu_tests.py --filter cs_w64x_maskbits64/64 words exact.LEONIDA_W64_EMULATE=1(--wave64-emulate): 64/64 words exact.s_bcnt0_i32_b64not inverting the high word (Radeon: word 0 expected 0x20, got 0x40);s_ff0_i32_b64returning 0 instead of -1 when the high word is all ones (Radeon: word 13 expected 0xffffffff, got 0).python -m unittest discover -s tests/semanticOK;python tests/semantic/regen_fixtures.py --checkclean;python -I tests/test_shader_checks.pyOK.Checklist
AI-assisted.