Tests: GPU coverage for v_swaprel_b32 and s_movrels_b32/b64 #364

Closed
KoLolX3 wants to merge 1 commit from upstream-pr/364 into main
KoLolX3 commented 2026-11-24 03:56:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KoLolX3 on 2026-11-24T03:56:32Z.


Takes over draft #85 (carried over from the original repo by its author, KoLolX3). Adds a synthetic GPU fixture for relative VGPR swaps and SGPR reads.

Rebased on main 3f81d46a. Resolved the runner registration conflict while retaining the current cs_w64x_cmp_sdst entry, and removed stale “Not GPU-verified” text from the two updated contract rows.

Tested on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, Linux): the fixture translated and passed spirv-val, and the eight expected output words matched with subgroup size 32 in both native and LEONIDA_W64_EMULATE=1 builds. python -I tests/test_run_gpu_tests.py passed 68 tests; the full semantic suite passed 6,279 tests in 487 files. Compileall, make_game.py --help, check_no_game_data.py on changed files, and git diff --check passed. Synthetic fixtures only, no game files.

AI-assisted: yes (Claude Code and OpenAI Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465786792 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/364). Originally posted by [KoLolX3](https://github.com/KoLolX3) on 2026-11-24T03:56:32Z. --- Takes over draft #85 (carried over from the original repo by its author, KoLolX3). Adds a synthetic GPU fixture for relative VGPR swaps and SGPR reads. Rebased on `main` `3f81d46a`. Resolved the runner registration conflict while retaining the current `cs_w64x_cmp_sdst` entry, and removed stale “Not GPU-verified” text from the two updated contract rows. Tested on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, Linux): the fixture translated and passed `spirv-val`, and the eight expected output words matched with subgroup size 32 in both native and `LEONIDA_W64_EMULATE=1` builds. `python -I tests/test_run_gpu_tests.py` passed 68 tests; the full semantic suite passed 6,279 tests in 487 files. Compileall, `make_game.py --help`, `check_no_game_data.py` on changed files, and `git diff --check` passed. Synthetic fixtures only, no game files. AI-assisted: yes (Claude Code and OpenAI Codex).
Sangonapou commented 2026-11-24 05:05:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Sangonapou on 2026-11-24T05:05:55Z.


Tested 9c575419 on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass

Runtime built at this head with scripts\build_runtime.ps1 (MSVC 19.51, VS Build Tools 2026); llvm-mc 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files.

  • run_gpu_tests.py --filter cs_relidx_ext --require-pass: PASS native and with LEONIDA_W64_EMULATE=1 (0x1414 0x1212 0xabcd 0x67 0x66 0x67 0x65 0x7).
  • Full suite: 258 shaders, 258 translated, 258 pass spirv-val; native 198/249 passed, 49 skipped; emulated 230/249 passed, 17 skipped, i.e. main plus this fixture. The only failures, cs_imgload_tfe and cs_imgload_d16_tfe, fail identically on main ece4ba5b on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7122621197 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/364#issuecomment-7122621197). Originally posted by [Sangonapou](https://github.com/Sangonapou) on 2026-11-24T05:05:55Z. --- Tested 9c575419 on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass Runtime built at this head with `scripts\build_runtime.ps1` (MSVC 19.51, VS Build Tools 2026); `llvm-mc` 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files. - `run_gpu_tests.py --filter cs_relidx_ext --require-pass`: PASS native and with `LEONIDA_W64_EMULATE=1` (`0x1414 0x1212 0xabcd 0x67 0x66 0x67 0x65 0x7`). - Full suite: 258 shaders, 258 translated, 258 pass spirv-val; native 198/249 passed, 49 skipped; emulated 230/249 passed, 17 skipped, i.e. `main` plus this fixture. The only failures, `cs_imgload_tfe` and `cs_imgload_d16_tfe`, fail identically on `main` `ece4ba5b` on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336.
ohshitwaddup commented 2026-11-24 18:13:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ohshitwaddup on 2026-11-24T18:13:49Z.


Independent hardware verification of cs_relidx_ext, plus two documentation defects. The fixture is correct — all eight words reproduce exactly. The defects are in the docs/design.md row text.

Verified on a second card

RX 6900 XT (RDNA2 / GFX1030, Navi 21, PCI 1002:73bf), RADV NAVI21, Mesa 26.2.4, Vulkan 1.4.354, Nobara Linux 44, kernel 7.2.10, subgroup 32..64, run at VKC_SUBGROUP_SIZE=32:

device: AMD Radeon RX 6900 XT (RADV NAVI21) (subgroup 32..64)
compute subgroup size: 32
1 groups x 64: 0 mismatches
out[0..7] = 5140 4626 43981 103 102 103 101 7

= 0x00001414 0x00001212 0x0000ABCD 0x00000067 0x00000066 0x00000067 0x00000065 0x00000007 — 8/8 exact against check.py and the header. Your record is an RX 7900 XT (RADV NAVI31, Mesa 26.3.1); mine is RDNA2 on another driver, so v_swaprel_b32 and s_movrels_b32/b64 now agree across two AMD generations.

Two defects in the row edits

Both edited rows read:

**Not GPU-verified.** GPU-checked by `runtime/test/shaders/cs_relidx_ext.asm` (…
one lane, on an RX 7900 XT, RADV NAVI31, Mesa 26.3.1, Linux, native wave64 and `LEONIDA_W64_EMULATE=1`)

1. "native wave64" is not what ran. The fixture declares ; mattr: +wavefrontsize32,-wavefrontsize64 with ; group: 32,1,1, and cs_relidx_ext is in WAVE32_LANE_DUMPS, so both runners pin VKC_SUBGROUP_SIZE=32; my run confirms compute subgroup size: 32. If you meant "on a native-wave64 device", the wording needs to say so — please use native (wave32) and LEONIDA_W64_EMULATE=1.

2. The stale "Not GPU-verified" survives directly before the new clause, in both rows, so each one contradicts itself and the PR does not yet flip them:

  • v_swaprel_b32
  • Relative SGPR reads (s_movrels_b32, s_movrels_b64)

Nothing else looks wrong: the coverage claims (both M0 fields with the ignored M0 bits set, a self-swap, s_movrels_b32/_b64 with M0 from a literal, a destination overlapping the source, SCC left unwritten) match what the fixture exercises and what the words show.

Summary

Eight words correct, reproduced on RDNA2. Fix the two items and both rows are honest. Happy to see this merged.

AI-assisted: yes (Hermes Agent) — built the PR head, ran the fixture on an RX 6900 XT, and verified each defect above.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7140345426 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/364#issuecomment-7140345426). Originally posted by [ohshitwaddup](https://github.com/ohshitwaddup) on 2026-11-24T18:13:49Z. --- Independent hardware verification of `cs_relidx_ext`, plus two documentation defects. **The fixture is correct — all eight words reproduce exactly.** The defects are in the `docs/design.md` row text. ## Verified on a second card RX 6900 XT (RDNA2 / GFX1030, Navi 21, PCI 1002:73bf), RADV NAVI21, Mesa 26.2.4, Vulkan 1.4.354, Nobara Linux 44, kernel 7.2.10, subgroup 32..64, run at `VKC_SUBGROUP_SIZE=32`: ``` device: AMD Radeon RX 6900 XT (RADV NAVI21) (subgroup 32..64) compute subgroup size: 32 1 groups x 64: 0 mismatches out[0..7] = 5140 4626 43981 103 102 103 101 7 ``` = `0x00001414 0x00001212 0x0000ABCD 0x00000067 0x00000066 0x00000067 0x00000065 0x00000007` — **8/8 exact** against `check.py` and the header. Your record is an RX 7900 XT (RADV NAVI31, Mesa 26.3.1); mine is RDNA2 on another driver, so `v_swaprel_b32` and `s_movrels_b32/b64` now agree across two AMD generations. ## Two defects in the row edits Both edited rows read: ``` **Not GPU-verified.** GPU-checked by `runtime/test/shaders/cs_relidx_ext.asm` (… one lane, on an RX 7900 XT, RADV NAVI31, Mesa 26.3.1, Linux, native wave64 and `LEONIDA_W64_EMULATE=1`) ``` **1. "native wave64" is not what ran.** The fixture declares `; mattr: +wavefrontsize32,-wavefrontsize64` with `; group: 32,1,1`, and `cs_relidx_ext` is in `WAVE32_LANE_DUMPS`, so both runners pin `VKC_SUBGROUP_SIZE=32`; my run confirms `compute subgroup size: 32`. If you meant "on a native-wave64 device", the wording needs to say so — please use `native (wave32) and LEONIDA_W64_EMULATE=1`. **2. The stale "Not GPU-verified" survives** directly before the new clause, in both rows, so each one contradicts itself and the PR does not yet flip them: - `v_swaprel_b32` - Relative SGPR reads (`s_movrels_b32`, `s_movrels_b64`) Nothing else looks wrong: the coverage claims (both M0 fields with the ignored M0 bits set, a self-swap, `s_movrels_b32`/`_b64` with M0 from a literal, a destination overlapping the source, SCC left unwritten) match what the fixture exercises and what the words show. ## Summary Eight words correct, reproduced on RDNA2. Fix the two items and both rows are honest. Happy to see this merged. AI-assisted: yes (Hermes Agent) — built the PR head, ran the fixture on an RX 6900 XT, and verified each defect above.
MoonEyes commented 2026-11-28 18:00:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:00:05Z.


Hi @KoLolX3, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/test/shaders/check.py, scripts/run_gpu_tests.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243450902 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/364#issuecomment-7243450902). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:00:05Z. --- Hi @KoLolX3, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:43:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:43:00Z.

Review: CHANGES_REQUESTED


Conflicts with main (in docs/design.md, runtime/test/shaders/check.py, and scripts/run_gpu_tests.py) with failing stale CI. Please rebase onto current main, address the two docs/design.md row defects flagged during independent verification above, and trigger a fresh green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130538760 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/364#pullrequestreview-6130538760). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:43:00Z. **Review:** CHANGES_REQUESTED --- Conflicts with `main` (in `docs/design.md`, `runtime/test/shaders/check.py`, and `scripts/run_gpu_tests.py`) with failing stale CI. Please rebase onto current `main`, address the two `docs/design.md` row defects flagged during independent verification above, and trigger a fresh green CI pass. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:29:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:29:36Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317697474 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/364#issuecomment-7317697474). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:29:36Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!364
No description provided.