recomp: run wave64 compute programs as two wave32 halves on 32-lane GPUs #70
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!70
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/70/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?
@gefydev on GitHub · 2026-11-23 00:11 UTC · original
gefydev:recomp-compute-wave32→main· +113 −13 · 5 files · 1 commits · closed without mergingOn NVIDIA (32-lane waves only) every translated console compute shader fails. The compute path always emits
[WaveSize(64)], since console compute programs are wave64, and the driver refuses that pipeline:translated_compute_psothen records a translation error and the title's dispatches with that pipeline are skipped. The README mentions this ("console wave64 compute … programs are mostly refused there").Mesh programs already have the fix for the same problem (#39): a logical wave64 runs as two native wave32 halves (
xcl_half,xcl_logical_wave64), andgeometry_wave32_hazardsrefuses programs that need both halves at once. This PR uses that for compute:Options::compute_wave32andtranslate_compute, the compute counterpart oftranslate_mesh: the same hazard check, with "compute program requires unsupported cross-half wave64 semantics" in the error.[WaveSize(32)], withxcl_half = (gi >> 5) & 1andlane_id = WaveGetLaneIndex() + 32 * xcl_half, as in mesh mode.numthreads, thread ids, group ids, TG_SIZE and LDS are unchanged.translated_compute_psopassesgeometry_wave32_required(this), the same adapter check console mesh pipelines use. On adapters with wave64 (RDNA) it is false and the generated HLSL is unchanged.This doesn't cover programs with cross-half semantics (DPP/swizzle reductions, whole-wave mask counts, …). Those are still refused, as for mesh. #33 is working on a groupshared rendezvous for those. This PR is the smaller step that lets everything else run.
Validation
GTX 1650 (Turing, wave32 only), Windows 11, NVIDIA driver 32.0.16.2114, MSVC debug build:
cargo test --workspacehas 0 failures, as onmainon this machine, and the three new tests ran and passed. I first worked on it on the same GPU on Linux (Wine + vkd3d-proton 2.14.1), where the results are the same.gpu_compute_wave64_as_wave32_halves: the program fromgpu_compute_mode_dispatch_abi(two wave64s per group, LDS +s_barrierbetween them) translated split. Same results as the wave64 test checks.gpu_compute_mode_dispatch_abinow shares its program and check with it.gpu_compute_wave32_halves_keep_their_exec_bits:v_cmpxkeeps lanes 0..39, so the high half has 8 live lanes. Withlane_idleft atWaveGetLaneIndex()it fails (lane 32 gives 0 instead of 33).split_compute_refuses_cross_half_semantics(no GPU):s_bcnt1_i32_b64on VCC is refused split and translates with wave64.CreateComputePipelineState: 0x80070057, i.e. whatmaindoes.cargo test -p xcl --lib: 0 failed on the GTX 1650 (41 GPU tests skipped with "no wave64", as before) and without a GPU.Not tested on RDNA: there the split tests run
[WaveSize(32)], which RDNA supports, and nothing else changes.precise, and thes_round_modeNOOPs are not free #73@FZNull on GitHub · 2026-11-23 00:51 UTC · original
Validated on native Windows 11 (not Wine/vkd3d-proton): RTX 4060 (Ada, lane range 32..32), MSVC, DXC 1.8.2502.11 from SDK 10.0.26100.
dd713e3/ PR head1772f1ecargo test --workspace --no-fail-fast: 375 passed, 0 failed, 34 ignored (main: 372), 42.4 sSKIPPED ...: no wave64stays at 41 on this adapter; the 3 new split-compute tests passcargo build --workspace: 11.3 s, no warnings from the changed cratesNo TDR, no device removal. Nothing from a game package was used.
AI-assisted.
@certified-retart on GitHub · 2026-11-23 02:15 UTC · original
Verified
1772f1eend-to-end on native Windows 10 (D3D12 Agility SDK 1.620.2 / DXC 10.0.26100.0) on NVIDIA GeForce RTX 5070 (wave32,XCL_ADAPTER=0) combined with PR #78'sgpu_compute_e2etest (console_wave64_compute_through_the_pso_hook_dispatch_and_read_back):0x80070057(E_INVALIDARG).CreateComputePipelineStatetranslates and compiles the console wave64 CS (4376 B DXIL), dispatches throughrunner::dispatch_on, and passes full readback verification (per-thread IDs, TGID, LDS +s_barrieracross both waves) on RTX 5070 in 0.53s (1 passed; 0 failed).@Foniass on GitHub · 2026-11-23 02:39 UTC · original
Heads-up for the reviewer and @gefydev: #67 solves the same problem (wave64 programs on 32-lane GPUs) another way, and it conflicts with this PR and with #71 / #72. The difference: #67 also runs programs whose halves must exchange values (through groupshared), which this PR still refuses.
I ran both on the same RTX 5070 Ti, merged onto current
main; the table and details are in https://github.com/ivall/xcl/pull/67#issuecomment-7090105968. Short version: both pass the whole suite and #78's end-to-end compute test. On NVIDIA, #70 + #72 still skip 18 GPU tests, #67 skips 2. #72's f64 fix applies on top of #67 as well (one line in its test), so it's worth keeping either way.@ivall on GitHub · 2026-11-23 09:59 UTC · original
Thanks – closing this as superseded by #67 (merged), which runs wave64 compute (and mesh / ES+GS) as two wave32 halves that exchange masks and lane values through groupshared, so programs with cross-half semantics run too instead of being refused. Your
lane_id = WaveGetLaneIndex() + 32 * xcl_half/ exec-bit case is covered there by its split tests. Also verified on AMD withXCL_SPLIT_WAVE64=1.Pull request closed