[Ready to merge] Pre-check wave lane constraints for compute pipelines #893
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#893
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Xvania7 on GitHub · 2026-11-24 13:37 UTC · original
GPU: Pre-check wave lane constraints for compute pipelines
Fixes #817 (related to #468 / PRs #233, #189, #578).
Problem
Titles emitting 64-lane compute shaders cause pipeline creation to fail on host GPUs that only support up to 32 lanes (e.g. NVIDIA or Intel hardware reporting
WaveLaneCountMax = 32). While logging the error insideCreateComputePipelineStatefailure paths (as explored in diagnostic branches) surfaces the issue, passing an incompatible bytecode directly to the D3D12 runtime triggers driver error queue noise and debug layer breaks.Solution
Instead of failing late inside the driver, this PR adds an upfront capability check:
Device Capability Query (
crates/victory-gpu/src/device.rs,host.rs):D3D12_FEATURE_DATA_D3D12_OPTIONS1at device creation viaCheckFeatureSupport.wave_lanes: Option<(u32, u32)>(WaveLaneCountMin,WaveLaneCountMax).Wave Size Extraction from DXIL (
crates/victory-shader/src/emit/mod.rs):HostShader::required_wave_size(&self) -> Option<u32>.PSV0runtime info part (bytes 20..28) to read the declared wave size constraint (WaveSize).Compute Pipeline Pre-check (
crates/victory-gpu/src/pipeline/host.rs):HostPipeline::create(), if the compute shader specifiesrequired_wave > max_wave_lanes, we emit an informativetracing::warn!and skip host pipeline creation cleanly (return None) without invokingCreateComputePipelineState.Verification
required_wave_size_reads_the_emitted_constraintcovering unconstrained, Wave32, and Wave64 shaders invictory-shader.query_wave_lane_limits_reports_capabilitiesinvictory-gpu.cargo test -p victory-gpu(51 passed, 0 failed).cargo clippy --all-targets -- -D warningsandcargo xtask policypass cleanly.Branch:
feat/issue-817-wave-lane-check(commit1318357).@MichaelSmithAI on GitHub · 2026-11-24 13:43 UTC · original
On the RTX 4090 under Wine/vkd3d-proton 3.2, the runtime reported a wave range of 32..32. Through the ordinary runtime host pipeline constructor on 1318357, a DXC shader declaring Wave32 created a pipeline and the otherwise identical Wave64 shader was declined. An instrumented run confirmed the Wave64 return after root-signature creation and before the compute PSO call. The result repeated with the original production code. This was a pipeline-creation check.
The offline CLI uses a different host helper. We submitted a follow-up on your branch for that path, with the same width-specific outcome and separate stage labels for root-signature and PSO failures. The two synthetic widths passed their offline checks; individual #885 corpus failures have yet to be classified.
@fuzeofficlal on GitHub · 2026-11-24 13:53 UTC · original
The upper-bound test above covers Wave64 on a
32..=32device. I checked the other end on1318357with a CPU-only capability fixture. For[WaveSize(32)]and a reported range of64..=64, the existing max-only check still proceeds toward PSO creation. D3D12 validates a fixed wave size against the full reported range. Shader Model 6.6 runtime validationFollow-up commit checks the inclusive range and reports both limits in the existing warning. The tests cover both out-of-range directions, accepted boundaries, and the path for an absent constraint or unavailable caps.
victory-gpu --libpassed 53 tests with one benchmark ignored. Clippy and the staged asset check passed.@Xvania7 on GitHub · 2026-11-24 14:49 UTC · original
Thanks @fuzeofficlal and @MichaelSmithAI!
I have updated
feat/issue-817-wave-lane-check:!(min..=max).contains(&req)) viaunsupported_compute_wavewith unit tests covering lower and upper bounds.cargo test -p victory-gpuandvictory-shader), Clippy, andcargo xtask policypass cleanly.@Marvisak on GitHub · 2026-11-25 06:53 UTC · original
Automated triage for the maintainers.
maindoes not check a compute program's declared wave size against the host's wave range beforeCreateComputePipelineState; a 32-lane host refuses aWaveSize(64)pipeline with0x80070057(discussed in #71). Pull requests are open to everyone again, so please open one fromfeat/issue-817-wave-lane-check. Overlapping open pull requests: #1922 (rebase of #578, refuses wave64 mesh and compute programs on hosts without 64-lane waves) does the same check, and #2157 distinguishes root-signature and wave-lane failures intranslate --pipelines; comparing with those first would avoid a duplicate. Note that a refusal only quiets the error; the programs still need a wave64-on-32 lowering (#233/#1929, #1890) to run.Generated by Claude Code