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

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

LouisRiverstone wants to merge 5 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
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@enlight3d

Copy link
Copy Markdown
Contributor

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

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

@TheGeogeo

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
…uarded out-of-range load

Mesa llvmpipe (LLVM 21.1.8) reads the address of a load behind a branch
that is not taken. The fixture's s_buffer_load_dword with s12 = -4 is out
of range by design (ProjectLeonida#1948): the translator guards it, the guard is false,
and the word is 0. But its address is 4 GiB past the buffer, so llvmpipe
segfaults (exit -11), which made linux-gpu-tools red on every head of
this branch.

Checked on llvmpipe in WSL: replacing only that load with s_mov_b32 makes
the fixture pass, and keeping the guard with an in-range address gives
the expected words, out[6] = 0 included.

DEVICE_SKIPS in check.py lists dumps a driver cannot run, by the device
name vk_compute_test prints before the shader runs; check.py and
run_gpu_tests.py both use it. GPUs that ran the fixture (RTX 4090,
RTX 3090, Apple M5 Pro) still judge every word.
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 30, 2026

@aslan2142 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

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.

@aslan2142 aslan2142 closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants