GPU test cs_w32_late_ext: ds_mskor, v_add/sub_nc_i16 clamp, s_buffer_load constant offset (OLD-9908) #1448

Closed
LouisRiverstone wants to merge 5 commits from upstream-pr/1448 into main
LouisRiverstone commented 2026-11-25 00:24:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by LouisRiverstone on 2026-11-25T00:24:19Z.


Claimed in the coordination issue as: OLD-9908 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148463379)

Depends on: #650

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

What and why

A GPU test in the cs_w32_*_ext format that CI runs on llvmpipe. It covers three changes that only had CPU checks: ds_mskor_b32/ds_mskor_rtn_b32, v_add/sub_nc_i16 with clamp, and the fix for an s_buffer_load with a constant SGPR offset. 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_late_ext_fixture.py.

Depends on #650. On current main this fixture crashes llvmpipe (exit -11). With the translator from #650, which is my old PR 9916 carried over by TanmaySatyam (out-of-range s_buffer_load reads through the heap base), it passes. So this PR should merge after #650. This PR, #650, #1447 (cs_w32_movrels64) and the other new GPU fixtures all add a name at the same place in check.py and run_gpu_tests.py. Whichever lands second needs a one-line rebase.

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_late_ext on this branch alone: FAIL, exit -11 (llvmpipe segfault).
  • The same with tools/rdna2spirv.py from #650: PASS. Words 0x12345678 0x1234AB78 0xFFFF0001 0x7FFF 0x8000 0x8000 0 0xEEEEEEEE, as expected.
  • python -I tests/semantic/test_late_ext_fixture.py: OK.
  • python -I scripts/run_semantic_tests.py tests/semantic: 477 files, 6227 tests, 0 files failed.

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)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482702253 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1448). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-25T00:24:19Z. --- Claimed in the coordination issue as: OLD-9908 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7148463379) Depends on: #650 Replaces the carried-over draft #173. I'm the original author of old upstream PR 9908. ### What and why A GPU test in the `cs_w32_*_ext` format that CI runs on llvmpipe. It covers three changes that only had CPU checks: `ds_mskor_b32`/`ds_mskor_rtn_b32`, `v_add/sub_nc_i16` with `clamp`, and the fix for an `s_buffer_load` with a constant SGPR offset. 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_late_ext_fixture.py`. **Depends on #650.** On current `main` this fixture crashes llvmpipe (exit -11). With the translator from #650, which is my old PR 9916 carried over by TanmaySatyam (out-of-range `s_buffer_load` reads through the heap base), it passes. So this PR should merge after #650. This PR, #650, #1447 (`cs_w32_movrels64`) and the other new GPU fixtures all add a name at the same place in `check.py` and `run_gpu_tests.py`. Whichever lands second needs a one-line rebase. 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_late_ext` on this branch alone: FAIL, exit -11 (llvmpipe segfault). - The same with `tools/rdna2spirv.py` from #650: PASS. Words `0x12345678 0x1234AB78 0xFFFF0001 0x7FFF 0x8000 0x8000 0 0xEEEEEEEE`, as expected. - `python -I tests/semantic/test_late_ext_fixture.py`: OK. - `python -I scripts/run_semantic_tests.py tests/semantic`: 477 files, 6227 tests, 0 files failed. GPUs tested: llvmpipe (Mesa, LLVM 21.1.8) on Linux under WSL2 AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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)
GeorgiyDemo commented 2026-11-25 00:50:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-25T00:50:12Z.


Tested 34cc55895 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_late_ext_fixture.py: OK at this head.
  • GPU, --filter cs_w32_late_ext: 1/1 PASS on MoltenVK 1.4.2 and 1/1 PASS on KosmicKrisp (Mesa 26.3.1), words 305419896 305441656 4294901761 32767 32768 32768 0 4008636142.
  • This is a new fixture — runtime/test/shaders/cs_w32_late_ext.asm does not exist on main, so there is no before/after to compare; the PR adds coverage only.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7148930691 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1448#issuecomment-7148930691). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-25T00:50:12Z. --- Tested `34cc55895` 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_late_ext_fixture.py`: **OK** at this head. - GPU, `--filter cs_w32_late_ext`: **1/1 PASS** on **MoltenVK 1.4.2** and **1/1 PASS** on **KosmicKrisp** (Mesa 26.3.1), words `305419896 305441656 4294901761 32767 32768 32768 0 4008636142`. - This is a new fixture — `runtime/test/shaders/cs_w32_late_ext.asm` does not exist on `main`, so there is no before/after to compare; the PR adds coverage only. AI-assisted; synthetic fixtures only, no game data.
CodingRule commented 2026-11-25 12:20:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by CodingRule on 2026-11-25T12:20:22Z.


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

  • Tested: this branch's head e41de2cf 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_late_ext, 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7162239778 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1448#issuecomment-7162239778). Originally posted by [CodingRule](https://github.com/CodingRule) on 2026-11-25T12:20:22Z. --- GPU test on an NVIDIA Ada card, for the record: this passes on an **RTX 4090**. - **Tested:** this branch's head `e41de2cf` 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_late_ext`, 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).
enlight3d commented 2026-11-29 12:08:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T12:08:57Z.


Run on RTX 3090 (PR head, plus one extra run on main with the conflict resolved by hand)

  • Heads: PR head 53098ca27, main 8fb974878. The merge conflicts in scripts/run_gpu_tests.py (the new name is added at the same place as other new fixtures), so the main test below is the PR head as it is (detached, not merged).
  • This test is not registered in ctest, so there is no ctest -R. Configure: cmake -S runtime -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON -DSDL3_DIR=<SDL3 cmake folder>. Build: cmake --build build -j 8 --target vk_compute_test vk_store_test vk_harness gta6rt.
  • Green on the PR head: python -I scripts/run_gpu_tests.py --build build --disasm-dir tests/semantic/fixtures/disasm --assembler python --filter cs_w32_late_ext: PASS, 1/1, words 305419896 305441656 4294901761 32767 32768 32768 0 4008636142, which are the expected 0x12345678 0x1234AB78 0xFFFF0001 0x7FFF 0x8000 0x8000 0 0xEEEEEEEE. python -I tests/semantic/test_late_ext_fixture.py: OK (4 tests).
  • Extra, on main: merged the PR into main by hand, resolving the one conflict by keeping main's lines and adding "cs_w32_late_ext" to the same lists. Same command: PASS, same words; the fixture test: OK. Not the PR as submitted, but it shows the fixture holds on current main.
  • Red: none on this GPU. The PR changes only tests (no non-test code to revert), and it says the fixture crashes llvmpipe on main without #650. Here it passes on NVIDIA both on the PR head and on main, so this machine does not reproduce that crash and does not show a need for #650. What I could show: with tools/ put back to the commit just before #1948 (so without #1948, #1954 and #1974) and everything else unchanged, tests/semantic/test_late_ext_fixture.py fails (Unsupported: v_add_nc_i16). The GPU run could not be redone that way, because the older translator does not accept the arguments the new script passes.
  • Link: this PR changes no runtime source. gta6rt.exe imports compared with a plain main build (dumpbin /imports, DLL!symbol): one entry differs, api-ms-win-crt-stdio-l1-1-0.dll!__stdio_common_vswscanf; it comes from the older base of this branch (runtime/src/base_reservation.h calls a scanf function there; main does not), not from the PR. No new imports from this PR.
  • Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44.

The branch is 3449 commits behind main; could you merge main into it when you have a moment? Thanks.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7255601371 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1448#issuecomment-7255601371). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T12:08:57Z. --- Run on RTX 3090 (PR head, plus one extra run on main with the conflict resolved by hand) - Heads: PR head 53098ca27, main 8fb974878. The merge conflicts in `scripts/run_gpu_tests.py` (the new name is added at the same place as other new fixtures), so the main test below is the PR head as it is (detached, not merged). - This test is not registered in ctest, so there is no `ctest -R`. Configure: `cmake -S runtime -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON -DSDL3_DIR=<SDL3 cmake folder>`. Build: `cmake --build build -j 8 --target vk_compute_test vk_store_test vk_harness gta6rt`. - Green on the PR head: `python -I scripts/run_gpu_tests.py --build build --disasm-dir tests/semantic/fixtures/disasm --assembler python --filter cs_w32_late_ext`: **PASS**, 1/1, words `305419896 305441656 4294901761 32767 32768 32768 0 4008636142`, which are the expected 0x12345678 0x1234AB78 0xFFFF0001 0x7FFF 0x8000 0x8000 0 0xEEEEEEEE. `python -I tests/semantic/test_late_ext_fixture.py`: OK (4 tests). - Extra, on main: merged the PR into main by hand, resolving the one conflict by keeping main's lines and adding `"cs_w32_late_ext"` to the same lists. Same command: **PASS**, same words; the fixture test: OK. Not the PR as submitted, but it shows the fixture holds on current main. - Red: **none on this GPU.** The PR changes only tests (no non-test code to revert), and it says the fixture crashes llvmpipe on main without #650. Here it passes on NVIDIA both on the PR head and on main, so this machine does not reproduce that crash and does not show a need for #650. What I could show: with `tools/` put back to the commit just before #1948 (so without #1948, #1954 and #1974) and everything else unchanged, `tests/semantic/test_late_ext_fixture.py` fails (`Unsupported: v_add_nc_i16`). The GPU run could not be redone that way, because the older translator does not accept the arguments the new script passes. - Link: this PR changes no runtime source. gta6rt.exe imports compared with a plain main build (`dumpbin /imports`, DLL!symbol): one entry differs, `api-ms-win-crt-stdio-l1-1-0.dll!__stdio_common_vswscanf`; it comes from the older base of this branch (`runtime/src/base_reservation.h` calls a scanf function there; main does not), not from the PR. No new imports from this PR. - Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44. The branch is 3449 commits behind main; could you merge main into it when you have a moment? Thanks.
TheGeogeo commented 2026-11-29 14:19:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:19:30Z.


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

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257214352 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1448#issuecomment-7257214352). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:19:30Z. --- Ready for testing: with today's merge of `main` into the branch (head `42e00369b`), it merges cleanly with `main` `3535eb5c4`, and its change is not in `main` yet. No duplicate found: its claim `OLD-9908` appears in no other open pull request and in no `main` commit. AI-assisted (Claude Code).
aslan2142 commented 2026-12-01 11:45:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:45:55Z.

Review: CHANGES_REQUESTED


Conflicts with main in scripts/run_gpu_tests.py, with failing stale CI. Please rebase onto current main to resolve the conflict and trigger a fresh green CI pass.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130588341 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1448#pullrequestreview-6130588341). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:45:55Z. **Review:** CHANGES_REQUESTED --- Conflicts with `main` in `scripts/run_gpu_tests.py`, with failing stale CI. Please rebase onto current `main` to resolve the conflict and trigger a fresh green CI pass. *(AI-assisted review.)*
aslan2142 commented 2026-12-01 16:35:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:35:55Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317870856 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1448#issuecomment-7317870856). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:35:55Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1448
No description provided.