Shaders: enable VICTORY_D3D12_DEBUG and report InfoQueue errors on pipeline refusal #2560

Closed
github-bot wants to merge 1 commit from github-bot/gh-2560 into main AGit
Owner

@⁠ashrafsdrop on GitHub · 2026-11-25 15:47 UTC · original
ashrafsdrop:shader/host-d3d12-debug-2537 → main · +116 −4 · 1 files · 1 commits · closed without merging

Resolves #2537:

Summary

  • In crates/victory-shader/src/emit/host.rs, Host::new previously ignored VICTORY_D3D12_DEBUG=1, so victory translate --pipelines reported bare HRESULT codes on pipeline refusals without any D3D12 debug layer diagnostics.
  • Enabled ID3D12Debug::EnableDebugLayer in Host::new before D3D12CreateDevice when VICTORY_D3D12_DEBUG=1 is set.
  • Routed compute (compute_pipeline_with), graphics (pipeline_gs), and mesh (mesh_pipeline_with) pipeline creation through Host::create_pipeline:
    • When VICTORY_D3D12_DEBUG=1 is unset, runs lock-free in parallel across workers.
    • When VICTORY_D3D12_DEBUG=1 is set, serializes pipeline creation and ID3D12InfoQueue clear/drain under a static Mutex so concurrent census workers sharing the adapter's D3D12 device never clear or steal each other's messages, and appends the first D3D12 error message to the returned error string.

Verification

  • Added emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure (passes with VICTORY_D3D12_DEBUG=1 on WARP).
  • cargo test -p victory-shader --lib emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure (1 passed).
  • cargo clippy -p victory-shader --all-targets --all-features -- -D warnings (clean).
  • cargo run -p xtask -- policy (184 files ok).
**@⁠ashrafsdrop** on GitHub · 2026-11-25 15:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/2560) `ashrafsdrop:shader/host-d3d12-debug-2537` → `main` · +116 −4 · 1 files · 1 commits · closed without merging Resolves #2537: ### Summary - In `crates/victory-shader/src/emit/host.rs`, `Host::new` previously ignored `VICTORY_D3D12_DEBUG=1`, so `victory translate --pipelines` reported bare HRESULT codes on pipeline refusals without any D3D12 debug layer diagnostics. - Enabled `ID3D12Debug::EnableDebugLayer` in `Host::new` before `D3D12CreateDevice` when `VICTORY_D3D12_DEBUG=1` is set. - Routed compute (`compute_pipeline_with`), graphics (`pipeline_gs`), and mesh (`mesh_pipeline_with`) pipeline creation through `Host::create_pipeline`: - When `VICTORY_D3D12_DEBUG=1` is unset, runs lock-free in parallel across workers. - When `VICTORY_D3D12_DEBUG=1` is set, serializes pipeline creation and `ID3D12InfoQueue` clear/drain under a static `Mutex` so concurrent census workers sharing the adapter's D3D12 device never clear or steal each other's messages, and appends the first D3D12 error message to the returned error string. ### Verification - Added `emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure` (passes with `VICTORY_D3D12_DEBUG=1` on WARP). - `cargo test -p victory-shader --lib emit::host::tests::debug_pipeline_creation_drains_info_queue_on_failure` (1 passed). - `cargo clippy -p victory-shader --all-targets --all-features -- -D warnings` (clean). - `cargo run -p xtask -- policy` (184 files ok).
Resolves #2537:

- Enable ID3D12Debug layer in victory_shader::emit::host::Host::new when VICTORY_D3D12_DEBUG=1 is set.
- Serialize pipeline creation and ID3D12InfoQueue clear/drain under a process-wide mutex only when VICTORY_D3D12_DEBUG=1 so parallel census workers never steal each other's messages while non-debug runs remain lock-free.
- Append the first D3D12 debug error message to pipeline refusal errors across compute, graphics, and mesh pipeline creation.
- Add debug_pipeline_creation_drains_info_queue_on_failure unit test.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:09:16 +00:00
github-bot force-pushed github-bot/gh-2560 from 4ef9904644 to e384e9ec0d 2026-11-26 06:30:25 +00:00 Compare
github-bot closed this pull request 2026-11-26 06:30:26 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 18:39 UTC · original · edited 2026-11-26 04:22 UTC

Automated triage for the maintainers.

Proposed close. Duplicate of #2562. This enables the D3D12 debug layer in emit::host::create_device under VICTORY_D3D12_DEBUG=1 and adds the first ID3D12InfoQueue error to pipeline-creation failures. #2562 covers the same goal (#2537) more completely: it gates on the diagnostics feature like victory-gpu/src/host.rs, enables the layer once before the process's first device, reports refused root signatures too, and adds --only. Two points from the earlier review are also still open here: the layer is enabled inside create_device rather than once per process, and create_pipeline calls ClearStoredMessages on the shared device's queue. If something here is missing from #2562, please raise it there.

CI: passing.

This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 18:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/2560#issuecomment-7171216290) · edited 2026-11-26 04:22 UTC <!-- victory-triage v1 head=e384e9ec0dd723aa010ebe986e393fd9c8d5f953 verdict=proposed-close at=2026-11-26T04:22:38Z --> Automated triage for the maintainers. **Proposed close.** **Duplicate of #2562.** This enables the D3D12 debug layer in `emit::host::create_device` under `VICTORY_D3D12_DEBUG=1` and adds the first `ID3D12InfoQueue` error to pipeline-creation failures. #2562 covers the same goal (#2537) more completely: it gates on the `diagnostics` feature like `victory-gpu/src/host.rs`, enables the layer once before the process's first device, reports refused root signatures too, and adds `--only`. Two points from the earlier review are also still open here: the layer is enabled inside `create_device` rather than once per process, and `create_pipeline` calls `ClearStoredMessages` on the shared device's queue. If something here is missing from #2562, please raise it there. CI: passing. This PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

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

Compared with #2562 on an RTX 4060 and WARP (no debug layer here). It adds no regressions, but it now conflicts with main and #2562, and it lacks the diagnostics gating, the root signatures and --only. Details: #2537 (AI-assisted)

**@⁠KainanP** on GitHub · 2026-11-25 22:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2560#issuecomment-7176916297) Compared with #2562 on an RTX 4060 and WARP (no debug layer here). It adds no regressions, but it now conflicts with `main` and #2562, and it lacks the `diagnostics` gating, the root signatures and `--only`. Details: https://git.gtahub.st/github/Marvisak--VIctory/issues/2537 (AI-assisted)
Author
Owner

@⁠ashrafsdrop on GitHub · 2026-11-26 05:38 UTC · original

Closing in favor of #2562 which covers the diagnostics gating, once-per-process init, and --only flag

**@⁠ashrafsdrop** on GitHub · 2026-11-26 05:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2560#issuecomment-7183673664) Closing in favor of #2562 which covers the diagnostics gating, once-per-process init, and --only flag

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!2560
No description provided.