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

Open
github-bot wants to merge 3 commits from github-bot/gh-1448 into main AGit
Owner

@⁠LouisRiverstone on GitHub · 2026-11-25 00:24 UTC · original
LouisRiverstone:carry-old-9908 → main · +219 −3 · 5 files · 3 commits · open

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

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)
**@⁠LouisRiverstone** on GitHub · 2026-11-25 00:24 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1448) `LouisRiverstone:carry-old-9908` → `main` · +219 −3 · 5 files · 3 commits · open Claimed in the coordination issue as: OLD-9908 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) 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)
- GPU test cs_w32_late_ext: ds_mskor, v_add/sub_nc_i16 clamp, s_buffer_load constant offset
- test_late_ext_fixture: runs under python -I

Carried over from old-pr/9908 (old upstream PR 9908), rebased on main.
# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:44 +00:00
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-25 00:50 UTC · original

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.

**@⁠GeorgiyDemo** on GitHub · 2026-11-25 00:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1448#issuecomment-7148930691) 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.
Author
Owner

@⁠CodingRule on GitHub · 2026-11-25 12:20 UTC · original

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).

**@⁠CodingRule** on GitHub · 2026-11-25 12:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1448#issuecomment-7162239778) 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1448/head:github-bot/gh-1448'
git switch 'github-bot/gh-1448'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1448'
git switch 'github-bot/gh-1448'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1448'
git switch 'github-bot/gh-1448'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1448'
git switch 'main'
git merge --squash 'github-bot/gh-1448'
git switch 'main'
git merge --ff-only 'github-bot/gh-1448'
git switch 'main'
git merge 'github-bot/gh-1448'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.