Skip to content

GPU test cs_w32_saveexec_ext: the saveexec / wrexec kinds of #1657 - #1771

Open
LouisRiverstone wants to merge 4 commits into
ItsNotRexed:mainfrom
LouisRiverstone:gpu-test-saveexec
Open

LouisRiverstone wants to merge 4 commits into
ItsNotRexed:mainfrom
LouisRiverstone:gpu-test-saveexec

Conversation

@LouisRiverstone

Copy link
Copy Markdown
Contributor

A GPU test for the saveexec/wrexec kinds #1657 added with CPU checks only: s_xor/andn1/orn1/orn2/nand/nor/xnor_saveexec_b32 and s_andn1_wrexec_b32.

runtime/test/shaders/cs_w32_saveexec_ext.asm, one wave32 group:

  • S0 is lanes 10..29 and each step's EXEC is lanes 0..23, both built from compares, as compiled code builds lane masks.
  • Each step stores (s_bcnt1 << 8) | s_ff1 of the new EXEC: the whole wave's lane count and first lane, so the word doesn't depend on which lane stores it.
  • Lanes EXEC had off (24..31) turn on where the op gives 1, as on hardware.
word op new EXEC expected
0 xor lanes 0..9, 24..29 0x1000
1 andn1 0..9 0xA00
2 orn1 0..23, 30..31 0x1A00
3 orn2 10..31 0x160A
4 nand all but 10..23 0x1200
5 nor 30..31 0x21E
6 xnor 10..23, 30..31 0x100A
7 s_andn1_wrexec_b32 0..9 0xA00

Registration: it's a wave32 lane-mask dump, so it goes in WAVE32_DUMPS and WAVE32_LANE_DUMPS in check.py and the matching lists in run_gpu_tests.py. Like cs_w32_permute, it's skipped on devices whose subgroup is narrower than 32 (llvmpipe), so CI's llvmpipe job will skip it. It needs a 32-lane GPU (NVIDIA, AMD, Intel with 32 requested). Also registered in regen_fixtures.py, with its fixture.

CPU check: tests/semantic/test_saveexec_ext_fixture.py runs the fixture as one wave32 group in spirv_mini_interp. The expected words come from tools/cf_ref.py _SAVEEXEC, the FUZZ-8 ISA model, not from the translator. 3/3 pass; regen_fixtures.py --check passes. python -I -m unittest discover -s tests/semantic: 1453 tests OK (2 skipped). tests/test_shader_checks.py and tests/test_run_gpu_tests.py OK.

Not yet run on a GPU. A run on any 32-lane GPU is welcome. No game files.

AI-assisted (Claude Code): I reviewed and ran the change and the tests.

@dcastell1 dcastell1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardware run (RTX 5090, 621.24, Windows 11, programs rebuilt from this tree, LEONIDA_W64_EMULATE=1): 159/167 passed, 8 skipped, 0 failed, and the new case is exact:

PASS  cs_w32_saveexec_ext   4096 2560 6656 5642 4608 542 4106 2560

Those are the eight header-derived words, so s_and_saveexec_b32, s_or_saveexec_b32, s_andn2_saveexec_b32 and s_andn2_wrexec_b32 are checked against hardware in all the shapes that matter here (constant masks, an EXEC that is already partial, and the 32-bit-in-wave64 half rule). 8 skips are the M1/M2/M3 shaders the D3D12 tests run.

@Rainmaker33

Copy link
Copy Markdown

Tested 6244f79 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 main 89b047c. VS 2022, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8; harness programs from a CMake build of that main.

  • scripts/run_gpu_tests.py: 128/167 pass, 39 skipped (wave64), no failures. main gives 127/166. cs_w32_saveexec_ext: 4096 2560 6656 5642 4608 542 4106 2560.
  • tests/semantic/test_saveexec_ext_fixture.py: OK.

@Yourrespawn

Copy link
Copy Markdown
Contributor

Tested 6244f798 on NVIDIA GeForce RTX 4080 (Ada, subgroup 32..32), driver 617.14, Vulkan API 1.4.351, Windows 11 Pro 10.0.26200: pass.

  • run_gpu_tests.py: cs_w32_saveexec_ext PASS natively — 4096 2560 6656 5642 4608 542 4106 2560 — so all the s_*_saveexec_b32 kinds and s_andn1_wrexec_b32 now have a real-GPU check, not just the CPU fixture; suite 128/167 passed, 39 skipped (native wave64 and the b64 kinds skip on this 32-lane GPU, expected)
  • tests/semantic/test_saveexec_ext_fixture.py via unittest discover -s tests/semantic: 3/3 OK
  • Note for other testers: that fixture test imports support, so run it through unittest discover -s tests/semantic (or from inside tests/semantic); invoking it as python -m unittest tests.semantic.test_saveexec_ext_fixture from the repo root fails on the import and looks like a test failure

AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine.

@Pierre-Kookis

Copy link
Copy Markdown
Contributor

AMD data point; the runs so far are NVIDIA. Pass.

Setup: Windows 11. AMD Radeon Ryzen 7 7800X3D iGPU (RDNA2, gfx1036), driver 32.0.21043.5001, subgroup 32..64. RTX 4070 Ti SUPER, driver 32.0.16.1088. Test programs from main 89b047c, llvm-mc 23.1.6.

  • At 9f00e657, run_gpu_tests.py --filter cs_w32_saveexec_ext on AMD: PASS, 4096 2560 6656 5642 4608 542 4106 2560.
  • At 6244f798, the whole suite:
    • cs_w32_saveexec_ext passes with the same 8 words on AMD, NV and NV LEONIDA_W64_EMULATE=1.
    • AMD 153/167 passed (14 skipped), NV 128/167 (39 skipped), NV emulated 159/167 (8 skipped), 0 FAIL.
    • tests/semantic/test_saveexec_ext_fixture.py: 3 passed.

(AI-assisted run; counts only, no game files.)

@Bladureau

Copy link
Copy Markdown

Tested 9f00e657 (on main 003e7812) on Intel UHD Graphics (Raptor Lake, "Intel(R) RaptorLake-S Mobile Graphics Controller", subgroup 8..32), driver 101.7092, Vulkan 1.4.323, Windows 11 Pro (build 26300): pass.

First Intel result for this fixture. The Intel Windows driver has had EXEC-mask bugs before (#820), so a saveexec/wrexec test on a 32-wide Intel GPU seemed worth running. The test runs here; it isn't skipped as narrow. The neighbouring cs_w32_permute and cs_exec64 also pass on this device.

Runtime built from 003e7812 (scripts\build_runtime.ps1, MSVC 19.52), passed with --build; the PR changes no C++. llvm-mc 23.1.6 (AMDGPU), SPIRV-Tools v2026.4. Driver selected with VK_LOADER_DRIVERS_SELECT=igvk*.

run_gpu_tests.py --filter cs_w32_saveexec_ext Result
Normal 1 translated, 1 passes spirv-val; PASS 4096 2560 6656 5642 4608 542 4106 2560
LEONIDA_W64_EMULATE=1 PASS, same words

CPU at this head: test_saveexec_ext_fixture.py 3 OK, tests/semantic/regen_fixtures.py --check OK, tests/test_run_gpu_tests.py 30 OK, tests/test_shader_checks.py 59 OK, compileall OK.

The previous head 6244f798 (on 89b047cd, with a runtime built from that commit) gave the same words in both modes before the rebase.

AI-assisted (Claude Code ran the commands; I reviewed the results).

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. cs_w32_saveexec_ext passes on both the RTX 4080 SUPER and the Intel UHD 770.

@evilclanker9000

Copy link
Copy Markdown
Contributor

Tested 9f00e65 on AMD Radeon(TM) Graphics (Ryzen 9 9950X3D iGPU, RDNA2, subgroup 32..64), driver 26.10.1, and NVIDIA GeForce RTX 5080 (subgroup 32..32), driver 616.92, Windows 11 (26200): pass.

Detached worktree at the PR head (base 003e781), runtime built from it (Ninja, RelWithDebInfo, -j 4).

  • python -I scripts/run_gpu_tests.py --build <build> --work <dir> with LEONIDA_VK_DEVICE=radeon and =5080, one device at a time:
    • Radeon: 162/171 passed, 9 skipped, 0 failed. cs_w32_saveexec_ext PASS, 4096 2560 6656 5642 4608 542 4106 2560 (wave32 on a 32..64 subgroup device).
    • RTX 5080: 131/171 passed, 40 skipped (wave64 tests), 0 failed. cs_w32_saveexec_ext PASS, the same eight words.
  • The eight words match the table in the description and the NVIDIA RTX 3090 words posted above.
  • python -I -m unittest discover -s tests/semantic -p test_saveexec_ext_fixture.py: 3 tests OK.
  • python tests/semantic/regen_fixtures.py --check: clean. python -I tests/test_shader_checks.py: 59 tests OK.

No red-on-main: the PR adds a test only and changes no translator code. Not run here: the full semantic suite, and the negative control.

AI-assisted.

@Spaghetih

Copy link
Copy Markdown
Contributor

Tested 9f00e657 on NVIDIA GeForce RTX 4070 Ti, driver 621.24, Windows 11, MSVC (VS 2022), Vulkan SDK 1.4.363, llvm-mc 21.1.8 in WSL: pass.

No regression against main on the same machine (ctest 97/98 with the same d3d12_draw failure; GPU suite 127/166 passed, 39 skipped, 0 failed).

AI-assisted (Claude Code).

…xed#1657

s_xor/andn1/orn1/orn2/nand/nor/xnor_saveexec_b32 and s_andn1_wrexec_b32
were merged with CPU checks only. cs_w32_saveexec_ext.asm runs each with
EXEC = lanes 0..23 and S0 = lanes 10..29 (from compares) and stores
(s_bcnt1 << 8) | s_ff1 of the new EXEC, a whole-wave word. It is a wave32
lane-mask dump (WAVE32_LANE_DUMPS), skipped below 32 lanes.

tests/semantic/test_saveexec_ext_fixture.py runs the fixture on the CPU
against tools/cf_ref.py's _SAVEEXEC and checks both runners expect the
same words.
python -I on the file failed with ModuleNotFoundError: support, as the folder
was not on sys.path (@Yourrespawn noted it on this PR, @justr4mzi on ItsNotRexed#4323).
It is now inserted, as test_cs_shared_memory_limit does.
@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 09b14d4a8aeae60881db8375d12ca8452498d8ce on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

Native wave32 on Linux RTX 5090 (driver 595.99.02) passes cs_w32_saveexec_ext at 09b14d4a8aeae60881db8375d12ca8452498d8ce. With wave64 emulation disabled, the fixture passed SPIR-V validation and returned all eight expected words: 4096 2560 6656 5642 4608 542 4106 2560.

For a negative control, I changed only the fixture’s first s_xor_saveexec_b32 to s_and_saveexec_b32 in a scratch copy. It still validated, and the GPU run failed on exactly word 0. XOR returned 0x1000 (16 lanes, first lane 0); AND returned 0x0e0a (14 lanes, first lane 10), as expected for the intersection of lanes 0–23 and 10–29. The other seven words stayed identical.

AI-assisted verification.

@TreXito

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 09b14d4a (the rebased head) on NVIDIA GeForce RTX 3060 Ti (subgroup 32..32), driver 580.173.02, Linux (kernel 6.18), Python 3.14: pass.

  • scripts/run_gpu_tests.py: 165/211 passed, 46 skipped, 0 failed. cs_w32_saveexec_ext prints 4096 2560 6656 5642 4608 542 4106 2560 and passes.
  • ctest: 47/47 passed.
  • pytest tests/semantic/test_saveexec_ext_fixture.py: 3 passed, 10 subtests passed.

No game files. AI-assisted (Claude Code).

@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 09b14d4 (merge base aa2988c) on NVIDIA GeForce RTX 5080, Linux 580.65.06: pass

Tested the PR head merged with current main 03b09a08 (clean merge, not pushed). Runtime harnesses built from main 03b09a08 (no PR in this list changes C++/CMake), llvm-mc 21, Python 3.13, Vulkan SDK 1.4.363, Linux native.

Check main 03b09a08 this PR
run_gpu_tests.py native 164/210 passed, 46 skipped 165/211 passed, 46 skipped
run_gpu_tests.py with LEONIDA_W64_EMULATE=1 195/210 passed, 15 skipped 196/211 passed, 15 skipped
failed (native / emulated) 0 / 0 0 / 0
tests/semantic/regen_fixtures.py --check ok ok
pytest tests/semantic/test_saveexec_ext_fixture.py + tests/test_shader_checks.py 156 passed (3 shared files) 159 passed, 296 subtests passed in 3.75s

Line-by-line against my main run (results that differ from main):

  • native:
    • cs_w32_saveexec_ext main: - pr: PASS 4096 2560 6656 5642 4608 542 4106 2560
  • emulated:
    • cs_w32_saveexec_ext main: - pr: PASS 4096 2560 6656 5642 4608 542 4106 2560

Not run: the full unittest discover -s tests/semantic (7456 tests, about 6 minutes; on main alone it shows 7 failures and 2 errors in test_cmp_class_f64, test_loop_ballot_barrier and test_mutations, so I did not repeat it per PR); only the test files this PR touches plus the shared checker tests ran. No other GPU vendor, no Windows. No game files.

AI-assisted (Claude Code).

@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 09b14d4a (merge base aa2988cc) on an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56, Windows 11 10.0.26300. Translator and fixtures from this head; runtime test programs built from main aa2988cc (MSVC 19.44, Vulkan-Headers fetched by CMake, loader from the NVIDIA driver); spirv-as/spirv-val and llvm-mc 21 from WSL Ubuntu: pass.

  • scripts/run_gpu_tests.py: 165/211 passed, 46 skipped (wave64 programs on a 32-wide GPU), 0 failed.
  • Diffed test by test against main aa2988cc (164/210, 46 skipped): every main result is the same here.
  • New: cs_w32_saveexec_ext PASS (4096 2560 6656 5642 4608 542 4106 2560).

Not run: LEONIDA_W64_EMULATE=1, other vendors, Linux. No game files.

AI-assisted (Claude Code).

@bunbeans2-arch

Copy link
Copy Markdown

Tested the current head 09b14d4 on an AMD Radeon RX 9070 XT (RDNA4, subgroup 32..64) with AMD's Windows driver, Windows
11 23H2. scripts/run_gpu_tests.py --require-pass gives 197/211 passed, 14 skipped. cs_w32_saveexec_ext passes.
AI-assisted (Claude Code). No game files.

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
@tylerstraub

Copy link
Copy Markdown
Contributor

Tested fcb9f9886dc30925da9d8217ffb637b5e87901b6 on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

Checked cs_w32_saveexec_ext on head fcb9f9886dc30925da9d8217ffb637b5e87901b6 with a freshly built Vulkan harness on Linux, GeForce RTX 5090, NVIDIA 595.99.02. The shader passed SPIR-V validation. Native wave32 readback matched all eight expected words in fixture order: 1000 0a00 1a00 160a 1200 021e 100a 0a00 (hex). The three CPU tests in test_saveexec_ext_fixture.py also passed.

AI-assisted verification.

AI-assisted verification.

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
@jordi-vancuijlenborg-vinci

Copy link
Copy Markdown

Tested 7984119c on Windows 11 build 26200 with an NVIDIA GeForce RTX 3080 (driver 621.01, Vulkan 1.4.357, subgroup size 32). Built the Vulkan test tools from the same revision with LLVM-MinGW 23.1.6.

python -I scripts/run_gpu_tests.py --filter cs_w32_saveexec_ext.asm --require-pass passed with 8/8 exact output words. The shader passed spirv-val, and all three focused semantic tests passed. Synthetic fixture only. AI-assisted.

@Mortify7612

Copy link
Copy Markdown

Tested 7984119c merged onto main 1cc6e3c1 (clean) on AMD Radeon RX 9060 XT (RDNA4, GFX1200, subgroup 32..64), RADV Mesa 25.0.7, Debian 12 Linux, llvm-mc 23.1.6: pass. I ran run_gpu_tests.py --filter <fixture> for the fixture(s) this PR adds or changes, not the full suite:

PASS cs_w32_saveexec_ext 4096 2560 6656 5642 4608 542 4106 2560

AI-assisted (Claude Code).

@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 7984119c5ea9d3db4a08927c5c21879bab2807a2 on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

The stock wave32 fixture matched all eight expected words. I also checked which individual lanes ran after each operation, since a count and first-set-bit index alone can match different masks. In a temporary variant, each active lane wrote a marker at its own index before EXEC was restored. Reconstructing the masks from those markers gave, in fixture order:

3f0003ff 000003ff c0ffffff fffffc00 ff0003ff c0000000 c0fffc00 000003ff

All eight matched the Boolean operations on the fixture’s source mask (lanes 10–29) and incoming EXEC (lanes 0–23), including lanes that became active again.

A separate attempt to copy EXEC into an SGPR and export the word through lane 0 returned all ones or zero according to lane 0’s activity. That agrees with the mask-as-data limitation described in #293. The per-lane marker check avoids that path.

AI-assisted verification.

@moffington

Copy link
Copy Markdown

Tested PR #1771 (7984119) on Omarchy Linux, NVIDIA GeForce RTX 3060 (driver 615.78.08).

  • cs_w32_saveexec_ext: PASS (1/1), all eight expected output words matched.
  • Shader translation and spirv-val: PASS.
  • Independent CPU-side review: all eight expected mask summaries verified; 3 new semantic tests and 9 existing saveexec-variant tests passed.

Nonblocking coverage observation: the new GPU fixture checks the EXEC population count and first active lane rather than the full EXEC mask. A deliberately incorrect mask can preserve those summaries, although the existing CPU lane-level tests catch that case. Checking full masks or per-lane writes on the GPU would strengthen future coverage.

AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.