translate --pipelines: VICTORY_D3D12_DEBUG never reaches the device it creates, so pipeline refusals carry no driver reason #2537
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#2537
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@reboot0000-cmd on GitHub · 2026-11-25 15:27 UTC · original
VICTORY_D3D12_DEBUGconfigures a device thattranslate --pipelinesdoes not use, so pipeline refusals are reported as bare error codes.crates/victory-gpu/src/host.rsgates the debug layer and theID3D12InfoQueueoncfg!(feature = "diagnostics") && switch::on("VICTORY_D3D12_DEBUG")(host.rs:144, and the info-queue capture at :195). Thetranslatecommand creates its own device incrates/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-archivetranslate --validate --pipelines --listover the title's shader archive (26,084 programs) produced 394 compute pipeline refusals reading onlypipeline: 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 622ID3D12Device::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:
emit/host.rscreates, so--pipelinesrefusals carry driver reasons. Today the documented diagnostic switch silently does nothing on this path, which reads as "the driver gave no reason".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 referenced this issue2026-11-26 05:09:18 +00:00
@Ingenioeren on GitHub · 2026-11-25 15:38 UTC · original
One detail for per-pipeline messages: the census creates a
Hostin 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 identityI tested two calls to
D3D12CreateDeviceon 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 queryID3D12InfoQueue.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 1when collecting per-pipeline reasons. Debug-layer initializationAI-assisted. Synthetic D3D12 messages only. This probe used no title data and did not measure census performance.
@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). Onlycrates/victory-gpu/src/host.rsreadsVICTORY_D3D12_DEBUG, which enables the debug layer and keeps anID3D12InfoQueue. The device thattranslate --pipelinescreates incrates/victory-shader/src/emit/host.rshas 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
63bcca4with 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 hardwareHost::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'stests/debug_layer.rswith Graphics Tools is still the missing evidence.Generated by Claude Code
@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:
--only cs)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 1run throws away across all 26,084 programs. #2560's phrasing ("the shared adapterID3D12InfoQueueso 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'sClearStoredMessages, 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.
@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
main13f91cae; see the last section forf3578e38.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.D3D12GetDebugInterfacereturns0x887A002D(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'stests/debug_layer.rs, which is the test that checks attribution.What I ran
A local probe (an integration test in
victory-shader, not pushed) setsVICTORY_D3D12_DEBUG=1in a--features host,diagnosticsbuild. On WARP and then on the hardware adapter, it makes two kinds of refusal throughemit::host::Host: bytes that are not a shader, andhost::stub_ps()passed tocompute_pipeline_with. Then it reproduces the census shape: 8 threads, each with its ownHost::new, making 25 refusals each (200 in all). Finally it readsGetDeviceRemovedReason.main4ef99046)a74a651d)13f91caeHost::new)0ec4c483ontof3578e38)VICTORY_D3D12_DEBUG=1The parameter is incorrect./Unspecified error, localized here)emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failurepasses withVICTORY_D3D12_DEBUGset to 0 and to 1. Without the layer it takes its fallback branch, which only checks that the refusal is an errordebug_layer.rs(2 tests) printsno debug layer on this machine; skippedand passes;debug_layer_off.rspasses;translate::tests(3, including the 2--onlytests) passcargo test -p victory-shader --features host,diagnostics, RTX,VICTORY_D3D12_DEBUGunset /=1The 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 touchesvictory-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)
VICTORY_D3D12_DEBUG == "1", in any build, release included. #2562 followsvictory-gpuand the README: it needs thediagnosticsfeature, and0means off. This was also the triage's first point on #2568.CreateRootSignatureas well as the compute, graphics and mesh pipelines (root-signature refusals are what #2157 separates). #2560 covers only the pipelines.id N: text, and the issue's evidence is keyed by message id (622).ID3D12InfoQueue, so a missing layer costs nothing.--only vs,ps,cs,ms, which requires--pipelinesand conflicts with--cache).13f91cae, both calledEnableDebugLayeron everyHost::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 ofvictory-gpu's device once at startup, through thefuses_fmadwrapper (Host::from_deviceon currentmain). Both also ignore a missing layer without a word.victory-gpulogsno D3D12 debug layerin that case. Here,VICTORY_D3D12_DEBUG=1without Graphics Tools gives exactly the bare refusals this issue describes, which still reads as "the driver gave no reason".Since
mainmoved tof3578e38#244 rewrote
Host::newaroundcreate_deviceand a shared WARP device. #2560 (4ef99046) now conflicts inemit/host.rs. #2562 mergedmainin (0ec4c483) and merges cleanly. It now callsEnableDebugLayerfromcreate_device, beforeD3D12CreateDevice, behind astd::sync::Once, which settles the repeated-EnableDebugLayerpoint above for #2562. I re-ran its new head onf3578e38. 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_offpasses, andcargo test -p victory-shader --features host,diagnosticswithVICTORY_D3D12_DEBUG=1gives 298 passed and the same 3 failed, the same asmain(298 / 3), plus its 3 integration tests.Recommendation
0off), covers root signatures, reports message ids, adds--only, enables the layer once per process (since0ec4c483), and carries a test of attribution across workers. One small ask: a warning whenD3D12GetDebugInterfacefails, asvictory-gpudoes. Without it, a machine without Graphics Tools gets exactly the bare refusals this issue is about.main, and it lacks the gating, the root signatures,--onlyand the once-per-process enable.cargo test -p victory-shader --features host,diagnostics --test debug_layeron any machine with Graphics Tools, is the missing evidence.Reproduce
Tested with the help of an AI assistant (Claude Code).
@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:
main63bcca4. I used no game data. Both heads moved since the earlier comparison here: #2562 is nowad66ddfand #2560 is nowe384e9e(rebased).Limit: this machine has no D3D12 debug layer either (
d3d12SDKLayers.dllis 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.main?-D warnings63bcca4ad66ddftests/debug_layer.rs: 2 pass, but both print "no debug layer on this machine; skipped".tests/debug_layer_off.rs: 1 passes.victorybin: 16/16, including both--onlytestsmaindrain_debug_message-p victory-shader -p victory --all-targets, andvictory-shader --features host,diagnostics)e384e9eemit::host::tests::debug_pipeline_creation_drains_info_queue_on_failurepasses withVICTORY_D3D12_DEBUGunset and=1. Without the layer it takes its fallback branch, which only checks that the refusal is an errordrain_debug_messageand does not compile onmaindebug_layer.rs/debug_layer_off.rscopied onto #2560 pass, but only by skipping (no layer). With a layer,debug_layer.rswould fail on format alone: #2560 appends": <text>", not"; debug layer: id N: …"--all-features)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_indexon the RTX:main: 298 passed, 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 onmain.Missing layer. #2562 now prints a one-time warning when
VICTORY_D3D12_DEBUGasks 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)
crates/victory-shader/src/emit/host.rs:80-86:EnableDebugLayerruns insidecreate_device, and that is called on everyHost::new(false)(:231). The hardware device is not shared through aOnceLockthe 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-workerHost::newon hardware. #2562 callsenable_debug_layer()behind aOnce(:77), before the first device.:169-170: the switch is on only for== "1", in any build.victory-gpu's switch (switch.rs) means "set and not0", and the README tiesVICTORY_D3D12_DEBUGto diagnostics builds. #2562 matches both (:69).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.victory-gpubuildsHost::from_device(device)on its own runtime device to runfuses_fmad(crates/victory-gpu/src/host.rs:242onmain). 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 repeatedEnableDebugLayeron every hardwareHost::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).