Repository navigation
GPU: refuse wave64 mesh and compute programs on hosts without 64-lane waves (rebase of #578) - #1922
slatefield wants to merge 5 commits into
Conversation
… waves A console mesh or compute program written for 64-lane waves reads lanes and wave-wide masks as the 64-lane wave has them. Run as 32-lane waves (NVIDIA's D3D12 range is 32..32) such programs hang the GPU in the world: the device is removed as hung after a 2 s timeout, at a dispatch of one of them, every run. Their pipelines are now refused there, so their draws and dispatches are dropped instead of hanging the host. Vertex and pixel programs run per lane and are kept; hosts with 64-lane waves are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Console wave64 compute programs whose emitted DXIL declares no PSV0 wave-lane range (or an upper bound wider than the host) can still rely on 64-lane wave semantics and hang 32-lane hosts. On hosts with max wave lanes < 64, refuse console wave64 compute programs unless the emitted DXIL PSV0 explicitly bounds the wave size within the host's supported range (max_lanes <= host_max), preserving Wave32-split compute translations (PSV0 WaveSize(32)) and 64-lane hosts while refusing unconstrained wave64 compute like wave64 mesh.
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Refuse wave64 mesh/compute programs on hosts that can't: capability refusal instead of miscompile — good hardening.
|
A Windows GPU run, as the description asks. Ran on Windows 11 with an RTX 3070 (Ampere, 32-lane waves, driver 616.56), debug build, at AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Proposed close. Reason: this PR re-packages another contributor's open PR. It is #578 (wbkepler, still open, labelled Thanks for doing the rebase work. For whoever picks it up, there's one point on the substance that #578 should settle. On CI: no check runs on this head. The PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. Generated by Claude Code |
…hosts without 64-lane waves (rebase of Marvisak#578)
Rebase of #578 onto current
main(4118f33). The original work is wbkepler's, all five commits are kept with their author and message unchanged; only conflict resolution sits inside them, so the history is the same change, brought up to date. If #578 updates first, take that one instead.Why it is worth merging now: on hosts whose waves are narrower than 64 (every NVIDIA D3D12 GPU reports WaveLaneCountMin = Max = 32), console wave64 mesh and unsized wave64 compute programs currently reach a pipeline and hang the GPU, which ends the run with
DXGI_ERROR_DEVICE_HUNG. This checks the emitted DXILPSV0wave range against the host'sD3D12_OPTIONS1range inHostPipeline::newand refuses the programs that cannot run, so their draws and dispatches are dropped with a named reason instead of taking the device down. It also allows wave64 compute that was deliberately lowered toWaveSize(32)(the #233 class) to run on a 32-lane host.What was done for the rebase: nothing of the PR is in
mainyet (wave_lanes,WaveLaneCount, the PSV0 bounds: none of them appear), so the whole 300 added lines were ported. Seven conflict hunks over three files, all because main grew around the PR:host.rskeepsheap_atomics64()and takes the wave-lane query beside it;pipeline.rsbuilds thewave64cache inside main's newerShader::new/translatedshape;pipeline/host.rsmerges main's own test module with the PR's three tests into one module. The one line not carried verbatim is a test-moduleusethatuse super::*;makes redundant.Checked here: Windows-target clippy
--all-targetswith and without--all-features, clean forvictory-gpuand forvictorywith diagnostics; native tests for the crates that build on Linux all pass (shader 144, formats 38, game 15, core 13, pipeline 7);cargo xtask policy182 files ok. The PR's three tests needvictory-gpuon Windows; I also ran their bodies against the realvictory-shaderparser through an off-tree harness and they pass.Not checked, needs a Windows GPU: the three tests executing, the refusal wording on a 32-lane host, zero driver
E_INVALIDARGwave-lane errors, and a world run that survives wheremainloses the device. The PR's tester notes (in #578) say reference runs from 393 s to 17.5 minutes with one 5060 Ti counter-example removed by an unrelated wave32 submission.Companion changes: #233 (the other worker on this team) is being rebased in parallel; the PSV0 rule here is what lets its lowered
WaveSize(32)compute run. #32 (queueWaitis a no-op onmaintoday) is worth landing near this one, since async submissions assume cross-queue ordering that the synchronous wait currently hides.