GPU: a refused pipeline says what the debug layer answered #2471

Closed
github-bot wants to merge 1 commit from gh-pr/2471/head into gh-pr/2471/base
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 14:16 UTC · original
HoLa-Lee:gpu/log-refused-pipeline-reason → main · +6 −6 · 1 files · 1 commits · closed without merging

What was wrong with the first form of this

Host::log_messages already writes every stored message to the log as its own D3D12: ... warning before clearing the queue — it only returns the first error. So the answer was in the log, on a line after the refusal it explains. My first description said it was thrown away; it was not, and the patch now also drops a stray UTF-8 byte order mark it had added to line 1 of the file.

What this does

All three places that refuse a pipeline (compute, mesh and graphics) call log_messages and drop the return value. This binds it and puts the first error in the refusal line itself, so the reason comes before the line that says a pipeline was refused:

ust let messages = host.log_messages(); tracing::warn!(error = %e, ?shaders, ?messages, "host pipeline refused");

Diff is the three call sites (6 lines changed); no behaviour beyond which line the text appears on.

Why it is worth it

In some cases that line is the whole diagnosis. On this machine, with the debug layer installed, the software rasteriser refused 458 compute pipelines in a single boot of a title, and every one of them said:

ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 4. To check for support, check device caps via the CheckFeatureSupport() API

which turns "that world drops 1,935 draws a frame on WARP" into one sentence.

How it was checked

cargo check -p victory-gpu --profile diag --features diagnostics on the rebased branch, and by the run the message above comes from. Independent runs on this PR (RTX 5070 Ti: 144 passed / 2 pre-existing #1744 failures; WARP: 146 passed; clippy clean; asset policy 182 files ok; RTX 4060: 141 passed / 2 pre-existing) were reported in the comments below.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 14:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471) `HoLa-Lee:gpu/log-refused-pipeline-reason` → `main` · +6 −6 · 1 files · 1 commits · closed without merging ## What was wrong with the first form of this `Host::log_messages` **already** writes every stored message to the log as its own `D3D12: ...` warning before clearing the queue — it only *returns* the first error. So the answer was in the log, on a line **after** the refusal it explains. My first description said it was thrown away; it was not, and the patch now also drops a stray UTF-8 byte order mark it had added to line 1 of the file. ## What this does All three places that refuse a pipeline (compute, mesh and graphics) call `log_messages` and drop the return value. This binds it and puts the first error **in the refusal line itself**, so the reason comes before the line that says a pipeline was refused: ` ust let messages = host.log_messages(); tracing::warn!(error = %e, ?shaders, ?messages, "host pipeline refused"); ` Diff is the three call sites (6 lines changed); no behaviour beyond which line the text appears on. ## Why it is worth it In some cases that line is the whole diagnosis. On this machine, with the debug layer installed, the software rasteriser refused 458 compute pipelines in a single boot of a title, and every one of them said: ` ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but maximum wave lane count for device is 4. To check for support, check device caps via the CheckFeatureSupport() API ` which turns "that world drops 1,935 draws a frame on WARP" into one sentence. ## How it was checked `cargo check -p victory-gpu --profile diag --features diagnostics` on the rebased branch, and by the run the message above comes from. Independent runs on this PR (RTX 5070 Ti: 144 passed / 2 pre-existing #1744 failures; WARP: 146 passed; clippy clean; asset policy 182 files ok; RTX 4060: 141 passed / 2 pre-existing) were reported in the comments below.
`Host::log_messages` already writes every stored message to the log as its own
`D3D12: ...` warning before clearing the queue; it only returns the first
error. So the answer was in the log, but on a line after the refusal it
explains. All three places that refuse a pipeline (compute, mesh and graphics)
call it and drop the return value; this binds it and puts the first error in the
refusal line itself:

    let messages = host.log_messages();
    tracing::warn!(error = %e, ?shaders, ?messages, "host pipeline refused");

No behaviour changes beyond which line the text appears on.

That line is the whole diagnosis in some cases. On this machine, with the debug
layer installed, the software rasteriser refused 458 compute pipelines in a
single boot of a title, and every one of them said:

    ID3D12Device::CreateComputeShader: Shader wants wave lane count of 64 but
    maximum wave lane count for device is 4. To check for support, check device
    caps via the CheckFeatureSupport() API

which turns "that world drops 1,935 draws a frame on WARP" into one sentence.

Checked with `cargo check -p victory-gpu --profile diag --features diagnostics`
and by the run the message above comes from.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:52 +00:00
github-bot closed this pull request 2026-11-26 05:06:52 +00:00
Author
Owner

@⁠Bj0rnis on GitHub · 2026-11-25 14:35 UTC · original

Independent Windows 11 hardware + WARP verification of #2471 at 12c2263c (clean git merge-tree with origin/main 940d32f6, Rust 1.98.1 MSVC):

  • NVIDIA GeForce RTX 5070 Ti (real hardware): cargo test -p victory-gpu --features diagnostics --lib --locked -- --test-threads=1 -> 144 passed, 2 failed, 2 ignored (only the 2 pre-existing #1744 NVIDIA 1M view-heap baseline failures also present on main 940d32f6).
  • WARP (VICTORY_D3D12_WARP=1): 146 passed, 0 failed, 2 ignored (1.00s).
  • Clippy: cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings -> 0 warnings.
  • Asset policy: cargo xtask policy -> 182 files ok.

Not tested: live game workload / reproducing a refused pipeline with VICTORY_D3D12_DEBUG=1.

AI-assisted test run and summary.

**@⁠Bj0rnis** on GitHub · 2026-11-25 14:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471#issuecomment-7165512028) Independent Windows 11 hardware + WARP verification of #2471 at `12c2263c` (clean `git merge-tree` with `origin/main` `940d32f6`, Rust 1.98.1 MSVC): - **NVIDIA GeForce RTX 5070 Ti (real hardware):** `cargo test -p victory-gpu --features diagnostics --lib --locked -- --test-threads=1` -> **144 passed, 2 failed, 2 ignored** (only the 2 pre-existing #1744 NVIDIA 1M view-heap baseline failures also present on `main` `940d32f6`). - **WARP (`VICTORY_D3D12_WARP=1`):** **146 passed, 0 failed, 2 ignored** (1.00s). - **Clippy:** `cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings` -> **0 warnings**. - **Asset policy:** `cargo xtask policy` -> **182 files ok**. Not tested: live game workload / reproducing a refused pipeline with `VICTORY_D3D12_DEBUG=1`. AI-assisted test run and summary.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:52 UTC · original · edited 2026-11-25 16:48 UTC

Automated triage for the maintainers.

Merge candidate. In crates/victory-gpu/src/pipeline/host.rs, the three places that refuse a pipeline (compute, mesh, graphics) now call Host::log_messages before the warning. They put its return value, the debug layer's first error, into the "host pipeline refused" line. Behaviour is otherwise unchanged: log_messages still logs every stored message as its own D3D12: ... line.

Both points from the last review are fixed:

  • the stray UTF-8 byte order mark is gone, so the diff is the three call sites only;
  • the description now says the message was already in the log on a separate line.

Optional nit: the field is named messages, but it holds only the first error (Option<String>). A name like debug_error would read more accurately.

CI: no check runs on this head; the workflow needs a maintainer's approval. Contributors report RTX 5070 Ti, WARP and RTX 4060 runs with only the known #1744 failures.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471#issuecomment-7167396107) · edited 2026-11-25 16:48 UTC <!-- victory-triage v1 head=0cd1a7971aaa14c996bb3ad793cb25ea5d80bd8b verdict=merge-candidate at=2026-11-25T16:45:09Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-gpu/src/pipeline/host.rs`, the three places that refuse a pipeline (compute, mesh, graphics) now call `Host::log_messages` before the warning. They put its return value, the debug layer's first error, into the "host pipeline refused" line. Behaviour is otherwise unchanged: `log_messages` still logs every stored message as its own `D3D12: ...` line. Both points from the last review are fixed: - the stray UTF-8 byte order mark is gone, so the diff is the three call sites only; - the description now says the message was already in the log on a separate line. Optional nit: the field is named `messages`, but it holds only the first error (`Option<String>`). A name like `debug_error` would read more accurately. CI: no check runs on this head; the workflow needs a maintainer's approval. Contributors report RTX 5070 Ti, WARP and RTX 4060 runs with only the known #1744 failures. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Vedoxdev123 on GitHub · 2026-11-25 15:54 UTC · original

Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060:

cargo test -p victory-gpu --lib -> 141 passed; 2 failed; 2 ignored

All tests in this branch pass on RTX 4060; the only 2 failures are the known 1,000,000 view heap cap tests (dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views from #1744).

**@⁠Vedoxdev123** on GitHub · 2026-11-25 15:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471#issuecomment-7167426656) Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060: `cargo test -p victory-gpu --lib` -> **141 passed; 2 failed; 2 ignored** All tests in this branch pass on RTX 4060; the only 2 failures are the known 1,000,000 view heap cap tests (`dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views` from #1744).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:10 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because it can attribute a message to the wrong pipeline. Host::log_messages already logs every stored debug-layer message as its own warning. The info queue is device-wide and several pipeline workers refuse pipelines at the same time, so the first error one worker drains may belong to another worker's pipeline.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 22:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471#issuecomment-7176022885) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because it can attribute a message to the wrong pipeline. `Host::log_messages` already logs every stored debug-layer message as its own warning. The info queue is device-wide and several pipeline workers refuse pipelines at the same time, so the first error one worker drains may belong to another worker's pipeline. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-25 22:25 UTC · original

Understood, and agreed - closing it is right.

Host::log_messages already logs every stored message as its own D3D12: … warning, so the debug layer's reason for a refusal is in the log either way; the only thing this PR added was putting the first drained message on the refusal's own line, and with the queue being device-wide and several workers refusing at once, that message can belong to another pipeline. Attribution was the whole point of the change, so without it there is nothing left worth merging.

Evidence that the separate lines are enough, from this machine: with VICTORY_D3D12_DEBUG=1 the refusal of a mesh/pixel pipeline was named exactly, without this PR -

ID3D12Device::CreateGraphicsPipelineState: The render target format at slot 2 is format
  (R8_UINT). This format does not support blending. ...
  • which led to a fix in #2790 (the blend is turned off for integer-format slots before the pipeline is built). The same run also named six compute pipelines refused for wave64 (maximum wave lane count for device is 32) and the shader-visible descriptor heap limit (1,000,000), all from the per-message warnings.

The messages naming nit is moot now. Thanks for the careful second look - the misattribution case is real and I had not considered the workers running at the same time.

**@⁠HoLa-Lee** on GitHub · 2026-11-25 22:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2471#issuecomment-7176348325) Understood, and agreed - closing it is right. `Host::log_messages` already logs every stored message as its own `D3D12: …` warning, so the debug layer's reason for a refusal is in the log either way; the only thing this PR added was putting the first drained message on the refusal's own line, and with the queue being device-wide and several workers refusing at once, that message can belong to another pipeline. Attribution was the whole point of the change, so without it there is nothing left worth merging. Evidence that the separate lines are enough, from this machine: with `VICTORY_D3D12_DEBUG=1` the refusal of a mesh/pixel pipeline was named exactly, without this PR - ``` ID3D12Device::CreateGraphicsPipelineState: The render target format at slot 2 is format (R8_UINT). This format does not support blending. ... ``` - which led to a fix in #2790 (the blend is turned off for integer-format slots before the pipeline is built). The same run also named six compute pipelines refused for wave64 (`maximum wave lane count for device is 32`) and the shader-visible descriptor heap limit (`1,000,000`), all from the per-message warnings. The `messages` naming nit is moot now. Thanks for the careful second look - the misattribution case is real and I had not considered the workers running at the same time.

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!2471
No description provided.