Skip to content

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

Open
LouisRiverstone wants to merge 3 commits into
ProjectLeonida:mainfrom
LouisRiverstone:carry-old-9908
Open

LouisRiverstone wants to merge 3 commits into
ProjectLeonida:mainfrom
LouisRiverstone:carry-old-9908

Conversation

@LouisRiverstone

@LouisRiverstone LouisRiverstone commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

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 rdna2spirv: out-of-range s_buffer_load reads safely from heap base without branch (OLD-9916) #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)

…load constant offset

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

Copy link
Copy Markdown
Contributor

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.

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

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

3 participants