Repository navigation
Conversation
…s> (Marvisak#2537) VICTORY_D3D12_DEBUG now reaches the device `emit::host::Host` creates (in a diagnostics build, before the first device of the process), and a refused root signature or pipeline carries the debug layer's messages instead of a bare error code. Hosts of one adapter share one device and one ID3D12InfoQueue, so with the layer on, creation and the read of its messages are one at a time (shader translation stays parallel); without it nothing is serialized. `translate --pipelines --only vs,ps,cs,ms` makes pipelines for the listed stages only; every stage is still emitted and validated. Tests: synthetic refusals on WARP (a non-shader), also from 8 hosts at once; the same refusal without the layer; the stage filter. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. Merge candidate (recommending a look, not an approval). Thanks for the rebase and the follow-up. In Minor: in the game process with the layer on, Generated by Claude Code |
…-2562 # Conflicts: # apps/victory/src/main.rs # crates/victory-shader/src/emit/host.rs
|
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 |
|
Merged upstream The earlier Local checks passed on the updated head:
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. |
|
@KainanP Thanks for flagging this. 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 AI disclosure: Codex (gpt-6.2-sol) implemented and verified this follow-up. |
|
Verified on the host this exists for: every refusal now names the driver's reason — 396 of 396. Windows 10 IoT Enterprise LTSC 2021 (
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 Two things to flag about the tests, both about Windows 10 rather than the change.
This machine has the layer ( 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 One setup note that cost me a wasted run: in our measurement the layer only became reachable once Counts and driver text only; no game files. |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed ad66ddf5fc1d5b86d1c9b5f5238ed117be588464 (merged cleanly onto 63bcca43 and verified clean co-merge with #1767) on Windows 11 with Graphics Tools debug layer active.
Enabling VICTORY_D3D12_DEBUG once 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 in translate --pipelines all 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.- With Windows Graphics Tools active:
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
left a comment
There was a problem hiding this comment.
Independent run with Windows Graphics Tools installed. With the shader-crate changes from ad66ddf5fc1 applied to main 63bcca43c6a0, 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 with host and with host,diagnostics.
AI-assisted. These were local runs with synthetic shaders.
| /// 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 { |
There was a problem hiding this comment.
Host::made can go straight to the create call when diagnostics is absent. This avoids attempting QueryInterface for ID3D12InfoQueue on every creation in the ordinary build.
| let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else { | |
| if !cfg!(feature = "diagnostics") { | |
| return make().map_err(err); | |
| } | |
| let Ok(queue) = self.device.cast::<ID3D12InfoQueue>() else { |
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