Skip to content

GPU test cs_w32_movrels64: s_movrels_b64 (OLD-9913) - #1447

Open
LouisRiverstone wants to merge 4 commits into
ProjectLeonida:mainfrom
LouisRiverstone:carry-old-9913
Open

LouisRiverstone wants to merge 4 commits into
ProjectLeonida:mainfrom
LouisRiverstone:carry-old-9913

Conversation

@LouisRiverstone

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: OLD-9913 (#14 (comment))

Replaces the carried-over draft #179. I'm the original author of old upstream PR 9913.

What and why

An old upstream PR merged s_movrels_b32/s_movrels_b64 with CPU-only checks, and the cs_w32_pk_rel_ext fixture covers only the b32 form. This adds a GPU fixture, runtime/test/shaders/cs_w32_movrels64.asm: s_movrels_b64 pairs with an M0 set at run time, an overlapping source and destination pair (even-aligned, because LLVM 22+ rejects s[21:22]), and SCC kept. The fixture is wired into check.py and scripts/run_gpu_tests.py. Its disassembly is in tests/semantic/fixtures/disasm/ and is checked by tests/semantic/test_movrels64_fixture.py.

The old branch's final diff, applied on current main as one commit. It applied cleanly.

Tested

  • python -I scripts/run_gpu_tests.py --filter cs_w32_movrels64: PASS with llvm-mc 21.1 and with llvm-mc 23. Words 0x5EED0111 0x5EED0222 0x5EED0444 0x5EED0555 0x5EED0555 0x5EED0111 0x5EED0222 1, as expected.
  • python -I tests/semantic/test_movrels64_fixture.py: OK.
  • python -I scripts/run_semantic_tests.py tests/semantic: 477 files, 6228 tests, 0 files failed.

The old PR was also checked on real GPUs by other people (RX 6800, RTX 3080 Ti, RX 9070 XT, RTX 4090, RTX 5090, Steam Deck and others), on the branch as it was then.

GPUs tested: llvmpipe (Mesa, LLVM 21.1.8) on Linux under WSL2

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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. (n/a: no translator rule changes)

- GPU test cs_w32_movrels64: s_movrels_b64
- cs_w32_movrels64: an even-aligned overlap pair (LLVM 22+ rejects s[21:22])
- test_movrels64_fixture: runs under python -I

Carried over from old-pr/9913 (old upstream PR 9913), rebased on main.
@GeorgiyDemo

Copy link
Copy Markdown
Contributor

Tested cf0d9ca35 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main b4b7756e8 (new GPU fixture; no translator or C++ changes, binaries from the build at 66d4f5aa3):

  • tests/semantic/test_movrels64_fixture.py: OK at this head.
  • GPU, --filter cs_w32_movrels64: 1/1 PASS on MoltenVK 1.4.2 and 1/1 PASS on KosmicKrisp (Mesa 26.3.1), words 1592590609 1592590882 1592591428 1592591701 1592591701 1592590609 1592590882 1.
  • This is a new fixture — runtime/test/shaders/cs_w32_movrels64.asm does not exist on main, so there is no before/after to compare; the s_movrels_b64 form it covers had no GPU fixture before.

AI-assisted; synthetic fixtures only, no game data.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
@CodingRule

Copy link
Copy Markdown
Contributor

GPU test on an NVIDIA Ada card, for the record: this passes on an RTX 4090.

  • Tested: this branch's head e781a408 merged onto main 0d80bc5d (clean merge), test programs built from that main with scripts\build_runtime.ps1.
  • Command: python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_movrels64, once native and once with LEONIDA_W64_EMULATE=1.
  • Result: 1/1 translated and spirv-val clean, 1/1 passed in both modes, with the expected words/pixels from the fixture header. Nothing skipped.
  • Device: NVIDIA GeForce RTX 4090 (Ada / AD102), driver 591.86, Vulkan 1.4.325, subgroup 32..32, Windows 11 Pro build 26200. llvm-mc 21.1.8 (scripts\build_llvm_mc.ps1), SPIRV-Tools v2026.4, MSVC 14.44.35207.

Only the filtered fixture(s) were run for this PR, not the full suite or ctest; the full-suite baseline for this card on main is in #1777. Synthetic fixtures only, no game files. AI-assisted (Claude Code ran the tests and wrote this comment).

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@OreoFR

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

Run 1 (lot 4)

  • Base: main 09c153948 + PR head 1a460f1e3; integration package 1 of 6 (20 PRs, merged without conflict)
  • Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; full Python suite; translator suite
  • Red on main: n/a (integration test; main baseline: xbox_present and d3d12_set_descriptor_heaps)
  • Green with the PR: ctest: only xbox_present and d3d12_set_descriptor_heaps fail, as on main; Python: the same 7 failing files as main, the PRs' 11 test files pass; translator: 0 failures
  • Verdict: CLEAN PACKAGE (no new failure vs main)

Run 2 (lot 4 bis)

  • Base: main 33db04a70 + PR head 1a460f1e3; integration package of 15 PRs
  • Test: full runtime build; ctest -j 6 without the 28 tests that launch gta6rt; the PRs' Python tests; translator suite
  • Red on main: n/a (integration test; main baseline: xbox_present, and flaky xmem)
  • Green with the PR: ctest: only xbox_present fails as on main (xs_proxy_mock failed once, flaky: passes on rerun and 5/5 direct runs); Python: same failures as main, the PRs' tests pass; translator: 507 files, 6405 tests, 0 failures
  • Verdict: CLEAN PACKAGE (no new failure vs main)

All runs

  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

@TheGeogeo

Copy link
Copy Markdown
Contributor

Ready for testing: with today's merge of main into the branch (head ee3e77a86), it merges cleanly with main 3535eb5c4, and its change is not in main yet. No duplicate found: its claim OLD-9913 appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
@enlight3d

Copy link
Copy Markdown
Contributor

Independent run of #1447 (a GPU test fixture, run on a real GPU through Vulkan; no game, gta6rt not run).

  • PR head: ee3e77a (merge-base 9bb67cb)
  • main: c22a0a7 (PR merged into it locally with git merge --no-ff, clean; only the 5 files of the PR touched: check.py, cs_w32_movrels64.asm, run_gpu_tests.py, the disasm fixture, the new test)
  • Machine: Windows 11 Pro 10.0.26300, RTX 3090 24 GB, NVIDIA 621.40, MSVC 14.44, Vulkan SDK 1.4.363.1, CPython 3.13.12. No llvm-mc on this PC.

Commands: build vk_compute_test vk_store_test vk_harness (cmake as scripts/build_runtime.ps1, Ninja, RelWithDebInfo, -j 8), then python -I scripts/run_gpu_tests.py --disasm-dir tests/semantic/fixtures/disasm --filter cs_w32_movrels64 --build runtime/build and python -I tests/semantic/test_movrels64_fixture.py; on the merged tree also python -I scripts/run_semantic_tests.py tests/semantic.
Because there is no llvm-mc here, the GPU test ran from the committed disassembly (--disasm-dir), so the step that assembles cs_w32_movrels64.asm with llvm-mc was NOT exercised, nor was check.py itself (it also needs llvm-mc); the PR's wiring of check.py is covered only by the text check in the new Python test.

  • Red: the PR has no non-test change to revert (everything in it is test material, and the op it tests is already translated on main), so there is no red in the usual sense. Two honest reds instead:
    • Wiring reverted (check.py and scripts/run_gpu_tests.py back to the merge-base, the new test and fixture kept): the Python test fails, 2 failures (test_gpu_runners_expect_the_same_words, once per file, "unexpectedly None"), and the GPU runner refuses: "selected cs_w32_movrels64 but no runnable GPU test cases".
    • Mutation of the translator (not part of the PR, my own edit to tools/rdna2spirv.py, undone afterwards), to show the new test can fail: (a) s_movrels ignoring M0: Python test fails word by word (every word it printed, 0 to 5, was wrong), GPU test FAIL with 7 of the 8 words wrong; (b) s_movrels_b64 writing the destination before the second source dword is read (breaks the overlapping pair): Python test fails on word 6 only, GPU test FAIL with word 6 = 0x5EED0111 where 0x5EED0222 is expected.
  • Green at head: test_movrels64_fixture.py 5/5 OK; GPU test cs_w32_movrels64 PASS, 1/1, eight words 0x5EED0111 0x5EED0222 0x5EED0444 0x5EED0555 0x5EED0555 0x5EED0111 0x5EED0222 1 as expected; the shader also passes spirv-val.
  • Green merged into main: same two OK/PASS. Full semantic suite on the merged tree: 530 files, 6531 tests, 1 file failed: test_interp_computed_ij_fallback (2 failures of 9, f16 interpolation values). It fails the same way on plain main (same 2 failures), so it is pre-existing and unrelated to this PR.
  • gta6rt link check: dumpbin /imports of gta6rt.exe built from the merged tree and from plain main: 718 imports each, 0 new, 0 removed (the exe is byte-identical; the PR touches no C++ or CMake file).

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