translate --pipelines: driver reasons for refusals, and --only <stages> (#2537) #2560
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T15:51:42Z.
What
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
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:40:17Z.
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
Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T22:54:00Z.
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. https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7176909182 (AI-assisted)Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T23:57:12Z.
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.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T00:23:58Z.
@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.
Imported from Marvisak/VIctory. Originally posted by reboot0000-cmd on 2026-11-26T11:27:07Z.
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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T17:05:13Z.
Review: APPROVED
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.Imported from Marvisak/VIctory. Originally posted by Victorzinn704 on 2026-11-26T18:08:40Z.
Review: COMMENTED
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.
Imported from Marvisak/VIctory. Originally posted by Victorzinn704 on 2026-11-26T18:08:40Z.
Code review location:
crates/victory-shader/src/emit/host.rs; line 276Host::madecan go straight to the create call whendiagnosticsis absent. This avoids attemptingQueryInterfaceforID3D12InfoQueueon every creation in the ordinary build.Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T18:45:45Z.
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).
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T21:11:32Z.
@oni-swr, I followed up on @reboot0000-cmd's Windows 10 test report. Combined 376ea39 contains this PR at
ff70049, the device preflight diagnostics from #3788, and a targeted follow-up for the warning and integration tests.On Windows 10, the two debug-on tests previously printed the same skip line in both environments. The stock WARP run now identifies Shader Model 6.2 and the 6.6 requirement. With signed app-local WARP 1.0.22 and Agility 1.620.2, WARP initialized and the tests identified the unavailable debug layer. The debug-off test ran and passed with the app-local runtime. The two debug-on pipeline assertions were skipped on this host, including when the matching layer DLL was present. The updated warning also describes where the matching app-local DLL belongs. Microsoft's Agility SDK setup
The Shader Model status test, diagnostics CLI tests, both strict Clippy runs and the asset policy passed. The next verification is the debug-on pair on a machine where the layer loads, such as the reporter's Graphics Tools setup. Please retain the Git authors on cherry-pick or rebase, or include Co-authored-by: andrewpozdnakov7-jpg [email protected] if folding the changes into another commit.
AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-28T21:35:52Z.
Thank you @andrewpozdnakov7-jpg for the follow-up and @reboot0000-cmd for the Windows 10 report.
Folded in as
27e4700, cherry-picked from376ea39with your authorship kept: the debug-layer warning now also says where a local Agility SDK's matchingD3D12SDKLayers.dllgoes, andtests/debug_layer.rsnow tells "WARP did not initialize" apart from "layer unavailable" when it skips. The device preflight diagnostics from #3788 were left out and stay with that PR.Checked on software WARP only (
VICTORY_WARP=1,VICTORY_D3D12_WARP=1, dxil.dll validator, no physical GPU),--features host,diagnostics:debug_layer: 2 passed;debug_layer_off: 1 passed;resource_tracking: 3 passed (1 ignored). No skip line was printed here, so the layer loaded on this machine.a_mask_joined_with_data_at_a_uniform_loop_is_its_number,gathers_at_a_level_match_the_hardware,permutes_mask_high_address_bits_and_divergent_branches,permutes_read_the_lane_named_and_zero_from_lanes_left_out). The same 4 fail onff70049without this change, so they are WARP behaviour, not the follow-up. The PR body listed 3; the fourth is new to me on this build.cargo clippy --workspace --all-targetswith and without--all-features,-D warnings: clean. Asset policy (repository_passes_policy): passed.Still open: the debug-on pair on the reporter's Windows 10 setup, where the layer loads but the test binary only gets the in-box runtime; the Windows 10 failure of
debug_layer_offfrom the report is not addressed here.AI disclosure: 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.