translate --pipelines: VICTORY_D3D12_DEBUG never reaches the device it creates, so pipeline refusals carry no driver reason #2537

Open
opened 2026-11-26 05:08:32 +00:00 by github-bot · 5 comments
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-25 15:27 UTC · original

VICTORY_D3D12_DEBUG configures a device that translate --pipelines does not use, so pipeline refusals are reported as bare error codes.

crates/victory-gpu/src/host.rs gates the debug layer and the ID3D12InfoQueue on cfg!(feature = "diagnostics") && switch::on("VICTORY_D3D12_DEBUG") (host.rs:144, and the info-queue capture at :195). The translate command creates its own device in crates/victory-shader/src/emit/host.rs, which has no equivalent wiring — so the census path, the one place pipeline refusals are enumerated per program, never enables the layer and never drains the queue.

Measured on Windows 10 IoT Enterprise LTSC 2021 19044.7846, RTX 4090, main 940d32f6 + #463's Agility opt-in: a whole-archive translate --validate --pipelines --list over the title's shader archive (26,084 programs) produced 394 compute pipeline refusals reading only pipeline: The parameter is incorrect. — no command name, no driver reason. With the layer enabled on the emit/host device and its info queue drained after each creation, the same 394 refusals each reported exactly one message: id 622 ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32. That single line is the difference between "394 unexplained E_INVALIDARGs" and a fully explained class.

Two asks, both small:

  1. Wire the debug layer and info-queue drain into the device that emit/host.rs creates, so --pipelines refusals carry driver reasons. Today the documented diagnostic switch silently does nothing on this path, which reads as "the driver gave no reason".
  2. Consider an upstream equivalent of what I used locally to make this affordable: the layer slows graphics pipeline creation by roughly two orders of magnitude (a full census projected ~7 h), so I added VICTORY_ONLY_CS — emit and validate every stage, create compute pipelines only — which covers the compute population in ~30 minutes. A stage filter for the census would help anyone chasing driver-side refusals.
**@⁠reboot0000-cmd** on GitHub · 2026-11-25 15:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537) `VICTORY_D3D12_DEBUG` configures a device that `translate --pipelines` does not use, so pipeline refusals are reported as bare error codes. `crates/victory-gpu/src/host.rs` gates the debug layer and the `ID3D12InfoQueue` on `cfg!(feature = "diagnostics") && switch::on("VICTORY_D3D12_DEBUG")` (host.rs:144, and the info-queue capture at :195). The `translate` command creates its own device in `crates/victory-shader/src/emit/host.rs`, which has no equivalent wiring — so the census path, the one place pipeline refusals are enumerated per program, never enables the layer and never drains the queue. Measured on Windows 10 IoT Enterprise LTSC 2021 19044.7846, RTX 4090, main `940d32f6` + #463's Agility opt-in: a whole-archive `translate --validate --pipelines --list` over the title's shader archive (26,084 programs) produced **394 compute pipeline refusals reading only `pipeline: The parameter is incorrect.`** — no command name, no driver reason. With the layer enabled on the emit/host device and its info queue drained after each creation, the same 394 refusals each reported exactly one message: id 622 `ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32.` That single line is the difference between "394 unexplained E_INVALIDARGs" and a fully explained class. Two asks, both small: 1. Wire the debug layer and info-queue drain into the device that `emit/host.rs` creates, so `--pipelines` refusals carry driver reasons. Today the documented diagnostic switch silently does nothing on this path, which reads as "the driver gave no reason". 2. Consider an upstream equivalent of what I used locally to make this affordable: the layer slows graphics pipeline creation by roughly two orders of magnitude (a full census projected ~7 h), so I added `VICTORY_ONLY_CS` — emit and validate every stage, create compute pipelines only — which covers the compute population in ~30 minutes. A stage filter for the census would help anyone chasing driver-side refusals.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:08:33 +00:00
Author
Owner

@⁠Ingenioeren on GitHub · 2026-11-25 15:38 UTC · original

One detail for per-pipeline messages: the census creates a Host in each worker, but those hosts can share a D3D12 device and its InfoQueue. A worker that clears the queue can discard another worker's message. Census worker setup at da82e44 · D3D12 device identity

I tested two calls to D3D12CreateDevice on the WARP adapter in a standalone Windows 11 process. Both returned the same COM device identity. With the debug layer enabled before either call, two synthetic warning messages added through the separate host handles were visible to both. Clearing through one handle emptied the other's queue. A fresh process without the debug layer could not query ID3D12InfoQueue.

For reliable attribution, enable the layer before the initial census device probe and serialize the pipeline-creation and message-read section in debug mode. Shader translation can stay parallel. An initial implementation could instead require --jobs 1 when collecting per-pipeline reasons. Debug-layer initialization

AI-assisted. Synthetic D3D12 messages only. This probe used no title data and did not measure census performance.

**@⁠Ingenioeren** on GitHub · 2026-11-25 15:38 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7167156372) One detail for per-pipeline messages: the census creates a `Host` in each worker, but those hosts can share a D3D12 device and its InfoQueue. A worker that clears the queue can discard another worker's message. [Census worker setup at da82e44](https://github.com/Marvisak/VIctory/blob/da82e444ec46a162ca779c82d4cf191a69182971/apps/victory/src/translate.rs#L176-L222) · [D3D12 device identity](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-d3d12createdevice) I tested two calls to `D3D12CreateDevice` on the WARP adapter in a standalone Windows 11 process. Both returned the same COM device identity. With the debug layer enabled before either call, two synthetic warning messages added through the separate host handles were visible to both. Clearing through one handle emptied the other's queue. A fresh process without the debug layer could not query `ID3D12InfoQueue`. For reliable attribution, enable the layer before the initial census device probe and serialize the pipeline-creation and message-read section in debug mode. Shader translation can stay parallel. An initial implementation could instead require `--jobs 1` when collecting per-pipeline reasons. [Debug-layer initialization](https://learn.microsoft.com/en-us/windows/win32/api/d3d12sdklayers/nf-d3d12sdklayers-id3d12debug-enabledebuglayer) _AI-assisted. Synthetic D3D12 messages only. This probe used no title data and did not measure census performance._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 16:10 UTC · original · edited 2026-11-26 06:48 UTC

Automated triage for the maintainers.

Confirmed on main (63bcca4). Only crates/victory-gpu/src/host.rs reads VICTORY_D3D12_DEBUG, which enables the debug layer and keeps an ID3D12InfoQueue. The device that translate --pipelines creates in crates/victory-shader/src/emit/host.rs has neither, so its pipeline refusals carry only the HRESULT. The stage filter in ask 2 is a request for the maintainers.

Two open PRs address it and conflict with each other: #2560 and #2562. New since the last triage: at their new heads both merge cleanly onto 63bcca4 with no regression in a comparison on an RTX 4070 and WARP. #2562 now warns when the debug layer is missing, as asked. Concerns raised about #2560: it enables the debug layer on every hardware Host::new, gates on == "1" in any build, does not cover root signatures, and reports only the first message. Neither run had a debug layer installed, so a run of #2562's tests/debug_layer.rs with Graphics Tools is still the missing evidence.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 16:10 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7167651553) · edited 2026-11-26 06:48 UTC <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-26T04:22:34Z at=2026-11-26T07:22:30Z --> Automated triage for the maintainers. Confirmed on `main` (63bcca4). Only `crates/victory-gpu/src/host.rs` reads `VICTORY_D3D12_DEBUG`, which enables the debug layer and keeps an `ID3D12InfoQueue`. The device that `translate --pipelines` creates in `crates/victory-shader/src/emit/host.rs` has neither, so its pipeline refusals carry only the HRESULT. The stage filter in ask 2 is a request for the maintainers. Two open PRs address it and conflict with each other: #2560 and #2562. **New since the last triage:** at their new heads both merge cleanly onto `63bcca4` with no regression in a comparison on an RTX 4070 and WARP. #2562 now warns when the debug layer is missing, as asked. Concerns raised about #2560: it enables the debug layer on every hardware `Host::new`, gates on `== "1"` in any build, does not cover root signatures, and reports only the first message. Neither run had a debug layer installed, so a run of #2562's `tests/debug_layer.rs` with Graphics Tools is still the missing evidence. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠reboot0000-cmd on GitHub · 2026-11-25 17:11 UTC · original

@⁠Ingenioeren's point is right and it applies to what we published, so let me be precise about our own numbers rather than let them stand unqualified.

We hit exactly this hazard while producing the 394-program classification on #2220 — per-program driver reasons on a multi-worker census — and it is worth recording what it cost us, because the two remedies in that comment are not equally expensive.

Serialise, do not force single-thread. Our debug-layer numbers, all on Windows 10 LTSC 2021 19044.7846 + RTX 4090:

pass workers throughput
debug layer on, every stage creates a pipeline 4 ~0.4 containers/s in the compute-dense tail; abandoned at 86% after ~7 h projected
debug layer on, compute pipelines only (a local stage filter, same idea as #2562's --only cs) 4 26,503 containers in ~3,039 s to 92%, ~7–8/s

Translation and validation stayed four-wide in both. The only section that had to be exclusive was pipeline creation plus the queue read — which is the part the layer makes slow anyway, so serialising it costs almost nothing next to what a --jobs 1 run throws away across all 26,084 programs. #2560's phrasing ("the shared adapter ID3D12InfoQueue so concurrent census workers do not clear or steal each other's driver diagnostics") describes the same guard, and it looks like the right shape.

What our result does and does not prove. We reported that all 394 refused programs each carried exactly one message (id 622, CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32), with zero silent refusals. Under a racing queue, a missing message can be another worker's ClearStoredMessages, so "zero silent" is the claim most exposed to the objection — and on that point the data helps: we drained and inspected the queue after all 2,227 accepted compute programs as well, and the driver said nothing for any of them (0 with a message). A queue being routinely emptied by other workers would have to leave some accepted programs holding a stray message and some refusals holding none; we saw neither.

The conclusion did not rest on that line in any case. A static read of all 2,621 emitted compute programs matched the created/refused split exactly (394 demand 64 lanes; the 2,227 that create demand 32 or nothing), and changing only that declaration flips the whole set in both directions across the archive. Those measurements don't touch the info queue at all, so they are unaffected by this hazard. Where we lean on per-program driver text, treat the attribution as corroborating rather than primary.

If it's useful once #2560 or #2562 lands, we can re-run the same archive and report how many attributions differ between an unguarded queue and a guarded one — that is a cheap way to put a number on the race instead of arguing about whether it can fire.

**@⁠reboot0000-cmd** on GitHub · 2026-11-25 17:11 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7169150242) @⁠Ingenioeren's point is right and it applies to what we published, so let me be precise about our own numbers rather than let them stand unqualified. We hit exactly this hazard while producing the 394-program classification on #2220 — per-program driver reasons on a multi-worker census — and it is worth recording what it cost us, because the two remedies in that comment are not equally expensive. **Serialise, do not force single-thread.** Our debug-layer numbers, all on Windows 10 LTSC 2021 19044.7846 + RTX 4090: | pass | workers | throughput | |---|---|---| | debug layer on, every stage creates a pipeline | 4 | ~0.4 containers/s in the compute-dense tail; abandoned at 86% after ~7 h projected | | debug layer on, compute pipelines only (a local stage filter, same idea as #2562's `--only cs`) | 4 | 26,503 containers in ~3,039 s to 92%, ~7–8/s | Translation and validation stayed four-wide in both. The only section that had to be exclusive was pipeline creation plus the queue read — which is the part the layer makes slow anyway, so serialising it costs almost nothing next to what a `--jobs 1` run throws away across all 26,084 programs. #2560's phrasing ("the shared adapter `ID3D12InfoQueue` so concurrent census workers do not clear or steal each other's driver diagnostics") describes the same guard, and it looks like the right shape. **What our result does and does not prove.** We reported that all 394 refused programs each carried exactly one message (id 622, `CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 32`), with zero silent refusals. Under a racing queue, a *missing* message can be another worker's `ClearStoredMessages`, so "zero silent" is the claim most exposed to the objection — and on that point the data helps: we drained and inspected the queue after **all 2,227 accepted compute programs** as well, and the driver said nothing for any of them (0 with a message). A queue being routinely emptied by other workers would have to leave some accepted programs holding a stray message and some refusals holding none; we saw neither. The conclusion did not rest on that line in any case. A static read of all 2,621 emitted compute programs matched the created/refused split exactly (394 demand 64 lanes; the 2,227 that create demand 32 or nothing), and changing only that declaration flips the whole set in both directions across the archive. Those measurements don't touch the info queue at all, so they are unaffected by this hazard. Where we lean on per-program driver text, treat the attribution as corroborating rather than primary. If it's useful once #2560 or #2562 lands, we can re-run the same archive and report how many attributions differ between an unguarded queue and a guarded one — that is a cheap way to put a number on the race instead of arguing about whether it can fire.
Author
Owner

@⁠KainanP on GitHub · 2026-11-25 22:53 UTC · original

#2560 and #2562, compared on an RTX 4060 and WARP (no debug layer here, stated plainly)

Two PRs are open for this issue: #2560 and #2562. #2568 was closed in favour of #2562. I ran the same checks against both, so they can be compared directly. No game, no game data.

Machine: Windows 11 Home 26200. RTX 4060 Laptop GPU (driver 32.0.16.1047) and WARP 10.0.26100.9818. I did not run this cluster on the Intel UHD: without the layer, the code path does not depend on the adapter. Rust 1.98.1 as pinned. The measurements below are on main 13f91cae; see the last section for f3578e38.

The limit of this test: this machine has no D3D12 debug layer. The Graphics Tools optional feature is not installed, so there is no d3d12SDKLayers.dll. D3D12GetDebugInterface returns 0x887A002D (DXGI_ERROR_SDK_COMPONENT_MISSING). So I could not observe a refusal that carries the driver's reason, nor the cross-worker attribution, on either PR. What I could measure is the code path when the switch is set and the layer is missing, the census shape, the PRs' own tests and regressions. Someone with Graphics Tools installed should run #2562's tests/debug_layer.rs, which is the test that checks attribution.

What I ran

A local probe (an integration test in victory-shader, not pushed) sets VICTORY_D3D12_DEBUG=1 in a --features host,diagnostics build. On WARP and then on the hardware adapter, it makes two kinds of refusal through emit::host::Host: bytes that are not a shader, and host::stub_ps() passed to compute_pipeline_with. Then it reproduces the census shape: 8 threads, each with its own Host::new, making 25 refusals each (200 in all). Finally it reads GetDeviceRemovedReason.

main #2560 (4ef99046) #2562 (a74a651d)
merges onto 13f91cae clean; conflicts with #2562 (Host::new) clean (and 0ec4c483 onto f3578e38)
debug layer reached with VICTORY_D3D12_DEBUG=1 no (never asked) asked; missing here, ignored silently asked; missing here, ignored silently
refusal text, WARP and RTX bare (The parameter is incorrect. / Unspecified error, localized here) bare bare
8 hosts x 25 refusals, WARP and RTX 200 bare errors, device alive same same
own tests emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure passes with VICTORY_D3D12_DEBUG set to 0 and to 1. Without the layer it takes its fallback branch, which only checks that the refusal is an error debug_layer.rs (2 tests) prints no debug layer on this machine; skipped and passes; debug_layer_off.rs passes; translate::tests (3, including the 2 --only tests) pass
cargo test -p victory-shader --features host,diagnostics, RTX, VICTORY_D3D12_DEBUG unset / =1 266 / 3 failed, both 267 / same 3, both 266 / same 3, plus its 3 integration tests, both

The 3 failures are the known NVIDIA ones from #1744 (a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, gathers_at_a_level_match_the_hardware), with #2571's test skipped. Neither PR touches victory-gpu. So: no regression from either PR, with the switch off or on, but nothing on this machine shows that either PR delivers a reason.

Semantic differences (from reading the diffs)

  • Gating. #2560 turns the layer on whenever VICTORY_D3D12_DEBUG == "1", in any build, release included. #2562 follows victory-gpu and the README: it needs the diagnostics feature, and 0 means off. This was also the triage's first point on #2568.
  • What is wrapped. #2562 covers CreateRootSignature as well as the compute, graphics and mesh pipelines (root-signature refusals are what #2157 separates). #2560 covers only the pipelines.
  • What is reported. #2560 reports the first error-level message, or the first message if there is none. #2562 reports every error and warning as id N: text, and the issue's evidence is keyed by message id (622).
  • Lock. #2560 serialises creation whenever the variable is set, even when the layer is missing. #2562 serialises only when the device actually has an ID3D12InfoQueue, so a missing layer costs nothing.
  • Stage filter. Only #2562 adds ask 2 of this issue (--only vs,ps,cs,ms, which requires --pipelines and conflicts with --cache).
  • At the heads I tested on 13f91cae, both called EnableDebugLayer on every Host::new, and the D3D12 documentation says this removes a device that already exists. I could not test it without the layer. #2562 has fixed this since (next section). Both also clear the queue of victory-gpu's device once at startup, through the fuses_fmad wrapper (Host::from_device on current main). Both also ignore a missing layer without a word. victory-gpu logs no D3D12 debug layer in that case. Here, VICTORY_D3D12_DEBUG=1 without Graphics Tools gives exactly the bare refusals this issue describes, which still reads as "the driver gave no reason".

Since main moved to f3578e38

#244 rewrote Host::new around create_device and a shared WARP device. #2560 (4ef99046) now conflicts in emit/host.rs. #2562 merged main in (0ec4c483) and merges cleanly. It now calls EnableDebugLayer from create_device, before D3D12CreateDevice, behind a std::sync::Once, which settles the repeated-EnableDebugLayer point above for #2562. I re-ran its new head on f3578e38. The probe gives the same result as before (200 bare refusals on WARP and on the RTX, device alive, no hint that the layer is missing). Its debug-layer tests skip and pass, debug_layer_off passes, and cargo test -p victory-shader --features host,diagnostics with VICTORY_D3D12_DEBUG=1 gives 298 passed and the same 3 failed, the same as main (298 / 3), plus its 3 integration tests.

Recommendation

  • #2562. It is the one that matches the existing switch (diagnostics-only, 0 off), covers root signatures, reports message ids, adds --only, enables the layer once per process (since 0ec4c483), and carries a test of attribution across workers. One small ask: a warning when D3D12GetDebugInterface fails, as victory-gpu does. Without it, a machine without Graphics Tools gets exactly the bare refusals this issue is about.
  • Close #2560 as overlapping. It conflicts with #2562 and with main, and it lacks the gating, the root signatures, --only and the once-per-process enable.
  • #2562's claim to deliver driver reasons is unverified here (no debug layer). The reporter's team offered on this issue to re-run the archive once one of them lands. That run, or cargo test -p victory-shader --features host,diagnostics --test debug_layer on any machine with Graphics Tools, is the missing evidence.

Reproduce

cargo test -p victory-shader --features host,diagnostics --test debug_layer --test debug_layer_off -- --nocapture   # #2562
VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --lib -- emit::host::tests --nocapture                          # #2560
cargo test -p victory --bin victory -- translate::tests                                                          # #2562 --only
VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --features host,diagnostics --no-fail-fast -- --skip heap_direct_texture_reads_mark_their_heap_index

Tested with the help of an AI assistant (Claude Code).

**@⁠KainanP** on GitHub · 2026-11-25 22:53 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7176909182) ## #2560 and #2562, compared on an RTX 4060 and WARP (no debug layer here, stated plainly) Two PRs are open for this issue: #2560 and #2562. #2568 was closed in favour of #2562. I ran the same checks against both, so they can be compared directly. No game, no game data. **Machine:** Windows 11 Home 26200. **RTX 4060 Laptop GPU** (driver 32.0.16.1047) and WARP 10.0.26100.9818. I did not run this cluster on the Intel UHD: without the layer, the code path does not depend on the adapter. Rust 1.98.1 as pinned. The measurements below are on `main` `13f91cae`; see the last section for `f3578e38`. **The limit of this test:** this machine has **no D3D12 debug layer**. The Graphics Tools optional feature is not installed, so there is no `d3d12SDKLayers.dll`. `D3D12GetDebugInterface` returns `0x887A002D` (`DXGI_ERROR_SDK_COMPONENT_MISSING`). So I **could not** observe a refusal that carries the driver's reason, nor the cross-worker attribution, on either PR. What I could measure is the code path when the switch is set and the layer is missing, the census shape, the PRs' own tests and regressions. Someone with Graphics Tools installed should run #2562's `tests/debug_layer.rs`, which is the test that checks attribution. ### What I ran A local probe (an integration test in `victory-shader`, not pushed) sets `VICTORY_D3D12_DEBUG=1` in a `--features host,diagnostics` build. On WARP and then on the hardware adapter, it makes two kinds of refusal through `emit::host::Host`: bytes that are not a shader, and `host::stub_ps()` passed to `compute_pipeline_with`. Then it reproduces the census shape: 8 threads, each with its own `Host::new`, making 25 refusals each (200 in all). Finally it reads `GetDeviceRemovedReason`. | | `main` | #2560 (`4ef99046`) | #2562 (`a74a651d`) | |---|---|---|---| | merges onto `13f91cae` | | clean; **conflicts with #2562** (`Host::new`) | clean (and `0ec4c483` onto `f3578e38`) | | debug layer reached with `VICTORY_D3D12_DEBUG=1` | no (never asked) | asked; missing here, **ignored silently** | asked; missing here, **ignored silently** | | refusal text, WARP and RTX | bare (`The parameter is incorrect.` / `Unspecified error`, localized here) | bare | bare | | 8 hosts x 25 refusals, WARP and RTX | 200 bare errors, device alive | same | same | | own tests | | `emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure` passes with `VICTORY_D3D12_DEBUG` set to 0 and to 1. Without the layer it takes its fallback branch, which only checks that the refusal is an error | `debug_layer.rs` (2 tests) prints `no debug layer on this machine; skipped` and passes; `debug_layer_off.rs` passes; `translate::tests` (3, including the 2 `--only` tests) pass | | `cargo test -p victory-shader --features host,diagnostics`, RTX, `VICTORY_D3D12_DEBUG` unset / `=1` | 266 / 3 failed, both | 267 / same 3, both | 266 / same 3, plus its 3 integration tests, both | The 3 failures are the known NVIDIA ones from #1744 (`a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `gathers_at_a_level_match_the_hardware`), with #2571's test skipped. Neither PR touches `victory-gpu`. So: **no regression from either PR**, with the switch off or on, but nothing on this machine shows that either PR delivers a reason. ### Semantic differences (from reading the diffs) - **Gating.** #2560 turns the layer on whenever `VICTORY_D3D12_DEBUG == "1"`, in any build, release included. #2562 follows `victory-gpu` and the README: it needs the `diagnostics` feature, and `0` means off. This was also the triage's first point on #2568. - **What is wrapped.** #2562 covers `CreateRootSignature` as well as the compute, graphics and mesh pipelines (root-signature refusals are what #2157 separates). #2560 covers only the pipelines. - **What is reported.** #2560 reports the first error-level message, or the first message if there is none. #2562 reports every error and warning as `id N: text`, and the issue's evidence is keyed by message id (622). - **Lock.** #2560 serialises creation whenever the variable is set, even when the layer is missing. #2562 serialises only when the device actually has an `ID3D12InfoQueue`, so a missing layer costs nothing. - **Stage filter.** Only #2562 adds ask 2 of this issue (`--only vs,ps,cs,ms`, which requires `--pipelines` and conflicts with `--cache`). - At the heads I tested on `13f91cae`, **both** called `EnableDebugLayer` on every `Host::new`, and the D3D12 documentation says this removes a device that already exists. I could not test it without the layer. #2562 has fixed this since (next section). Both also clear the queue of `victory-gpu`'s device once at startup, through the `fuses_fmad` wrapper (`Host::from_device` on current `main`). Both also **ignore a missing layer without a word**. `victory-gpu` logs `no D3D12 debug layer` in that case. Here, `VICTORY_D3D12_DEBUG=1` without Graphics Tools gives exactly the bare refusals this issue describes, which still reads as "the driver gave no reason". ### Since `main` moved to `f3578e38` #244 rewrote `Host::new` around `create_device` and a shared WARP device. **#2560 (`4ef99046`) now conflicts** in `emit/host.rs`. **#2562 merged `main` in (`0ec4c483`)** and merges cleanly. It now calls `EnableDebugLayer` from `create_device`, before `D3D12CreateDevice`, behind a `std::sync::Once`, which settles the repeated-`EnableDebugLayer` point above for #2562. I re-ran its new head on `f3578e38`. The probe gives the same result as before (200 bare refusals on WARP and on the RTX, device alive, no hint that the layer is missing). Its debug-layer tests skip and pass, `debug_layer_off` passes, and `cargo test -p victory-shader --features host,diagnostics` with `VICTORY_D3D12_DEBUG=1` gives 298 passed and the same 3 failed, the same as `main` (298 / 3), plus its 3 integration tests. ### Recommendation - **#2562.** It is the one that matches the existing switch (diagnostics-only, `0` off), covers root signatures, reports message ids, adds `--only`, enables the layer once per process (since `0ec4c483`), and carries a test of attribution across workers. One small ask: a warning when `D3D12GetDebugInterface` fails, as `victory-gpu` does. Without it, a machine without Graphics Tools gets exactly the bare refusals this issue is about. - **Close #2560** as overlapping. It conflicts with #2562 and with `main`, and it lacks the gating, the root signatures, `--only` and the once-per-process enable. - #2562's claim to deliver driver reasons is **unverified here** (no debug layer). The reporter's team offered on this issue to re-run the archive once one of them lands. That run, or `cargo test -p victory-shader --features host,diagnostics --test debug_layer` on any machine with Graphics Tools, is the missing evidence. ### Reproduce ```sh cargo test -p victory-shader --features host,diagnostics --test debug_layer --test debug_layer_off -- --nocapture # #2562 VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --lib -- emit::host::tests --nocapture # #2560 cargo test -p victory --bin victory -- translate::tests # #2562 --only VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --features host,diagnostics --no-fail-fast -- --skip heap_direct_texture_reads_mark_their_heap_index ``` Tested with the help of an AI assistant (Claude Code).
Author
Owner

@⁠pawrenity on GitHub · 2026-11-26 04:22 UTC · original

#2562 and #2560 compared at their current heads

Hardware: NVIDIA GeForce RTX 4070, Windows 11, plus WARP. Base: main 63bcca4. I used no game data. Both heads moved since the earlier comparison here: #2562 is now ad66ddf and #2560 is now e384e9e (rebased).

Limit: this machine has no D3D12 debug layer either (d3d12SDKLayers.dll is absent). So neither PR's central claim was observed: a refusal that carries the driver's reason, attributed correctly across workers. Everything below is the code path with the switch set and the layer missing, plus reading the diffs.

PR head own tests own test fails on main? cross test clippy -D warnings merges onto 63bcca4 defects
#2562 ad66ddf tests/debug_layer.rs: 2 pass, but both print "no debug layer on this machine; skipped". tests/debug_layer_off.rs: 1 passes. victory bin: 16/16, including both --only tests not demonstrable here: without the layer the attribution tests skip, so they also pass on main not feasible in reverse: #2560's test calls #2560's drain_debug_message clean (-p victory-shader -p victory --all-targets, and victory-shader --features host,diagnostics) clean none found; one minor note shared with #2560 (below)
#2560 e384e9e emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure passes with VICTORY_D3D12_DEBUG unset and =1. Without the layer it takes its fallback branch, which only checks that the refusal is an error n/a: the test calls the new drain_debug_message and does not compile on main #2562's debug_layer.rs/debug_layer_off.rs copied onto #2560 pass, but only by skipping (no layer). With a layer, debug_layer.rs would fail on format alone: #2560 appends ": <text>", not "; debug layer: id N: …" clean (default and --all-features) clean yes (below)

The two PRs conflict with each other in crates/victory-shader/src/emit/host.rs.

Regression check. VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --features host,diagnostics --lib -- --skip heap_direct_texture_reads_mark_their_heap_index on the RTX:

  • main: 298 passed, 3 failed.
  • #2562: 298 passed, 3 failed.
  • #2560: 299 passed (its new test), 3 failed.

The 3 failures are the same known NVIDIA ones on all three trees (a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, gathers_at_a_level_match_the_hardware, #1744). Without the skip, the #2562 run ended with 0xC0000005. I skipped that test on all three trees, as in the earlier report. I did not re-check whether the crash also happens on main.

Missing layer. #2562 now prints a one-time warning when VICTORY_D3D12_DEBUG asks for the layer and it is unavailable. I saw it here: "warning: VICTORY_D3D12_DEBUG requested the D3D12 debug layer, but it is unavailable. Install Graphics Tools …". #2560 ignores a missing layer without a word, so the refusals stay bare. That is the symptom this issue reports.

Review notes, from reading the code (not observable without the layer)

  • #2560, crates/victory-shader/src/emit/host.rs:80-86: EnableDebugLayer runs inside create_device, and that is called on every Host::new(false) (:231). The hardware device is not shared through a OnceLock the way WARP's is. With the switch on, a second hardware host enables the layer while a device already exists, and the D3D12 documentation says that removes the existing device. This affects the census's per-worker Host::new on hardware. #2562 calls enable_debug_layer() behind a Once (:77), before the first device.
  • #2560, :169-170: the switch is on only for == "1", in any build. victory-gpu's switch (switch.rs) means "set and not 0", and the README ties VICTORY_D3D12_DEBUG to diagnostics builds. #2562 matches both (:69).
  • #2560 does not wrap CreateRootSignature (:391), so a refused root signature stays bare. #2562 does (:440). #2560 reports only the first error (or the first message). #2562 reports every error and warning with its message id.
  • Both PRs: victory-gpu builds Host::from_device(device) on its own runtime device to run fuses_fmad (crates/victory-gpu/src/host.rs:242 on main). With the debug layer on, that single pipeline creation goes through the new wrapper and clears the runtime device's info queue once at startup. This is minor, and it is the same in both PRs.

Recommendation. #2562. It enables the layer once per process and before the first device, follows the existing switch semantics and diagnostics gating, covers root signatures, reports message ids, adds --only, now warns when the layer is missing, and merges cleanly. It adds no regression on this machine. #2560 overlaps it, conflicts with it, and keeps the repeated EnableDebugLayer on every hardware Host::new. Closing #2560 in favour of #2562 looks reasonable. The evidence still missing for either PR is a run with Graphics Tools installed: cargo test -p victory-shader --features host,diagnostics --test debug_layer.

AI-assisted (Claude Code).

**@⁠pawrenity** on GitHub · 2026-11-26 04:22 UTC · [original](https://github.com/Marvisak/VIctory/issues/2537#issuecomment-7182540058) ## #2562 and #2560 compared at their current heads Hardware: NVIDIA GeForce RTX 4070, Windows 11, plus WARP. Base: `main` `63bcca4`. I used no game data. Both heads moved since the earlier comparison here: #2562 is now `ad66ddf` and #2560 is now `e384e9e` (rebased). **Limit:** this machine has no D3D12 debug layer either (`d3d12SDKLayers.dll` is absent). So neither PR's central claim was observed: a refusal that carries the driver's reason, attributed correctly across workers. Everything below is the code path with the switch set and the layer missing, plus reading the diffs. | PR | head | own tests | own test fails on `main`? | cross test | clippy `-D warnings` | merges onto `63bcca4` | defects | |---|---|---|---|---|---|---|---| | #2562 | `ad66ddf` | `tests/debug_layer.rs`: 2 pass, but both print "no debug layer on this machine; skipped". `tests/debug_layer_off.rs`: 1 passes. `victory` bin: 16/16, including both `--only` tests | not demonstrable here: without the layer the attribution tests skip, so they also pass on `main` | not feasible in reverse: #2560's test calls #2560's `drain_debug_message` | clean (`-p victory-shader -p victory --all-targets`, and `victory-shader --features host,diagnostics`) | clean | none found; one minor note shared with #2560 (below) | | #2560 | `e384e9e` | `emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure` passes with `VICTORY_D3D12_DEBUG` unset and `=1`. Without the layer it takes its fallback branch, which only checks that the refusal is an error | n/a: the test calls the new `drain_debug_message` and does not compile on `main` | #2562's `debug_layer.rs`/`debug_layer_off.rs` copied onto #2560 pass, but only by skipping (no layer). With a layer, `debug_layer.rs` would fail on format alone: #2560 appends `": <text>"`, not `"; debug layer: id N: …"` | clean (default and `--all-features`) | clean | yes (below) | The two PRs **conflict with each other** in `crates/victory-shader/src/emit/host.rs`. **Regression check.** `VICTORY_D3D12_DEBUG=1 cargo test -p victory-shader --features host,diagnostics --lib -- --skip heap_direct_texture_reads_mark_their_heap_index` on the RTX: - `main`: 298 passed, 3 failed. - #2562: 298 passed, 3 failed. - #2560: 299 passed (its new test), 3 failed. The 3 failures are the same known NVIDIA ones on all three trees (`a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros`, `gathers_at_a_level_match_the_hardware`, #1744). Without the skip, the #2562 run ended with 0xC0000005. I skipped that test on all three trees, as in the earlier report. I did not re-check whether the crash also happens on `main`. **Missing layer.** #2562 now prints a one-time warning when `VICTORY_D3D12_DEBUG` asks for the layer and it is unavailable. I saw it here: "warning: VICTORY_D3D12_DEBUG requested the D3D12 debug layer, but it is unavailable. Install Graphics Tools …". #2560 ignores a missing layer without a word, so the refusals stay bare. That is the symptom this issue reports. **Review notes, from reading the code (not observable without the layer)** - #2560, `crates/victory-shader/src/emit/host.rs:80-86`: `EnableDebugLayer` runs inside `create_device`, and that is called on every `Host::new(false)` (`:231`). The hardware device is not shared through a `OnceLock` the way WARP's is. With the switch on, a second hardware host enables the layer while a device already exists, and the D3D12 documentation says that removes the existing device. This affects the census's per-worker `Host::new` on hardware. #2562 calls `enable_debug_layer()` behind a `Once` (`:77`), before the first device. - #2560, `:169-170`: the switch is on only for `== "1"`, in any build. `victory-gpu`'s switch (`switch.rs`) means "set and not `0`", and the README ties `VICTORY_D3D12_DEBUG` to diagnostics builds. #2562 matches both (`:69`). - #2560 does not wrap `CreateRootSignature` (`:391`), so a refused root signature stays bare. #2562 does (`:440`). #2560 reports only the first error (or the first message). #2562 reports every error and warning with its message id. - Both PRs: `victory-gpu` builds `Host::from_device(device)` on its own runtime device to run `fuses_fmad` (`crates/victory-gpu/src/host.rs:242` on `main`). With the debug layer on, that single pipeline creation goes through the new wrapper and clears the runtime device's info queue once at startup. This is minor, and it is the same in both PRs. **Recommendation.** #2562. It enables the layer once per process and before the first device, follows the existing switch semantics and diagnostics gating, covers root signatures, reports message ids, adds `--only`, now warns when the layer is missing, and merges cleanly. It adds no regression on this machine. #2560 overlaps it, conflicts with it, and keeps the repeated `EnableDebugLayer` on every hardware `Host::new`. Closing #2560 in favour of #2562 looks reasonable. The evidence still missing for either PR is a run with Graphics Tools installed: `cargo test -p victory-shader --features host,diagnostics --test debug_layer`. AI-assisted (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#2537
No description provided.