[PR #1090] [MERGED] tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU) #1126

Closed
opened 2026-11-26 20:20:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1090
Author: @milk4sale
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @ubiquitarianism

Base: main ← Head: test-w64-sdst-pair-gpu


📝 Commits (3)

  • 9f1a072 tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU)
  • 89f6c26 Merge main into test-w64-sdst-pair-gpu
  • b57a5b8 Merge main into test-w64-sdst-pair-gpu

📊 Changes

6 files changed (+381 additions, -2 deletions)

View changed files

📝 docs/design.md (+1 -0)
📝 runtime/test/shaders/check.py (+3 -1)
➕ runtime/test/shaders/cs_w64x_cmp_sdst.asm (+131 -0)
📝 scripts/run_gpu_tests.py (+2 -1)
➕ tests/semantic/fixtures/disasm/cs_w64x_cmp_sdst.s (+89 -0)
➕ tests/semantic/test_wave64_sdst_pair_fixture.py (+155 -0)

📄 Description

Item: TEST-W64-SDST-PAIR-GPU

Depends on: #1021 (its commit is the first one in this branch; only the second is this change)

#1021 makes the SGPR a wave64 VALU instruction names for a lane mask the pair it is on hardware. Its own test compares the two printed forms on the interpreter. This adds a GPU fixture and the counts over the whole corpus.

What is in it

  • runtime/test/shaders/cs_w64x_cmp_sdst.asm: written like the game's listings. It has no mattr line, so llvm-mc prints v_cmp_gt_u32_e64 s4, ... for the pair, as it does for the game; every other wave64 fixture names the pair, which is why none of them saw the stale high register. Six compares and a carry-out, each with lanes on both sides of lane 32, read back by s_and_b64, s_or_b64, s_xor_b64, s_andn2_b64, s_and_saveexec_b64, s_mov_b64 exec, s_bcnt1_i32_b64 / s_ff1_i32_b64 and SCC. The high register holds another mask, 0 or nothing beforehand. The eight expected words are derived from the ISA in the header. Registered in check.py and scripts/run_gpu_tests.py.
  • tests/semantic/test_wave64_sdst_pair_fixture.py: the fixture on a 64-wide subgroup and under --wave64-emulate; the same program with pair destinations translates to the same SPIR-V text; wave32 code through translate() keeps its single register; and what tools/wave64_halves.py makes of the one-register form (the LLVM form of a uniform branch is tier A with equal words from one wave of 64 lanes and two of 32; the mask read as data is still tier C).
  • One row in docs/design.md under #1021's, with the counts below.

Counts (1.0.2.1, all 26,503 listings, llvm-mc backend)

Compares into a one-register SGPR in wave64 shaders 292,733, every one on an even register (wave32: 137,832 of 299,058 odd)
Wave64 shaders that read such a pair back, on main 13,314 (7,120 PS, 4,918 MS, 664 CS, 612 VS)
Full translation with #1021 26,503 translated, 26,503 pass spirv-val; 19,453 modules change, all wave64
SHADER-10 tiers, main -> #1021 A 5,059 -> 5,267, B 101 -> 397, C 8,245 -> 7,741; 504 leave C, none enters

Tested

  • GPU: NVIDIA GeForce RTX 4070 Ti, Linux, driver 620.70.06, subgroup 32 only. LEONIDA_W64_EMULATE=1 scripts/run_gpu_tests.py --filter cs_w64x_cmp_sdst: PASS with #1021 (10240 6144 2053 8224 7714 6184 4144 5); main 1504c1af6 stores 16384 16384, five times 0xffffffff and 1. This confirms the translated SPIR-V against the ISA reference, not native RDNA2 behaviour. This card has no 64-wide subgroup (--require-wave64 skips here).
  • Native 64-lane subgroups, measured by reviewers after this was opened (not by me): sodove on a Ryzen 5 9600X Radeon iGPU (Windows 11, driver 32.0.21045.29003, --require-wave64): 0 of 8 words with the translator before #1021, 8 of 8 with it, on each of three dispatches; thesubtleties on gfx1036 (RADV, Mesa 26.3.1): passes with native 64-wide subgroups and under emulation, and with main's translator fails with the same eight wrong words as above.
  • python -I scripts/run_semantic_tests.py tests/semantic: 472 files, 6,176 tests, 0 files failed.
  • tests/semantic/regen_fixtures.py --check, tests/test_regen_fixtures.py, test_run_gpu_tests.py, test_shader_checks.py, test_design_contract_rows.py, test_docs_design_rows.py: pass.

No game data: counts and opcode names only. AI-assisted (Claude Code).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1090 **Author:** [@milk4sale](https://github.com/milk4sale) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `test-w64-sdst-pair-gpu` --- ### 📝 Commits (3) - [`9f1a072`](https://github.com/ubiquitarianism/leonida/commit/9f1a072f7056b420096125317ceb001142e33f11) tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU) - [`89f6c26`](https://github.com/ubiquitarianism/leonida/commit/89f6c264ed8d12d6195863802926870d5b84feab) Merge main into test-w64-sdst-pair-gpu - [`b57a5b8`](https://github.com/ubiquitarianism/leonida/commit/b57a5b870aa43a1dbd0acba9209b75ee0e632259) Merge main into test-w64-sdst-pair-gpu ### 📊 Changes **6 files changed** (+381 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -0) 📝 `runtime/test/shaders/check.py` (+3 -1) ➕ `runtime/test/shaders/cs_w64x_cmp_sdst.asm` (+131 -0) 📝 `scripts/run_gpu_tests.py` (+2 -1) ➕ `tests/semantic/fixtures/disasm/cs_w64x_cmp_sdst.s` (+89 -0) ➕ `tests/semantic/test_wave64_sdst_pair_fixture.py` (+155 -0) </details> ### 📄 Description Item: [TEST-W64-SDST-PAIR-GPU](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140348620) Depends on: #1021 (its commit is the first one in this branch; only the second is this change) #1021 makes the SGPR a wave64 VALU instruction names for a lane mask the pair it is on hardware. Its own test compares the two printed forms on the interpreter. This adds a GPU fixture and the counts over the whole corpus. ### What is in it - `runtime/test/shaders/cs_w64x_cmp_sdst.asm`: written like the game's listings. It has no `mattr` line, so llvm-mc prints `v_cmp_gt_u32_e64 s4, ...` for the pair, as it does for the game; every other wave64 fixture names the pair, which is why none of them saw the stale high register. Six compares and a carry-out, each with lanes on both sides of lane 32, read back by `s_and_b64`, `s_or_b64`, `s_xor_b64`, `s_andn2_b64`, `s_and_saveexec_b64`, `s_mov_b64 exec`, `s_bcnt1_i32_b64` / `s_ff1_i32_b64` and SCC. The high register holds another mask, 0 or nothing beforehand. The eight expected words are derived from the ISA in the header. Registered in `check.py` and `scripts/run_gpu_tests.py`. - `tests/semantic/test_wave64_sdst_pair_fixture.py`: the fixture on a 64-wide subgroup and under `--wave64-emulate`; the same program with pair destinations translates to the same SPIR-V text; wave32 code through `translate()` keeps its single register; and what `tools/wave64_halves.py` makes of the one-register form (the LLVM form of a uniform branch is tier A with equal words from one wave of 64 lanes and two of 32; the mask read as data is still tier C). - One row in `docs/design.md` under #1021's, with the counts below. ### Counts (1.0.2.1, all 26,503 listings, llvm-mc backend) | | | |---|---| | Compares into a one-register SGPR in wave64 shaders | 292,733, every one on an even register (wave32: 137,832 of 299,058 odd) | | Wave64 shaders that read such a pair back, on `main` | 13,314 (7,120 PS, 4,918 MS, 664 CS, 612 VS) | | Full translation with #1021 | 26,503 translated, 26,503 pass `spirv-val`; 19,453 modules change, all wave64 | | SHADER-10 tiers, `main` -> #1021 | A 5,059 -> 5,267, B 101 -> 397, C 8,245 -> 7,741; 504 leave C, none enters | ### Tested - GPU: NVIDIA GeForce RTX 4070 Ti, Linux, driver 620.70.06, subgroup 32 only. `LEONIDA_W64_EMULATE=1 scripts/run_gpu_tests.py --filter cs_w64x_cmp_sdst`: PASS with #1021 (`10240 6144 2053 8224 7714 6184 4144 5`); `main` `1504c1af6` stores `16384 16384`, five times `0xffffffff` and `1`. This confirms the translated SPIR-V against the ISA reference, not native RDNA2 behaviour. This card has no 64-wide subgroup (`--require-wave64` skips here). - Native 64-lane subgroups, measured by reviewers after this was opened (not by me): [sodove](https://github.com/ubiquitarianism/leonida/pull/1090#issuecomment-7141659814) on a Ryzen 5 9600X Radeon iGPU (Windows 11, driver 32.0.21045.29003, `--require-wave64`): 0 of 8 words with the translator before #1021, 8 of 8 with it, on each of three dispatches; [thesubtleties](https://github.com/ubiquitarianism/leonida/pull/1090#issuecomment-7141977868) on gfx1036 (RADV, Mesa 26.3.1): passes with native 64-wide subgroups and under emulation, and with `main`'s translator fails with the same eight wrong words as above. - `python -I scripts/run_semantic_tests.py tests/semantic`: 472 files, 6,176 tests, 0 files failed. - `tests/semantic/regen_fixtures.py --check`, `tests/test_regen_fixtures.py`, `test_run_gpu_tests.py`, `test_shader_checks.py`, `test_design_contract_rows.py`, `test_docs_design_rows.py`: pass. No game data: counts and opcode names only. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:10 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1126
No description provided.