Skip to content

GPU test for v_movrels_b32, v_movreld_b32, v_movrelsd_b32 (EGEN-GPU-LANE-MOVREL) - #2266

Open
Vonsek wants to merge 6 commits into
ItsNotRexed:mainfrom
Vonsek:test/gpu-movrel
Open

Vonsek wants to merge 6 commits into
ItsNotRexed:mainfrom
Vonsek:test/gpu-movrel

Conversation

@Vonsek

@Vonsek Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Requested by Lucas · project thread

Claimed in the coordination issue as: EGEN-GPU-LANE-MOVREL, #2078 (comment)

What and why

v_movrels_b32, v_movreld_b32 and v_movrelsd_b32 (VGPR indexing by the whole of M0) were checked on the CPU only. This adds runtime/test/shaders/cs_w32_movrel.asm, a wave32 dump that runs each op with several M0 values and has lane 0 store eight words:

  • v_movrels_b32 with M0 = 0, 3 and 82
  • v_movreld_b32 with M0 = 2 and 100, and the unindexed destination register keeps its value
  • v_movrelsd_b32 with M0 = 1 and 48

The expected words and their derivation from the ISA definitions are in the shader header, written by hand. The same shader is a tests/semantic fixture (cs_w32_movrel, in regen_fixtures.py) with tests/semantic/test_movrel_fixture.py, which checks the words against a plain-Python model and checks that check.py and run_gpu_tests.py expect the same words. The docs/design.md row for v_movrel* now names the GPU test.

No translator change. Out-of-range indices are not tested: design.md lists the hardware range check as not modelled. v_movrelsd_2_b32 already has cs_movrelsd_2, and v_swaprel_b32 / s_movrels are in #1850, so they are left out. #2181 adds CPU interpreter tests for the same ops and does not overlap with this GPU test.

Tested

  • NVIDIA GeForce RTX 5080 (driver 616.92, subgroup 32): cs_w32_movrel PASS, 160 163 146 164 48 165 161 88.
  • AMD Radeon iGPU, Ryzen 9 9950X3D (driver 26.10.1, subgroup 32..64): PASS, same words.
  • Negative control (one-line change in tools/rdna2spirv.py, reverted): ignoring M0 in v_movreld_b32 gives 160 163 146 50 164 305 161 88 (FAIL on both GPUs); in v_movrels_b32 160 160 160 164 48 165 161 88 (FAIL, 5080); in v_movrelsd_b32 160 163 146 164 48 165 65 152 (FAIL, 5080). Restored, both GPUs pass again.
  • python -m unittest discover -s tests/semantic, python tests/semantic/regen_fixtures.py --check, python -I tests/test_shader_checks.py: all OK (1674 tests, 2 skipped; fixtures clean; shader checks OK). tests/test_docs_design_rows.py reports duplicate topic rows in docs/design.md that are already on main; this PR adds no row and only extends one row's text.

AI-assisted.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule; the existing v_movrel* row now cites the GPU test.)

cs_w32_movrel runs each op with M0 = 0 to 100 and stores eight words from lane 0
(derivations in the shader header). Added as a tests/semantic fixture with a
plain-Python reference, and the v_movrel* row in docs/design.md names the GPU test.

AI-assisted.
Conflicts:
	docs/design.md

AI-assisted.
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (17a196c) again; CPU checks and the PR's GPU tests pass on Radeon RDNA2 iGPU. AI-assisted.

@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 17a196cb52bbf29f257d3e9b626108d11870ee00 on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

Independent synthetic Vulkan check of 17a196cb52bbf29f257d3e9b626108d11870ee00 on Linux 7.0.0-43 (RTX 5090, NVIDIA 595.99.02, subgroup 32, LLVM 21.1.8, SPIRV-Tools 2026.1).

  • cs_w32_movrel passed SPIR-V validation and the focused GPU runner. The eight lane-0 words matched exactly (a0 a3 92 a4 30 a5 a1 58), and the rest of the dump retained its fill.
  • I changed only the second v_movrels_b32 case's M0 value from 3 to 4 in a scratch copy, selecting another initialized register. The runner flagged the mismatch, and the direct GPU readback changed only the second word, from a3 to a4. Both modules passed Vulkan 1.2 SPIR-V validation.
  • All three targeted semantic tests and the fixture regeneration check passed. This verifies the fixture's in-range indices on NVIDIA Vulkan.

AI-assisted verification.

@emirduran707

Copy link
Copy Markdown
Contributor

Tested 17a196c on AMD Radeon RX 9060 XT (RDNA4), AMD driver 26.10.44 (LLPC, Vulkan driver 2.0.395), Windows 11 Pro 10.0.26300, subgroup 32..64: pass. The check above is NVIDIA on Linux; this one is AMD on Windows, with native 64-wide subgroups.

  • python -I scripts/run_gpu_tests.py --build <build> --filter cs_w32_movrel: 1/1 pass, words 160 163 146 164 48 165 161 88. Same with LEONIDA_W64_EMULATE=1.
  • Whole suite (native wave64): 191 shaders translated, 191 pass spirv-val; 171/186 passed, 15 skipped, 0 failed (main 4947579 here: 170/185, 15 skipped). The skips are the 14 fixtures the d3d12_* tests run, and ps_w64x_readlane (see check.py: judge ps_w64x_readlane where vk_harness required 64 (its line has no "required") #2085).
  • build.py + check.py: 205 shaders translated, 205 pass spirv-val; 160 of 164 pass, 4 skipped; cs_w32_movrel ok.
  • CPU: python -I -m unittest discover -s tests/semantic -p test_movrel_fixture.py 3 OK, tests/test_shader_checks.py 60 OK, tests/test_run_gpu_tests.py 30 OK, tests/semantic/regen_fixtures.py --check clean.

Test programs: an MSVC 14.44 build of 4947579, this PR's base; the PR changes no C++ or CMake. llvm-mc 21.1.8 (native), Vulkan SDK 1.4.363.0. No negative control run here. No game files. AI-assisted (Claude Code).

docs/design.md
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py

AI-assisted.
docs/design.md
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py

AI-assisted.
@crastinator

Copy link
Copy Markdown
Contributor

Tested 38e3c9e merged into main aa2988cc (clean merge) on AMD Radeon RX 6700 XT (Navi 22, gfx1031, subgroup 32..64), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5, GCC 16.2.1, llvm-mc 23.1.5: pass.

  • New test passes natively: cs_w32_movrel (160 163 146 164 48 165 161 88).
  • Whole run_gpu_tests.py: 197/211 native, 197/211 with LEONIDA_W64_EMULATE=1 (the skips are the D3D12-only fixtures and ps_w64x_readlane, as on main). ctest 47/47.
  • tests/semantic/test_movrel_fixture.py: 3 passed, 10 subtests passed.

No game files. AI-assisted (Claude Code).

@bobcatchris

Copy link
Copy Markdown
Contributor

Apple M2 / MoltenVK validation of head a076a056 (hardware reports Apple M2 / Mac14,3, not M1), macOS 26.4, MoltenVK 1.4.2, subgroup range 4..32, llvm-mc 23.1.6. Python/translator-only change; the C++ harness was built once from the shared base 3eb4410b for a clean A/B.

  • New GPU fixture cs_w32_movrel PASS: cs_w32_movrel 160 163 146 164 48 165 161 88
  • Full suite on the PR head: 217 shaders translated, 217 pass spirv-val; 153/218 passed, 58 skipped, 7 failed (the known MoltenVK expected set). Base 3eb4410b with the identical harness: 152/217, 58 skipped, 7 failed. The only difference is this PR's new passing fixture; no common test changed status in either direction.

No code changes, no game data; synthetic fixture and counts only.

AI-assisted.

@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown

Tested a076a05 (merge base 7b7d73f) on NVIDIA GeForce RTX 5080, Linux 580.65.06: pass

Tested the PR head merged with current main 7b7d73f8 (clean merge, not pushed). Runtime harnesses built from main 7b7d73f8, llvm-mc 21, Python 3.13, Vulkan SDK 1.4.363, Linux native.

Check main 7b7d73f8 this PR
run_gpu_tests.py native 170/217 passed, 47 skipped 171/218 passed, 47 skipped
run_gpu_tests.py with LEONIDA_W64_EMULATE=1 201/217 passed, 16 skipped 202/218 passed, 16 skipped
failed (native / emulated) 0 / 0 0 / 0
tests/semantic/regen_fixtures.py --check ok ok
pytest tests/semantic/test_movrel_fixture.py tests/test_find_hash_lookup.py tests/test_first_look_shim_report.py tests/test_shader_checks.py tests/test_run_gpu_tests.py tests/test_cf_diff.py 162 passed, 315 subtests passed (3 shared files) 169 passed, 1 skipped, 325 subtests passed in 3.86s

Line-by-line against my main run (results that differ from main):

  • native:
    • cs_w32_movrel main: - pr: PASS 160 163 146 164 48 165 161 88
  • emulated:
    • cs_w32_movrel main: - pr: PASS 160 163 146 164 48 165 161 88

Not run: the full unittest discover -s tests/semantic (about 6 minutes, and main alone has failures there); only the test files this PR touches plus the shared checker tests ran. No other GPU vendor, no Windows. No game files.

AI-assisted (Claude Code).

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.

6 participants