GPU: Pre-check wave lane constraints for compute pipelines (fixes #817) #2194
No reviewers
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!2194
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2194"
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-25 07:21 UTC · original
Xvania7:feat/issue-817-wave-lane-check→main· +205 −4 · 5 files · 3 commits · openFixes #817 (supersedes tracking issue #893; related to #468).
Summary
Note: Opened as a PR per maintainer triage (#893); happy to coordinate with #1922 / #2157 if maintainers prefer one consolidated PR.
@Dathinel on GitHub · 2026-11-25 07:47 UTC · original · edited 2026-11-25 07:52 UTC
For the consolidation question: I combined #1922 (
24a7bc2, runtime) and #2157 (9771cae, offline CLI) on Windows. The merge includes main940d32fand needs no manual resolution (tree884f866b). Seven targeted tests passed: three GPU runtime checks, two shader diagnostic checks, and two CLI checks, including the WARP pipeline test that distinguishes root-signature errors from wave-size refusals.One behavior worth preserving when deciding between implementations: #1922 explicitly tests the unsized console-wave64 fallback on a host with fewer than 64 lanes. Testing the fixed wave size alone would miss that distinction.
Update for
754fe02: the rebase resolved the four conflicts againstmain@940d32f. I compared both parsers and pre-check functions using the same synthetic PSV0 metadata (guest Wave64 compute, simulated 32-lane-only host). Both rejected fixed 64 and allowed fixed 32. The current PSV0 writer emits either a fixed size or the unrestricted pair (0, UINT32_MAX). For the unrestricted pair with a Wave64 guest on this host, #1922 rejected early and #2194 deferred to pipeline creation. A separate synthetic 64–128 interval also distinguished the parsers, but that interval does not come from this writer. These are pre-check results; driver behavior was not measured.AI-assisted; synthetic tests only.
@Xvania7 on GitHub · 2026-11-25 07:56 UTC · original
Thanks for the comparison data, @Dathinel.
Two quick updates on the branch state:
9d4b8d7were before the rebase ontomain(940d32f). Current head754fe02is cleanly rebased onto940d32fwithmergeable_state = cleanand green CI, and@MichaelSmithAIalso verified754fe02on an RTX 4090 under Wine (wave32 pipeline created, wave64 returned the expected host-width diagnostic).HostShader::required_wave_size(), we only extract a fixed constraint (min != 0 && min == maxfromPSV0), so an unsized shader returnsNoneand is allowed throughunsupported_compute_wave(None, ...). Agreed that#1922's explicit test for the unsized console-wave64 fallback on hosts with< 64lanes is a useful distinction to preserve regardless of which PR pair lands.@giacbiologicbomb on GitHub · 2026-11-25 11:03 UTC · original
Test data from an RTX 5070 (12 GB, NVIDIA,
WaveLaneCountMax = 32), Windows, 16 GB RAM, on the vitutu1/victory-perf fork at97c3aa2(based on fxceless/victory-fork). Profile:--console series-s,VICTORY_RENDER_SCALE=0.5,VICTORY_OWN_UPSCALER=1,VICTORY_AMBIENT_STUB=1,VICTORY_SHADOWMASK_STUB=1,VICTORY_RELAY=2,VICTORY_LATE_WAIT=3,VICTORY_WIDE_BACK=1,VICTORY_REBAR=0,VICTORY_CARD_BUFFERS_MB=2048.Four compute pipelines are refused in-game with
E_INVALIDARG (0x80070057):Analysed offline, without running the game: the translated DXIL for all four still carries
WaveSize = 64(dxc -dumpbin), which is incompatible with the reported maximum wave size; this is the leading explanation for the refusal. The split / local-wave retries all fall back to wave 64. The main reason given is LDS in a group over 32, with an LDS read and write inside one lane-branch region; three of the four also usev_mbcnt/v_readlane/ a lane mask read as data.I ported this PR's check onto that fork (local commit only). It builds in release mode and the targeted tests pass. The four pipelines are now refused before creation with that reason named, instead of the opaque
0x80070057. They still don't run: that needs split-wave lowering for LDS shared across more than 32 lanes.The same class of refusals was observed on fxceless
a26859fand skornuta/victory-fork9292987.VICTORY_SHADER_LOOP_LIMIT=32didn't change that.Analysis done with Claude Opus 5.5 (claude-opus-5-5) agents; the in-game logs come from real runs.
@Xvania7 on GitHub · 2026-11-25 11:40 UTC · original
Thanks for the detailed test data and hardware verification on RTX 5070 @giacbiologic! This confirms the exact intent of #2194: catching the wave size mismatch cleanly before pipeline creation so we don't nuke the D3D12 device with an opaque
0x80070057, while diagnosing precisely why the fallback to wave 64 occurred (LDS across >32 lanes with branch regions / lane mask ops). Those 4 pipelines (␀2384a60fda6f2d0, 369cbe906ea72764, 2cc4c197ee29e291, 2da4beb386509b77) are great concrete test targets for subsequent split-wave LDS lowering work.@Marvisak on GitHub · 2026-11-25 12:41 UTC · original · edited 2026-11-25 22:20 UTC
Automated triage for the maintainers.
Needs rebase. This PR no longer merges cleanly into
main:mainhas moved since the last triage, and the branch now conflicts incrates/victory-gpu/src/host.rsandcrates/victory-shader/src/emit/host.rs. It will be reviewed again once it is rebased onto currentmain.Previous verdict for this head: merge candidate.
Generated by Claude Code
@DrDarkDK on GitHub · 2026-11-25 13:34 UTC · original
Following up on the unsized-shader point in the triage summary, I ran a standalone native D3D12 probe on an RTX 4070 Ti with driver 621.01 and Windows build 26300.9974. D3D12 reported a wave lane range of 32–32.
I compiled the same lane-independent
cs_6_6shader with noWaveSizeattribute, withWaveSize(32), and withWaveSize(64). With the same root signature, the unsized and fixed-wave32 variants both created a compute pipeline. Fixed wave64 returnedE_INVALIDARG, andGetDeviceRemovedReason()returnedS_OKafterward. Both runs produced the same results.This supports letting unsized shaders reach pipeline creation. The probe used synthetic DXC shaders and covered pipeline creation only.
AI-assisted with Codex.
@Xvania7 on GitHub · 2026-11-25 13:43 UTC · original
@DrDarkDK Thanks for the native D3D12 probe on the RTX 4070 Ti (32-32 wave range).
That confirms the driver behavior: unsized shaders cleanly default to the native wave lane width (32) and succeed, whereas fixed wave64 fails with
E_INVALIDARGwithout taking down the device. This aligns with keeping unsized shaders eligible for pipeline creation while refusing explicit 64-lane constraints on 32-lane hardware.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.