Skip to content

Tests: GPU and CPU checks for the untested wave64 saveexec/wrexec kinds - #2015

Open
Vonsek wants to merge 5 commits into
ItsNotRexed:mainfrom
Vonsek:test/cov-w64exec
Open

Vonsek wants to merge 5 commits into
ItsNotRexed:mainfrom
Vonsek:test/cov-w64exec

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Lucas · project thread

Claimed in the coordination issue as: EGEN-COV-W64EXEC (#1902 (comment))

What and why

An opcode inventory of tools/rdna2spirv.py against main 6a6704d (rechecked after merging 4eb6155) (every opcode the translator handles, checked against runtime/test/shaders/*.asm, tests/** and the fuzzers' tables) finds eight wave64 EXEC ops that no test runs at all: the translator handles them through Gen.EXEC_LOGIC, but only the and/or/andn2 kinds have tests. This adds a GPU test and the matching tests/semantic checks for

s_xor_saveexec_b64, s_andn1_saveexec_b64, s_orn1_saveexec_b64, s_orn2_saveexec_b64, s_nand_saveexec_b64, s_nor_saveexec_b64, s_xnor_saveexec_b64, s_andn1_wrexec_b64.

It is the wave64 counterpart of #1771, which covers the b32 forms. Both add a line to the registration lists in check.py, run_gpu_tests.py and regen_fixtures.py, so whichever merges second needs a small rebase there.

  • runtime/test/shaders/cs_w64x_saveexec_ext.asm: one 64-lane wave, one case per op. S0 comes from a v_cmp into VCC or an SGPR pair, the old EXEC is set per half. The new EXEC is measured per lane (a VGPR written under it, then read back with all lanes on), D with s_bcnt1/s_ff1, SCC with s_cselect. Each word is code(new EXEC) << 16 | SCC << 15 | code(D) with code = bcnt << 8 | ff1. S0 and EXEC differ between the halves in every case, so a half swap moves the lowest lane; the wrexec case's result is in the high half only, so an SCC taken from the low word would be 0. The derivation from the ISA pseudocode is in the header. Registered in W64X_DUMPS (check.py) and in run_gpu_tests.py.
  • tests/semantic/test_saveexec_ext_b64.py: the same program shape and S0/EXEC table as test_saveexec_b64.py (plus six pairs so every kind has a result in the low half only, the high half only, both and neither), checked lane by lane against the ISA lines as integers, plus the GPU fixture and a check that rebuilds the header's eight words from that model.

No translator change: all eight match the ISA on both GPUs.

Tested

Windows 11, python -I scripts/run_gpu_tests.py --filter cs_w64x_saveexec:

GPU driver mode result
AMD Radeon (RDNA2 iGPU, Ryzen 9 9950X3D) 26.10.1 native wave64 (subgroup 64) PASS, 8/8 words
AMD Radeon (same) 26.10.1 LEONIDA_W64_EMULATE=1 PASS
NVIDIA GeForce RTX 5080 616.92 LEONIDA_W64_EMULATE=1 (subgroup 32) PASS

out[0..7] = 671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576 on all three; the existing cs_w64x_saveexec_b64 still passes.

Negative control: EXEC_LOGIC["andn1"] changed to complement EXEC instead of S0 (one line). cs_w64x_saveexec_ext then fails on both GPUs (out[1] = 134260744, out[7] = 402692096), and test_saveexec_ext_b64.py fails 33 subtests (every andn1 saveexec and wrexec case plus the fixture). Reverted.

python -m unittest discover -s tests/semantic OK, python tests/semantic/regen_fixtures.py --check clean, python -I tests/test_shader_checks.py and python -I tests/test_run_gpu_tests.py OK.

AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule.)

s_xor/andn1/orn1/orn2/nand/nor/xnor_saveexec_b64 and s_andn1_wrexec_b64
were handled through Gen.EXEC_LOGIC but no test ran them. Add the GPU test
cs_w64x_saveexec_ext (one 64-lane wave, words derived from the ISA in its
header) and tests/semantic/test_saveexec_ext_b64.py, which runs every kind
lane by lane against the ISA formulas and runs the GPU fixture.

AI-assisted.

@YaBulochka YaBulochka 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.

Tested 2982efcf from a clean worktree on AMD Radeon RX 7600 (gfx1102, RDNA3), RADV Mesa 27.0.0-devel (git-f7dd61f78f), Vulkan 1.4.363, Linux 7.3.3, built with the documented cmake -S runtime -B runtime/build and llvm-mc 23.1.5.

  • scripts/run_gpu_tests.py: 186 shaders, 186 translated, 186 pass spirv-val; 168/181 passed, 13 skipped, 0 failed. The 13 skips are the 12 fixtures delegated to the d3d12_* harness tests plus ps_w64x_readlane (this device cannot require a 64-wide fragment subgroup; subgroup range 32..64).
  • The new pair passes with exact words:
    PASS  cs_w64x_saveexec_b64  6160 12304 5120 2088 6168 8192 7176 1837171
    PASS  cs_w64x_saveexec_ext  671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576
    
  • tests/semantic/test_saveexec_ext_b64.py -> 5 passed, 152 subtests passed.
  • ctest --test-dir runtime/build -> 36/36.

No blockers from this side.

@Youssefrah16

Copy link
Copy Markdown

Tested 2982efcf on NVIDIA GeForce RTX 4060 Laptop GPU (Ada, 32-wide, driver 616.87, Vulkan 1.4.351) and AMD Radeon 680M (gfx1035, RDNA2, driver 26.5.1, Vulkan 1.4.315), Windows 11 10.0.26300: pass (AI-assisted).

  • scripts/run_gpu_tests.py --filter cs_w64x_saveexec_ext (spirv-val OK):
    • RTX 4060 Laptop (LEONIDA_W64_EMULATE=1): 1/1 PASS (671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576)
    • AMD Radeon 680M (LEONIDA_W64_EMULATE=0, native wave64): 1/1 PASS (identical 8 words)
    • AMD Radeon 680M (LEONIDA_W64_EMULATE=1, emulated): 1/1 PASS (identical 8 words)
  • Small note: running python -I tests/semantic/test_saveexec_ext_b64.py directly hits ModuleNotFoundError: No module named 'support' (adding the test dir to sys.path would match #1854).

@Rainmaker33

Copy link
Copy Markdown

Tested 2982efc 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 4eb6155. VS 2022, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8; harness programs from a CMake build of that main; overlay layers off.

  • scripts/run_gpu_tests.py: 136/181 pass, 45 skipped, no failures. cs_w64x_saveexec_ext skips natively (no 64-wide subgroups).
  • With LEONIDA_W64_EMULATE=1: 168/181 pass, 13 skipped, no failures. cs_w64x_saveexec_ext: 671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576.
  • tests/semantic/test_saveexec_ext_b64.py: OK.

@esteban-dcp

Copy link
Copy Markdown

Tested 2982efcf (the PR head as is, built from its own runtime/), Linux 7.3.5, scripts/run_gpu_tests.py, 0 failures in all three runs:

GPU Driver Result
NVIDIA GeForce RTX 4050 Laptop (Ada, subgroup 32) 620.73.04 136/181 passed, 45 skipped
same GPU, LEONIDA_W64_EMULATE=1 620.73.04 168/181 passed, 13 skipped
AMD Radeon 740M (RDNA3, RADV, subgroup 32..64) Mesa 26.3.1 168/181 passed, 13 skipped

The new cs_w64x_saveexec_ext skips natively on the 32-wide NVIDIA GPU ("no 64-wide compute subgroup"), and passes emulated on the RTX 4050 and natively wave64 on the Radeon 740M, with the same eight words in both (671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576). 186 shaders translate and pass spirv-val; tests/semantic 1676 OK.

No game files.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@crastinator

Copy link
Copy Markdown
Contributor

Tested 2982efc merged into main 4eb6155d (clean merge) on AMD Radeon RX 6700 XT (Navi 22, gfx1031, subgroup 32..64), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5, GCC 16.2.1, llvm-mc 23.1.5: pass.

  • New test passes natively: cs_w64x_saveexec_ext (671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576).
  • Whole run_gpu_tests.py: 168/181 native, 168/181 with LEONIDA_W64_EMULATE=1. The skips are the D3D12-only fixtures and ps_w64x_readlane (RADV can't require a 64-wide fragment subgroup), the same as on main.
  • ctest: 36/36.
  • tests/semantic/test_saveexec_ext_b64.py: 5 passed, 152 subtests passed.

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

@zneel

zneel commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 2982efcf on AMD Radeon RX 9070 XT (RDNA4, subgroup 32..64), AMD 26.11.2, Windows 11 Pro 10.0.26300, AMD Ryzen 7 9800X3D CPU (64 GB RAM), Python 3.12.10: pass. This is the first discrete RDNA run here; the earlier AMD results are RDNA2 iGPUs.

Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows llvm-mc 21.1.8, Vulkan SDK 1.4.363.0. No game files.

run result
run_gpu_tests.py (whole suite, native wave64) 168/181, 0 failed (main 4eb6155d: 167/180)
same with LEONIDA_W64_EMULATE=1 168/181, 0 failed
unittest discover -s tests/semantic -p test_saveexec_ext_b64.py 5 OK
tests/semantic/regen_fixtures.py --check clean
tests/test_shader_checks.py 60 OK

cs_w64x_saveexec_ext printed 671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576 both native and emulated, the same eight words as in the description. cs_w64x_saveexec_b64 still passes.

AI-assisted (Claude Code); I checked the results.

Conflicts:
	tests/semantic/regen_fixtures.py

AI-assisted.
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (19e4057) again; CPU checks and the PR's GPU tests pass on Radeon RDNA2 iGPU. AI-assisted.

scripts/run_gpu_tests.py

AI-assisted.
@Jadiac5

Jadiac5 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 73c72b99 on AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010, Windows 11: pass.
This GPU is RDNA4, not the console's RDNA2.

llvm-mc LLVM 21.0.0git (from AMD ROCm 7.1), Vulkan SDK 1.4.363.1, runtime and test programs built from this
head with scripts/build_runtime.ps1. No game files.

Run main ec8ec4c9 this head
ctest 129/129 passed 129/129 passed
runtime/test/shaders/build.py 214/214 valid 215/215 valid
runtime/test/shaders/check.py 164 of 167, 3 skipped 165 of 168, 3 skipped
scripts/run_gpu_tests.py 175/189, 14 skipped, 0 failed 176/190, 14 skipped, 0 failed

cs_w64x_saveexec_ext passes in both runners with the eight words from the description.

Not done: no LEONIDA_W64_EMULATE=1 run, no validation layers, no semantic suite on this head.

AI-assisted (Claude Code).

scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py

AI-assisted.
@Etr0p

Etr0p commented Nov 23, 2026

Copy link
Copy Markdown

Tested efef60b on NVIDIA GeForce RTX 5070 Ti Laptop GPU (Blackwell, 621.24, subgroup 32..32) and AMD Radeon 610M (RDNA2 iGPU, AMD 26.11.2 / 32.0.21045.29003, subgroup 32..64), Windows 11 Home 26200: pass.

Same laptop, one GPU at a time through LEONIDA_VK_DEVICE. Test programs rebuilt from this head with llvm-mingw 23.1.6; llvm-mc 23.1.6 (conda-forge), SPIRV-Tools v2026.4 (Vulkan SDK 1.4.363.0), Python 3.13.14.

scripts/run_gpu_tests.py Result cs_w64x_saveexec_ext
RTX 5070 Ti Laptop, native 164/211 passed, 47 skipped, 0 failed SKIP (no 64-wide compute subgroup on this device)
RTX 5070 Ti Laptop, LEONIDA_W64_EMULATE=1 196/211 passed, 15 skipped, 0 failed PASS 671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576
Radeon 610M, native wave64 190/211 passed, 21 skipped, 0 failed PASS, the same eight words
  • 215 shaders translated, 215 pass spirv-val in each run.
  • CPU: python -m unittest discover -s tests/semantic -p test_saveexec_ext_b64.py: 5 tests OK.

Native wave64 on RDNA2 and wave64 emulation on a 32-wide device give the same words. One run of each. No game files. AI-assisted (Claude Code).

@lunarminus

Copy link
Copy Markdown

Tested efef60bb merged onto main d0835dd9 on an AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: pass

  • The merge was clean. The PR changes no C++ or CMake, so the test programs come from a build of d0835dd9. The .asm fixtures are assembled from the merged tree.
  • scripts/run_gpu_tests.py, native: 197/211 passed, 14 skipped, 0 failed. 215 shaders translated and 215 pass spirv-val.
  • Same with LEONIDA_W64_EMULATE=1: 197/211 passed, 14 skipped, 0 failed. 215/215 translated and spirv-val-valid.
  • I compared each test's PASS/FAIL/SKIP with a run of d0835dd9 without the PR (196/210 passed, 14 skipped in both modes). In both modes the only difference is the new cs_w64x_saveexec_ext. It passes in both modes with the eight words from the description: 671133712 604809224 536905768 537964544 536914948 605325368 537960448 405313576. cs_w64x_saveexec_b64 still passes.
  • python -m unittest discover -s tests/semantic -p 'test_saveexec*': 13 tests OK, including the 5 in test_saveexec_ext_b64.
  • tests/semantic/regen_fixtures.py --check: clean. tests/test_shader_checks.py: 75 OK. tests/test_run_gpu_tests.py: 40 OK.
  • The full tests/semantic run has 7 failures and 2 errors out of 7461. All of them are in test_loop_ballot_barrier, test_cmp_class_f64 and test_mutations, which this PR doesn't touch, and those three modules fail the same way on d0835dd9 without the PR.

One run of each. No game files.

AI-assisted (Claude Code).

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.

10 participants