GPU: refuse wave64 mesh and compute programs on hosts without 64-lane waves (rebase of #578) #1920
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1922"
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?
Imported from Marvisak/VIctory. Originally posted by slatefield on 2026-11-25T01:01:50Z.
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.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:10:21Z.
Review: COMMENTED
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.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T05:44:58Z.
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
24a7bc2,cargo test -p victory-gpu --locked: 142 passed, 2 failed, 2 ignored. The PR's three tests pass on this 32-lane host:emitted_wave_size_checked_against_host_range,wave_lanes_refusal_reports_emitted_and_host_rangesanddxil_wave_lanes_reads_psv0_bounds. The 2 failures are #1744's heap-cap failures onmain. Same asmainon this hardware. Not checked: the driver'sE_INVALIDARGcount in a title run.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:19:58Z.
Automated triage for the maintainers.
Proposed close.
Reason: this PR re-packages another contributor's open PR. It is #578 (wbkepler, still open, labelled
triage: needs rebase) rebased: the same five commits by the same author, conflicts resolved. Two open PRs for one change split the review. The rebase belongs on #578: its author can take it over, or a maintainer can choose this branch as #578's replacement.Thanks for doing the rebase work. For whoever picks it up, there's one point on the substance that #578 should settle. On
main,Lower(emit/lower.rs, the computewave_sizechoice) already declaresWaveSize(64)for wave64 compute whose results depend on console lanes, or that is a single wave using LDS. Every other wave64 compute program is deliberately emitted per lane with no wave size.wave_lanes_unsupportedrefuses all of those unsized wave64 compute programs whenever the host's max is below 64, which on NVIDIA means every one of them. That drops their dispatches wholesale on the most common host. The evidence for it is TDR reports, not a program identified as needing 64 lanes. Narrowing it to the programs that actually hang, or fixing the translation, would be the stronger change.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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.