Skip to content

TEST-251: GPU checks of wave64 vertex shaders split into two 32-lane halves - #1830

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
AwkGrep256:test-251-vs-w64-gpu
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
AwkGrep256:test-251-vs-w64-gpu

Conversation

@AwkGrep256

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-251 (#1548 (comment))

What and why

docs/design.md ("Wave64 graphics: partition invariance", SHADER-10) checked the tier A/B/C detector on the GPU for pixel shaders only. Vertex shaders were covered by the wave interpreter alone, because Vulkan cannot require a vertex subgroup size (requiredSubgroupSizeStages has no VERTEX on RADV or on the 880M's driver).

RADV can switch it anyway: it runs the VS stage (NGG) as wave64 by default and as wave32 with RADV_PERFTEST=gewave32 on GFX10+. I checked this in the RADV_DEBUG=shaders dump of gs_tri's NGG shader: 11 64-bit EXEC operations by default, 0 with gewave32 (32 exec_lo uses). This PR uses that switch to GPU-test wave64 vertex shaders at both sizes.

Measured along the way: RADV packs 62 or 64 vertices into a wave64 and 30 or 32 into a wave32, so the wave32 run repacks the vertices rather than halving the waves. That makes the test stricter for tiers A/B, which don't depend on packing.

Not in this PR: geometry shaders (follow-up; docs/design.md says the corpus GS are wave32, while the count in #94 lists all 195 as wave64, and I'll check which is right first). Also not here: s_wqm in a vertex shader. The detector calls it tier A. In a scratch run on the RX 9070 XT, the last two of 960 vertices got a different whole-quad bit at wave64 than at wave32, because the last wave held only those two vertices. The vertex-to-quad grouping depends on the driver's packing, so this isn't a translator bug, but tier A for VS s_wqm assumes the 32-lane run is an exact half of the 64-lane wave.

Tested

AI-assisted (Claude Code). CachyOS Linux, RADV Mesa 26.3.1, llvm-mc 23.1.5, SPIRV-Tools 2026.4, GCC 16.2.1, at a0acd33d plus this branch.

  • w64_graphics.py: 21/21 ok (14 ps_w64_*, 7 vs_w64_*) on an AMD Radeon RX 9070 XT (RDNA4, GFX1201) and on the Ryzen 7 9800X3D iGPU (RDNA2, GFX1036), each pinned with LEONIDA_VK_DEVICE. Tier C fixtures differ between wave64 and wave32, so both sizes really ran. Probe: largest lane id 63 by default and 31 with gewave32.
  • Mutation checks: vs_w64_c_bcnt_export and vs_w64_c_readlane relabelled tier A fail (958 and 960 of 960 vertices wrong). An EXPECT entry changed from C to B fails the classification test.
  • build.py: 182 shaders: 182 translated, 182 pass spirv-val.
  • run_gpu_tests.py (RX 9070 XT): 155/163 passed, 8 skipped, 0 failed, native and with LEONIDA_W64_EMULATE=1, the same as on main. check.py: 143 of 147 pass, 3 skipped. The one failure, cs_fma_fused, is identical on a clean main checkout, so it was already there and is unrelated (run_gpu_tests.py passes it).
  • python -m pytest tests/test_wave64_halves_fixtures.py: 6 passed. python -m unittest discover -s tests/semantic: OK. python -m compileall -q make_game.py tools tests: clean. tests/test_docs_links.py, tests/test_ctest_registration.py: OK.

Checklist

  • 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. (No new rule; the SHADER-10 row records the new GPU check.)

🤖 Generated with Claude Code

…halves

RADV runs the VS stage as wave64 by default and as wave32 with
RADV_PERFTEST=gewave32, so w64_graphics.py now draws seven vs_w64_*
fixtures (tiers A, B and C) both ways and compares the words each vertex
stores to the heap. vs_w64_c_lane_id is the probe that the wave size
changed. vk_harness gets VKH_VERTICES to draw enough vertices to fill
waves. Checked on an RX 9070 XT (GFX1201) and a Ryzen 9800X3D iGPU
(GFX1036), RADV Mesa 26.3.1: 21/21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rainmaker33

Copy link
Copy Markdown

Tested 2828e0c on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. This is the first non-AMD run of the vertex fixtures.

The PR's diff applied cleanly to main 6a6704d. VS 2022, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8; overlay layers off. Runtime, so vk_harness with VKH_VERTICES, built from this PR with scripts\build_runtime.ps1.

  • build.py: 192 translated, all pass spirv-val.
  • runtime/test/shaders/w64_graphics.py, with no RADV gewave32 switch on NVIDIA, so 32 lanes only:
    • Tier A/B vertex fixtures all ok: vs_w64_a_skip, vs_w64_b_ballot_atomic, vs_w64_b_readlane_uniform, vs_w64_b_waterfall. The 32-lane records match the words their headers derive.
    • vs_w64_c_bcnt_export, vs_w64_c_lane_id, vs_w64_c_readlane: SKIP (tier C needs a device that can require both 64 and 32, or W64G_REF), as expected. The existing ps_w64_* give the same split.
  • scripts/run_gpu_tests.py with this PR's build: 133/173 pass, 40 skipped (wave64); with LEONIDA_W64_EMULATE=1: 164/173, 9 skipped. No failures, the same counts as main.

@dcastell1

Copy link
Copy Markdown
Contributor

Code read + CPU tests, 2828e0c: pass (python -I tests/test_shader_checks.py → 59 tests OK, including the new vs_w64_a/b registry entries).

Not the GPU half: the 5090 is busy with a game right now, so the two new VS fixtures have not been executed on hardware by me. They are wave64 vertex shaders, which the runner pins to 32 lanes, so whoever takes it on a GPU should be able to run them with the normal run_gpu_tests.py and no LEONIDA_W64_EMULATE.

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.

4 participants