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

Open
github-bot wants to merge 1 commit from github-bot/gh-364 into main AGit
Owner

@⁠KoLolX3 on GitHub · 2026-11-24 03:56 UTC · original
KoLolX3:test/relidx-gpu → main · +89 −7 · 4 files · 1 commits · open

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).

**@⁠KoLolX3** on GitHub · 2026-11-24 03:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/364) `KoLolX3:test/relidx-gpu` → `main` · +89 −7 · 4 files · 1 commits · open 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).
docs/design.md marks v_swaprel_b32 and the relative SGPR reads not
GPU-verified: CPU-checked (and v_swaprel_b32 measured on hardware), but
the translated SPIR-V never ran on a GPU; s_movrels only appears in a
comment of cs_movrelsd_2.asm. cs_relidx_ext.asm runs one lane through
v_swaprel_b32 with both M0 fields and the ignored M0 bits set, a
self-swap, s_movrels_b32 and s_movrels_b64 with M0 from a literal, a
destination overlapping the source, and SCC left unwritten. The eight
expected words are derived in its header from the rows. Registered in
check.py and run_gpu_tests.py next to cs_lds_xchg64_ext; both rows note
the GPU check.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:55:52 +00:00
Author
Owner

@⁠Sangonapou on GitHub · 2026-11-24 05:05 UTC · original

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.
**@⁠Sangonapou** on GitHub · 2026-11-24 05:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/364#issuecomment-7122621197) 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.
Author
Owner

@⁠ohshitwaddup on GitHub · 2026-11-24 18:13 UTC · original

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.

**@⁠ohshitwaddup** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/364#issuecomment-7140345426) 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.
This pull request has changes conflicting with the target branch.
  • runtime/test/shaders/check.py
  • scripts/run_gpu_tests.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/364/head:github-bot/gh-364'
git switch 'github-bot/gh-364'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-364'
git switch 'github-bot/gh-364'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-364'
git switch 'github-bot/gh-364'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-364'
git switch 'main'
git merge --squash 'github-bot/gh-364'
git switch 'main'
git merge --ff-only 'github-bot/gh-364'
git switch 'main'
git merge 'github-bot/gh-364'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.