translate --pipelines: driver reasons for refusals, and --only <stages> (#2537) #2562
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!2562
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2562"
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?
@oni-swr on GitHub · 2026-11-25 15:51 UTC · original
oni-swr:t3/victory-2537-d3d12-debug-pipelines→main· +284 −14 · 6 files · 4 commits · openWhat
Fixes #2537.
VICTORY_D3D12_DEBUGnow reaches the devicetranslate --pipelinescreates (emit::host::Host::new), in a diagnostics build and before the first device of the process (so also before the census's initial probe). A refused root signature or pipeline then reads<error>; debug layer: id N: <message>; ...instead of a bare error code. Gating matchesvictory-gpu(diagnosticsfeature,0is off).ID3D12InfoQueue(see the note on the issue), so with the layer on, creation and the read of its messages run one at a time under a process-wide lock; shader translation stays parallel. Without the layer nothing is serialized.translate --pipelines --only vs,ps,cs,msmakes pipelines for the listed stages only; every stage is still emitted and validated. It requires--pipelinesand conflicts with--cache. Documented in the README usage and theVICTORY_D3D12_DEBUGrow.Orthogonal to #2456 (adapter selection): no adapter logic touched. Expect a trivial textual overlap in
emit/host.rsHost::newand the README usage lines.Tests (software adapter only, no GPU, no title data)
tests/debug_layer.rs(own process, layer on): a non-shader refused on WARP names the layer's reason; 8 hosts on the same device refusing concurrently each keep their message (fails without the lock — checked).tests/debug_layer_off.rs: same refusal without the layer is the bare error.cargo test -p victory,-p xtask repository_passes_policy,cargo clippy -p victory-shader -p victory --all-targetsclean.cargo test -p victory-shader --features host,diagnosticson WARP: 3 hardware-behavior tests fail (a_mask_joined_with_data_at_a_uniform_loop_is_its_number,gathers_at_a_level_match_the_hardware,permutes_read_the_lane_named_and_zero_from_lanes_left_out), identically on unmodifiedmain.Not measured: census performance with the layer on.
AI disclosure: written by Claude Code (Claude Sonnet 5.5).
🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 18:40 UTC · original · edited 2026-11-26 02:18 UTC
Automated triage for the maintainers.
Merge candidate (recommending a look, not an approval). Thanks for the rebase and the follow-up. In
crates/victory-shader/src/emit/host.rs,create_devicenow enables the debug layer once per process (enable_debug_layer, diagnostics builds,VICTORY_D3D12_DEBUGnot0) and warns once if it is unavailable;Host::madewraps root-signature and pipeline creation so that, when the device has anID3D12InfoQueue, creation is serialised underCREATIONand a refusal carries the layer's messages. Without the layer the cast fails and nothing is serialised.translate --pipelines --only vs,ps,cs,ms(apps/victory/src/translate.rs,wanted) limits pipeline creation by stage, and clap enforcesrequires = "pipelines"/conflicts_with = "cache". I checked thatvictory-gpuonly reaches this module throughHost::from_device(no secondEnableDebugLayerin the game process). It merges cleanly and CIcheckis passing.Minor: in the game process with the layer on,
fuses_fmadgoes throughmadeonce at start-up and clears the device's stored messages at that point. Overlaps #2560 (same issue #2537), which currently conflicts withmain.Generated by Claude Code
@KainanP on GitHub · 2026-11-25 22:54 UTC · original
Compared with #2560 on an RTX 4060 and WARP. This machine has no debug layer, so the reasons themselves are unverified. There are no regressions with the switch on or off (also
0ec4c483onf3578e38). Recommended, with one ask: warn when the layer is missing. #2537 (AI-assisted)@oni-swr on GitHub · 2026-11-25 23:57 UTC · original
Merged upstream
main(f3578e3) into the existing fork branch and pushed0ec4c48as a fast-forward. GitHub reports this head mergeable and up to date withmain.The earlier
EnableDebugLayersuggestion is addressed. A process-wideOncenow guards setup before the shader host creates its first device. The merge preserves upstream's shared WARP device and locking, and root-signature and pipeline refusals still capture debug-layer messages.Local checks passed on the updated head:
dxil.dll.victorytests, repository asset-policy test, and workspace Clippy with default and all features.AI disclosure: Claude Code (Claude Sonnet 5.5) authored the original PR. Claude Code (Claude Opus 5.5) resolved the merge and implemented the one-time initialization. Codex (gpt-6.2-sol) verified the update, ran the final checks, and pushed it.
@oni-swr on GitHub · 2026-11-26 00:23 UTC · original
@KainanP Thanks for flagging this.
ad66ddfnow warns once per process ifVICTORY_D3D12_DEBUGrequests the layer and it is unavailable. The warning points to Graphics Tools in Windows Optional Features. Pipeline checks continue without debug-layer messages.On WARP, the existing debug-layer tests passed with the layer available and with it disabled. I temporarily simulated an unavailable layer and verified that concurrent pipeline creation and draws still completed, with one warning when requested and zero with
VICTORY_D3D12_DEBUG=0. Synthetic DXIL validation with the Windows SDKdxil.dll, the repository asset-policy test, and shader-library Clippy also passed.AI disclosure: Codex (gpt-6.2-sol) implemented and verified this follow-up.
@reboot0000-cmd on GitHub · 2026-11-26 11:27 UTC · original
Verified on the host this exists for: every refusal now names the driver's reason — 396 of 396.
Windows 10 IoT Enterprise LTSC 2021 (
19044.7846) with Graphics Tools installed, RTX 4090 (WaveLaneCount32..32), validator DXC1.8.2502.8,--features diagnostics,VICTORY_D3D12_DEBUG=1,translate --validate --pipelines --list --only csover the whole archive (26,503 containers, 26,084 programs). The two comparisons above could not observe this because those machines have no debug layer; this one does.One program is recorded twice (two containers, same program), which is why 397 lines describe 396 programs. Every one of them is the same message id:
That is the whole of #2220's complaint resolved at source: the bare
E_INVALIDARGthese runs used to emit now arrives with the sentence that explains it, and the offset set is identical to the layer-less census I ran on this machine this afternoon — so nothing was refused that wasn't before, and nothing was missed. The PR does what our issue asked, on the host class that motivated it.Two things to flag about the tests, both about Windows 10 rather than the change.
cargo test -p victory-shader --features diagnostics --test debug_layerreportsok. 0 passed— silently, because the file is gated onall(windows, feature = "host", feature = "diagnostics")and one of the two was missing. It reads as a pass. With--features host,diagnostics:This machine has the layer (
System32\d3D12SDKLayers.dllpresent), so the skip message points at the wrong cause. What actually happens is earlier:Host::newneeds a shader-model 6.6 device, and on Windows 10 a test binary runs on the in-box runtime — the app-local Agility opt-in from #463 lives in thevictoryexecutable, not incargo testoutputs — so the device creation fails at 6.2 andhost()returnsNone. The negative-control test has no skip path and fails outright for the same reason.Concretely, if useful:
Cost, so nobody is surprised: the layer is not free. This compute-only run took 47 minutes; the same archive with all stages and no layer took 26 on this host, so the scopes differ and it isn't a clean ratio, but the direction is clear — and the machine was only about three logical cores busy for most of it, so the extra time is waiting on the single process-wide
ID3D12InfoQueue, not translating. That's inherent to draining one queue from eight workers, and it's what your second test exists to keep correct. Worth one sentence in the docs: expect a census with the layer to run several times slower and near-serial, and run it with--only cswhen refusals are the question.One setup note that cost me a wasted run: in our measurement the layer only became reachable once
D3D12SDKLayers.dllwas staged next to the app-local runtime. With onlyD3D12\D3D12Core.dllpresent, the new code printedVICTORY_D3D12_DEBUG requested the D3D12 debug layer, but it is unavailable. Install Graphics Tools…on a machine that has it; the same binary withD3D12\D3D12SDKLayers.dllalongsideD3D12Core.dllprinted no warning and produced the 396 messages above. Whether the System32 copy is consulted at all when the Agility runtime is loaded, I did not test — but if the warning also mentioned stagingD3D12SDKLayers.dllbesideD3D12Core.dllit would have saved me an hour.Counts and driver text only; no game files.
@fuzeofficlal on GitHub · 2026-11-26 17:05 UTC · original · approved these changes
Reviewed
ad66ddf5fc1d5b86d1c9b5f5238ed117be588464(merged cleanly onto63bcca43and verified clean co-merge with#1767) on Windows 11 with Graphics Tools debug layer active.Enabling
VICTORY_D3D12_DEBUGonce per process before device creation, warning once when Graphics Tools are absent, wiring--only <stages>cleanly through Clap (requires = "pipelines",conflicts_with = "cache"), and reporting debug-layer refusal reasons directly intranslate --pipelinesall work cleanly.Non-blocking follow-up notes:
drain_messages(crates/victory-shader/src/emit/host.rs:108-132) iteratesGetNumStoredMessages()while indexingGetMessage(which uses the retrieval-filtered count); switching the loop bound toGetNumStoredMessagesAllowedByRetrievalFilter()matches the API contract.Host::madeclears the device-wideID3D12InfoQueueeven onHost::from_device(caller-owned devices) and on successful creations; scoping queue clearing to census-owned hosts preserves external diagnostics.VICTORY_PAIRScurrently still builds paired graphics/mesh pipelines under--only cs(worth documenting in--help/ README or gating onwanted), anddebug_layer.rs's concurrent WARP test currently runs serialized byWARP_LOCKwith identical refusal messages.Verification
xtask policy(192 files ok),cargo clippy(default &--all-features) clean.debug_layer2/2 passed (unskipped),debug_layer_off1/1 passed (bothhostandhost,diagnostics),victory translate::tests3/3 passed (4/4 co-merged with#1767), and invalid CLI flag combinations (--only cswithout--pipelines,--only bogus,--only cs --cache) rejected as expected.@Victorzinn704 on GitHub · 2026-11-26 18:08 UTC · original · reviewed
Independent run with Windows Graphics Tools installed. With the shader-crate changes from
ad66ddf5fc1applied to main63bcca43c6a0, both WARP debug-layer tests ran and passed, including the shared-device test. The debug-off test passed as well. On an RTX 5060 Ti (616.92), the rejected compute-shader case reported D3D12 message 322 (CREATECOMPUTESHADER_INVALIDSHADERBYTECODE), with the encoded-size mismatch in the text.I also tested the inline feature guard below. The ordinary build avoids a COM interface query for each creation through
Host::made. The debug-on and debug-off tests passed with the guard applied. Clippy passed withhostand withhost,diagnostics.AI-assisted. These were local runs with synthetic shaders.
@ -199,0 +273,4 @@/// the layer they run in parallel. Callers take [`WARP_LOCK`] (if at all)/// before this, never after.fn made<T>(&self, make: impl FnOnce() -> windows::core::Result<T>) -> Result<T, String> {let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else {@Victorzinn704 on GitHub · 2026-11-26 18:08 UTC · original
Host::madecan go straight to the create call whendiagnosticsis absent. This avoids attemptingQueryInterfaceforID3D12InfoQueueon every creation in the ordinary build.@oni-swr on GitHub · 2026-11-26 18:45 UTC · original
Thanks @Victorzinn704, applied in
ff70049:Host::madenow returns straight tomake()when thediagnosticsfeature is off, before theID3D12InfoQueueQueryInterface. This matches thecfg!half ofdebug_requested(), and the existing doc comment is still accurate.Verified on WARP (
VICTORY_D3D12_WARP=1,dxil.dllonPATH, no physical GPU):debug_layer,debug_layer_off,resource_trackingand the libhosttests pass with--features hostand--features host,diagnostics, each withVICTORY_D3D12_DEBUGunset and=1.cargo clippy -p victory-shader --all-targets -- -D warningsis clean withhostand withhost,diagnostics.cargo run -p xtask -- policypasses.AI disclosure: this change was made by Claude Code (Claude Sonnet 5.5).
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.