Wave64 VS / PS on 32-lane GPUs: the lanes 32..63 they read (NVIDIA) #133
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!133
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/133/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Foniass on GitHub · 2026-11-23 14:24 UTC · original
Foniass:nvidia/wave64-graphics-lanes→main· +1667 −44 · 8 files · 3 commits · merged 2026-11-23 14:39 UTCThe last open NVIDIA gap from HANDOFF / #42: wave64 VS / PS on GPUs with 32-lane waves only.
Problem
On NVIDIA the driver runs a console wave64 VS / PS in waves of 32: a console wave whose lanes 32..63 aren't populated. On the console those lanes exist (inactive) and hold whatever
v_writelaneor whole-wave code put there. Here they don't exist, andWaveReadLaneAtof a lane ≥ 32 reads lane & 31.wave_hazardsflagged 749 programs of the retail pack.What those programs do (748 PS, 1 VS)
v_permlanex16,v_readlane 32; min_u32 / max_u32 / or_b32)v_readlane v, s_ff1(mask & exec)v_writelanewas lost, the read returned slot lane & 31ds_bpermuteChange
gpu/recomp/upper_lanes.rs, a forward pass. It follows EXEC's upper word (0 / all ones / anything) through the SGPRs, and what each VGPR's lanes 32..63 hold:split_wave64, whenWaveGetLaneCount() < 64):v_writelanes also write.split_wave64(AMD and other 64-lane GPUs) the HLSL of all 26 698 programs is unchanged. The 32-lane form of the other modes is unchanged too;retail_wave64_graphics_lane_formscompares the digests.hle/d3d12x/real.rs): the pipeline hook compiled VS / PS withconsole_to_dxil(split_wave64false), so on NVIDIA the split form never reached a title. VS / PS, and the PS of two-pass (MS / GS) pipelines, now passwave32_only(device)like compute and the geometry stages.wave_hazards: now reports only the reads the pass can't follow; there are none in the pack.xcl shaders --recompprints the resolved reads by kind.Tests (RTX 5070 Ti, 32-lane waves)
gpu_wave64_ps_whole_wave_reductions: the pack's reduction as min and as a sum, plus the waterfall read, per hardware wave against a console wave of the same lanes.gpu_wave64_ps_spill_slots: full target and a 6-pixel triangle.gpu_wave64_vs_spill_slots_and_identity: 3 vertices.upper_laneshas 9, includingv_swaprel, SDWAv_cmpxand absorbing constants found in review; they fail without the fix.cargo test --workspace --releasewithXCL_SAMPLE_RPF: 560 passed, 0 failed, 2no wave64skips as onmain.retail_wave64_graphics_lane_census/_formsrun on the retail pack.main, 60 fps.Not exact yet (documented in docs/wave64-on-wave32.md)
WaveActiveMin/Max/BitOr. That would change the HLSL AMD gets, so it isn't part of this PR; your call.Once, during a full test run with another heavy session on the machine, the lib test binary died with an access violation in the
hle::d3d12xdescriptor-heap tests. It didn't come back in 35 further runs (25 of that module alone, 10 of the whole lib).🤖 Generated with Claude Code
@ivall on GitHub · 2026-11-23 14:40 UTC · original
Merged - thanks, a very clean one. Checked on Windows 11 with an RX 9070 (RDNA4, 64-lane waves):
cargo test --workspacegreen with the retail samples (529 lib tests), and the lib tests withXCL_SPLIT_WAVE64=1; the three new GPU tests pass on AMD too.retail_wave64_graphics_lane_forms: 613 changed VS / PS, all compile. I also ran the same test (withXCL_FORMS_NO_DXC=1) onmainbefore the merge: native-form digestac67db269b7452beand other-modes 32-lane digest09d45ad13eddc30don both, so AMD's HLSL is indeed unchanged.XCL_SPLIT_WAVE64=1(the forced 32-lane form on AMD; XDefiant stays black for a while there since that form starts from a cold shader cache).On the partial-wave min reduction: recognising the whole reduction and emitting
WaveActiveMin/Max/BitOrsounds right to me, even if it changes AMD's HLSL - as a separate PR, with a GPU test of a partial wave and the census numbers like here.