Repository navigation
TEST-251: GPU checks of wave64 geometry shaders, and no false tier C for a GS's ring address - #2127
AwkGrep256 wants to merge 1 commit into
Conversation
|
Tested fd20500 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Tested fd20500 on AMD Radeon RX 7900 XTX (RDNA3, Navi 31), AMD driver 26.11.2, Vulkan 1.4.359, Windows 11: pass.
Not run: Tools: llvm-mc 21.1.8 (WSL), Vulkan SDK 1.4.363.0, MSVC 14.44. |
|
Tested fd20500 on an RX 9060 XT (RDNA4, GFX1200), RADV Mesa 27.0.0-devel, Nobara Linux (Fedora 44, kernel 7.3): pass This adds a third RDNA4 part to the two GPUs in the description: GFX1200, not GFX1201. Setup: llvm-mc 22.1.8 and SPIRV-Tools 2026.1. The head is on
I didn't repeat the mutation test, or the AI-assisted (Claude Code). |
|
Tested Built the fixtures with the PR's 23/23 fixtures ok — Tier A and B fixtures produce the words their headers derive. The tier C fixtures show the expected partition-dependent difference between the wave64 run and the Note: I rebuilt |
|
Tested fd20500 on AMD Radeon 610M (RDNA2 iGPU, gfx1036, RADV Mesa 26.2.6) and NVIDIA RTX 4070 Ti (615.78.08), Fedora 45: pass New here: the cross-device tier-C check. NVIDIA can only require 32 lanes, so on its own it skips all 12 tier-C fixtures. I saved the RADV wave64 runs with
CommandsTest programs built from this head, llvm-mc 23.1.5, SPIRV-Tools 2026.2. AI-assisted (Claude Code); numbers copied from the run logs. |
…for a GS's ring address rdna2spirv maps a legacy GS's LDS write to an output slot from its offset alone and drops the VGPR address (the lane's GSVS area), but wave64_halves read that address as the store's data, so a GS whose lane id only forms its GSVS base was tier C lane-id. It now checks only the data operands of a GS ds_write. w64_graphics.py draws gs_w64_a_ring and gs_w64_c_lane_id at wave64 and wave32 (RADV_PERFTEST=gewave32), build.py builds gs_* fixtures with gs_tri's signatures, docs/testing.md explains how to run and extend the wave64 graphics checks, and docs/design.md records the rule and that the corpus GS are written for wave64. Checked on an RX 9070 XT (GFX1201) and a Ryzen 9800X3D iGPU (GFX1036), RADV Mesa 26.3.1: 23/23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fd20500 to
b92bdd3
Compare
# Conflicts: # docs/design.md
|
Closing: this was merged into |
# Conflicts: # docs/design.md # docs/testing.md
Claimed in the coordination issue as: TEST-251, part 2 (#1902 (comment)). Part 1, the vertex shaders, is #1830 (merged).
What and why
The problem. A wave64 graphics shader on a 32-wide GPU runs as two 32-lane halves.
tools/wave64_halves.pymarks each one tier A, B or C by whether that split can change its results; tier C means "may be wrong" and is refused under--wave64-graphics=error. For geometry shaders the detector gave a false tier C.A legacy GS writes each output vertex to LDS at
lane's GSVS base + offset, where the base usually comes from the lane id (v_mbcnt_lo/hi). The translator never uses that base:rdna2spirv.gs_dspicks the output slot from the constant offset alone. So the lane id cannot reach any output. The detector still treated it as observable, because fords_write vaddr, vdata...it read operand 0, the address, as the data. The result was tier Clane-idfor a shader that is exact.The fix (
tools/wave64_halves.py, 4 lines): for ads_writein a GS, check only the data operands. Data that depends on the lane, and a lane id in a real memory store's address, stay tier C.Why it may matter for the game (a hypothesis, I have no game files): the corpus count in #94 finds
v_mbcnt_hi_u32_b32in all 195 corpus GS. If it forms their GSVS base, all 195 were a false tier C.python -I tools/wave64_halves.py --census <work>/shaders/spirv/index.jsonshows it (counts only).GPU checks for geometry shaders. Until now they had none (
docs/design.md: "geometry shaders are not tested"). As in #1830, RADV'sRADV_PERFTEST=gewave32switches the GS stage between wave64 and wave32:gs_w64_c_lane_id: the lane id as data (tier C). It is also the probe that the wave size changed: the largest lane id is 41 by default and 31 withgewave32.gs_w64_a_ring: the lane id only in the GSVS address, the shape described above (tier A).build.pynow buildsgs_*fixtures.gs_container()writes the same ISG1/OSG1 asrun_gpu_tests.pymakes forgs_tri.Docs.
docs/design.md: the SHADER-10 row records the rule and how it was confirmed.docs/design.md: the "Geometry shaders" row said the corpus GS are wave32. The code says wave64: the EXEC prologue compares the thread count with 64 and writes a 64-bit EXEC, all 195 containv_mbcnt_hi, and the translator marks themwave64. The row now says so, marked as inferred.docs/testing.md: new section on runningw64_graphics.pyon RADV and adding a fixture.Tested
AI-assisted (Claude Code). CachyOS, RADV Mesa 26.3.1, llvm-mc 23.1.5, SPIRV-Tools 2026.4, on
main4eb6155 plus this branch, test programs rebuilt from it. GPUs: RX 9070 XT (RDNA4, GFX1201) and Ryzen 7 9800X3D iGPU (RDNA2, GFX1036), each pinned withLEONIDA_VK_DEVICE.tests/test_wave64_halves_fixtures.pyfailed ongs_w64_a_ring(tier Clane-id), while the GPU already gave equal records at wave64 and wave32. After it, 8 passed.lane id * 96translates, afterspirv-opt -O, to the same instructions asgs_tri(IDs aside).w64_graphics.py: 23/23 on both GPUs (14ps_w64_*, 7vs_w64_*, 2gs_w64_*).gs_w64_c_lane_idrelabelled tier A fails on both GPUs (311 and 312 of 320 records wrong).tests/semantic: 1674 tests OK, including 3 newGeometryRingcases. Without the fix, only the ring-address case fails.run_gpu_tests.py(RX 9070 XT): 167/180 passed, 0 failed, 13 skipped native, 167/180 passed, 0 failed, 13 skipped withLEONIDA_W64_EMULATE=1.build.py: 202 translated, all passspirv-val.check.py: 155 of 160, 4 skipped. The one failure,cs_fma_fused, is the same on cleanmain. RADV splits GLSLFmainto two roundings on both GPUs, andLEONIDA_FMA=khris exact. It is unrelated to this PR, and I'm reporting it separately.compileall,tests/test_docs_links.py,tests/test_text_write_line_endings.py: OK.Checklist
docs/design.md, with how it was confirmed (SHADER-10 row).🤖 Generated with Claude Code