Repository navigation
Tests: wave64 GPU checks for s_and/s_or/s_andn2_saveexec_b64 and s_andn2_wrexec_b64 with VCC and SGPR-pair sources - #1665
Conversation
…C and SGPR-pair sources in wave64 cs_w64x_saveexec_b64 checks the new EXEC per lane, D (old or new EXEC) and SCC, with old EXEC and S0 different in each 32-lane half. test_saveexec_b64.py runs the four ops on all 64 lanes for both sources against the ISA lines, and the fixture. AI-assisted.
|
Tested c2251c1 on NVIDIA GeForce RTX 3070 (Ampere, subgroup 32..32), driver 610.57.04 (Vulkan 1.4.341), Debian 13 (kernel 6.12.115): pass. With 32-wide subgroups this covers the emulated wave64 path. Base is
Negative control: this PR's AI-assisted: yes |
|
Tested c2251c1 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass, including the new fixture under wave64 emulation. The PR's diff applied cleanly to
|
|
Tested
|
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-SAVEEXEC-B64
What and why
s_and_saveexec_b64ands_or_saveexec_b64with a register source had no GPU test that checks what they return. They appear in many wave64 tests as part of an if-block, but nothing looked at D or SCC, ands_or_saveexec_b64only ran with a constant source (cs_w64_mask_imm, #1367).s_andn2_saveexec_b64ands_andn2_wrexec_b64were tested with VCC only (cs_w64x_andn2_exec).This adds
runtime/test/shaders/cs_w64x_saveexec_b64.asm, a wave64 dump test (64 threads, one wave):s_and_saveexec_b64with an SGPR-pair source (v_cmp_*_e64intos[10:11]) and with VCC;s_or_saveexec_b64with VCC and with an SGPR pair;s_andn2_saveexec_b64ands_andn2_wrexec_b64with an SGPR-pair source.It checks the new EXEC per lane (each lane on in it writes 1, then a compare collects them), D (old EXEC for saveexec, new EXEC for wrexec) and SCC. In every case the old EXEC and S0 differ between the two 32-lane halves, so swapped halves move the lowest lane and a result cut to 32 bits loses lanes. Three SCC cases cover an empty result, two halves that don't overlap (AND gives 0), and a result in the high half only. The header derives the eight words from the ISA pseudocode.
tests/semantic/test_saveexec_b64.pyruns the same four ops on all 64 lanes for both sources and 13 pairs of S0 and EXEC each, compared against the ISA lines written as integers. It also runs the new fixture. The test is registered incheck.py(W64X_DUMPS),run_gpu_tests.pyandregen_fixtures.py.The translator doesn't handle
s_xor,s_orn2,s_nand,s_nor,s_xnor,s_andn1ors_orn1_saveexec_b64(they areUnsupported), so they are not tested here.Overlap checked:
tools/crosslane_fuzz.pyrunss_and_saveexec_b64on the GPU, but only reads D back throughs_mov_b64 execand never checks SCC.tools/cf_diff.py(#663) usess_and/s_or_saveexecwithout a GPU. #293 and #1299 don't test these ops in wave64.Tested
On main 41f4482 + this commit, Windows 11:
--require-wave64, "compute subgroup size: 64")cs_w64x_saveexec_b64passes:6160 12304 5120 2088 6168 8192 7176 1837171; all 20w64x_tests passLEONIDA_W64_EMULATE=1(subgroup 32)w64x_tests passs_or_saveexeccomputed as AND intools/rdna2spirv.py(reverted)python -m unittest discover -s tests/semanticregen_fixtures.py --check,tests/test_shader_checks.py,compileallNo translator change, so no
docs/design.mdrow, and the translated andspirv-valcounts are unchanged. No bug found.AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (None here: tests only.)