Skip to content

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

Open
KoLolX3 wants to merge 1 commit into
ProjectLeonida:mainfrom
KoLolX3:test/relidx-gpu
Open

KoLolX3 wants to merge 1 commit into
ProjectLeonida:mainfrom
KoLolX3:test/relidx-gpu

Conversation

@KoLolX3

@KoLolX3 KoLolX3 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

Tested 9c57541 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.

@ohshitwaddup

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
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-actions github-actions Bot added needs rebase Conflicts with the base branch: rebase it on main and removed needs rebase Conflicts with the base branch: rebase it on main labels Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants