Skip to content

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

Closed
Andretuta wants to merge 1 commit into
mainfrom
old-pr/9813
Closed

Andretuta wants to merge 1 commit into
mainfrom
old-pr/9813

Conversation

@Andretuta

Copy link
Copy Markdown
Collaborator

Carried over from old PR 9813 by KoLolX3 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9813, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
KoLolX3: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

docs/design.md marks v_swaprel_b32 and the relative SGPR reads (s_movrels_b32, s_movrels_b64) Not GPU-verified: both translations are CPU-checked (and v_swaprel_b32 was measured on hardware), but the SPIR-V the translator emits had never run on a GPU. s_movrels only appears in a comment of cs_movrelsd_2.asm.

runtime/test/shaders/cs_relidx_ext.asm (one lane, laid out like cs_lds_b64_cmpst.asm):

word op case expected
0, 1 v_swaprel_b32 v10, v11, M0 0xFC02FC03 M0[25:16] = 2, M0[9:0] = 3, other bits ignored: v12 and v14 swap 0x1414, 0x1212
2 v_swaprel_b32 v11, v12, M0 0x10000 both name v12, which keeps its value 0xABCD
3 s_movrels_b32 s30, s20, M0 3 s[20+3] 0x67
4, 5 s_movrels_b64 s[30:31], s[20:21], M0 2 the pair s22, s23 0x66, 0x67
6 s_movrels_b32 s20, s20, M0 1 destination overlapping the source 0x65
7 s_movrels_b32 between s_cmp_eq_u32 0, 0 and s_cselect_b32 7, 9 SCC is not written 0x7

The words are derived in the .asm header from the rows. Registered in check.py and scripts/run_gpu_tests.py next to cs_lds_xchg64_ext (#9761). Both rows keep their marker and add a "GPU-checked by" note; the s_movrels note says the lane-mask case (SHADER-284) is not covered.

Tested on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 26.3.1, subgroup 32..64), Artix Linux, llvm-mc 23.1.5, test programs rebuilt from this branch's base 2d53a8055:

  • cs_relidx_ext passes with all eight words exact, native and with LEONIDA_W64_EMULATE=1.
  • Negative control: expecting no swap (words 0/1 exchanged) makes it FAIL.
  • Full scripts/run_gpu_tests.py suite: the only failures are cs_imgload_tfe, cs_imgload_d16_tfe, cs_w32_exec_computed, cs_w64_exec_computed and the known ms_wave_info_s3 flake (#6172), and the four fail the same way on a clean worktree of main on this card.
  • The test files that read check.py, run_gpu_tests.py, design.md or the shader fixtures: the same failure set as a clean worktree of the merge base (28, environment-only on this machine). The branch adds 2 passing tests and 12 subtests.

Synthetic fixture only, no game files. AI-assisted (Claude Code).

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

KoLolX3 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Author here: taken over in #364, rebased on main ece4ba5b3 and re-tested (RX 7900 XT, RADV). This draft can be closed in its favour.

@ImLele69

Copy link
Copy Markdown
Contributor

Tested on Linux, merged onto main 21625bca8 (PR head 2057c0ef1, merges cleanly).

GPU: NVIDIA GeForce RTX 2070 SUPER (Turing, subgroup 32), proprietary driver 620.70.06, Fedora 44, llvm-mc 22.1.8, SPIRV-Tools 2026.1.

Run This PR main alone
run_gpu_tests.py native 198/249 passed, 49 skipped 197/248 passed, 49 skipped
LEONIDA_W64_EMULATE=1 230/249 passed, 17 skipped 229/248 passed, 17 skipped
run_semantic_tests.py tests/semantic 465 files, 6108 tests, 0 files failed in 97 s with 16 jobs 465 files, 6108 tests, 0 files failed

New fixture cs_relidx_ext: PASS in both modes.

The only failures in both runs are the known cs_imgload_tfe / cs_imgload_d16_tfe pair (#31), as on main. No regressions.

AI-assisted: yes (Claude Code ran the build and tests on my machine; numbers are the runners' own output).

@aslan2142

Copy link
Copy Markdown
Collaborator

This carry-over of old upstream PR 9813 has been taken over in #364, so I'm closing this draft as #17 describes. The branch old-pr/9813 stays.

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

@aslan2142 aslan2142 closed this Nov 24, 2026
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.

4 participants