GPU: an empty pipeline library is not asked for pipelines it cannot have #1914

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

@⁠fiestorra on GitHub · 2026-11-25 00:51 UTC · original
fiestorra:gpu/no-library-lookup-when-empty → main · +29 −7 · 1 files · 1 commits · closed without merging

21 debug-layer warnings per boot that are not defects, from asking an empty library

Found by counting what a real run says rather than by reading the code: on a first boot, the host's D3D12 debug layer logs this once per pipeline —

WARN victory_gpu::host: D3D12: ID3D12PipelineLibrary::Load*Pipeline: This library does not have a
pipeline stored with name "c5df515a2ffae9ac06fa3bd7a5b32826". id=971 severity=2

— 21 times in a 290-second run (RTX 4090, driver 32.0.16.2124, session 1, diag build with the debug layer, four fixes merged so the run survives the removal). Each one is the pipeline library being asked for a pipeline it cannot have: the library was made from an empty blob, so it stores nothing yet, and LoadGraphicsPipeline/LoadComputePipeline must fail for every name.

Twenty-one warnings that are not defects cost real attention: they are the same lines a reader uses to spot the ones that are, which is how they got noticed here.

The change: the library records the names it has stored during the run, and while its blob is empty it is only asked for one of those. A library loaded from a blob is asked as before, since it can hold any name — there is no way to enumerate it.

/// Whether there is anything in the library to look a pipeline up in: a
/// library made from an empty blob with nothing stored yet has none, and
/// asking it anyway makes the debug layer warn (id 971) once per pipeline of
/// a first boot — 21 of them in a run measured here.
fn has_pipelines(&self, name: &str) -> bool {
    !self._blob.is_empty() || self.stored.contains(name)
}

Measured before and after, same machine, same driver, same session, same build otherwise:

does not have a pipeline stored
before 21
with the first, coarser version (ask only once anything is stored) 14
with this 0

The middle row is why the first attempt was not enough: added > 0 becomes true after the first pipeline is stored, and then every later name is asked again. The names are what matters, not whether the library is non-empty.

Recipe: cargo test -p victory-gpu --locked 78 passed, 1 ignored; cargo test --workspace --locked 23 suites ok with only the pre-existing victory-hle::modules::display::tests::sdr_and_display_deferrals failing in this headless session (what #1630 fixes); clippy --workspace --all-targets with and without --all-features clean under -D warnings; rustfmt --check 15 hunks on the file against 16 on main, none of them on the lines added here.

One method note, because it cost me a measurement: the debug layer's text arrives with ANSI escapes inside it, so a plain substring search for id=971 can miss lines that contain it. Count the message (does not have a pipeline stored), not the id.

No game data is involved: a pipeline name hash, warning counts and test counts.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-25 00:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1914) `fiestorra:gpu/no-library-lookup-when-empty` → `main` · +29 −7 · 1 files · 1 commits · closed without merging **21 debug-layer warnings per boot that are not defects, from asking an empty library** Found by counting what a real run says rather than by reading the code: on a first boot, the host's D3D12 debug layer logs this once per pipeline — ``` WARN victory_gpu::host: D3D12: ID3D12PipelineLibrary::Load*Pipeline: This library does not have a pipeline stored with name "c5df515a2ffae9ac06fa3bd7a5b32826". id=971 severity=2 ``` — **21 times** in a 290-second run (RTX 4090, driver `32.0.16.2124`, session 1, `diag` build with the debug layer, four fixes merged so the run survives the removal). Each one is the pipeline library being asked for a pipeline it cannot have: the library was made from an **empty blob**, so it stores nothing yet, and `LoadGraphicsPipeline`/`LoadComputePipeline` must fail for every name. Twenty-one warnings that are not defects cost real attention: they are the same lines a reader uses to spot the ones that are, which is how they got noticed here. **The change**: the library records the names it has stored during the run, and while its blob is empty it is only asked for one of those. A library loaded from a blob is asked as before, since it can hold any name — there is no way to enumerate it. ```rust /// Whether there is anything in the library to look a pipeline up in: a /// library made from an empty blob with nothing stored yet has none, and /// asking it anyway makes the debug layer warn (id 971) once per pipeline of /// a first boot — 21 of them in a run measured here. fn has_pipelines(&self, name: &str) -> bool { !self._blob.is_empty() || self.stored.contains(name) } ``` **Measured before and after**, same machine, same driver, same session, same build otherwise: | | `does not have a pipeline stored` | |---|---| | before | **21** | | with the first, coarser version (ask only once anything is stored) | 14 | | with this | **0** | The middle row is why the first attempt was not enough: `added > 0` becomes true after the first pipeline is stored, and then every later name is asked again. The names are what matters, not whether the library is non-empty. Recipe: `cargo test -p victory-gpu --locked` 78 passed, 1 ignored; `cargo test --workspace --locked` 23 suites ok with only the pre-existing `victory-hle::modules::display::tests::sdr_and_display_deferrals` failing in this headless session (what #1630 fixes); `clippy --workspace --all-targets` with and without `--all-features` clean under `-D warnings`; `rustfmt --check` 15 hunks on the file against 16 on `main`, none of them on the lines added here. One method note, because it cost me a measurement: the debug layer's text arrives with ANSI escapes inside it, so a plain substring search for `id=971` can miss lines that contain it. Count the message (`does not have a pipeline stored`), not the id. No game data is involved: a pipeline name hash, warning counts and test counts. Written with an AI assistant.
On a first boot the library is made from an empty blob and knows nothing, so
every LoadGraphicsPipeline/LoadComputePipeline for it fails, and the debug
layer says so once per pipeline: 21 times in a run measured here, as

  ID3D12PipelineLibrary::Load*Pipeline: This library does not have a pipeline
  stored with name "c5df515a2ffae9ac06fa3bd7a5b32826". id=971 severity=2

Twenty-one warnings that are not defects bury the ones that are. The library
now records the names it has stored in this run and, while its blob is empty,
is only asked for one of those; a library loaded from a blob is still asked,
since it may hold any name.

Measured on the RTX 4090 run that produced those 21 (diag build, debug layer
on, session 1, four fixes merged so the run survives): zero of them after the
change, device not removed, same screens presented.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:48:38 +00:00
github-bot closed this pull request 2026-11-26 04:48:38 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 08:17 UTC · original

Automated triage for the maintainers.

Merge candidate.

In crates/victory-gpu/src/pipeline/library.rs, pipeline() now skips load when the library was made from an empty blob and the name wasn't stored during this run. On main, open() sets _blob to empty exactly when it falls back to make(&[]): either there was no blob, or the host rejected it. Such a library can only hold the names stored since then. Lookups into a library loaded from a blob are unchanged. The name is recorded only after StorePipeline succeeds, and the "store or make" path after a failed load is the same as before. So the behaviour stays the same and the debug-layer id 971 noise goes away.

Nit, not blocking: the new field uses std::collections::HashSet although HashSet is already imported, and the field comment and the has_pipelines doc say the same thing twice.

CI: check passes.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 08:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1914#issuecomment-7156847781) <!-- victory-triage v1 head=3cf6b29951d181360005556115eba3db1acdf017 verdict=merge-candidate at=2026-11-25T08:18:30Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-gpu/src/pipeline/library.rs`, `pipeline()` now skips `load` when the library was made from an empty blob and the name wasn't stored during this run. On `main`, `open()` sets `_blob` to empty exactly when it falls back to `make(&[])`: either there was no blob, or the host rejected it. Such a library can only hold the names stored since then. Lookups into a library loaded from a blob are unchanged. The name is recorded only after `StorePipeline` succeeds, and the "store or make" path after a failed load is the same as before. So the behaviour stays the same and the debug-layer id 971 noise goes away. Nit, not blocking: the new field uses `std::collections::HashSet` although `HashSet` is already imported, and the field comment and the `has_pipelines` doc say the same thing twice. CI: `check` passes. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:04 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 removes the message in one case only. Message 971 (LOADPIPELINE_NAMENOTFOUND) is the expected result of every miss in the library's load-then-store design; a library loaded from a blob still gets it for each new pipeline, which covers every warm run. The complete fix for the debug-layer noise is one deny-list entry for that id on the info queue in Host::new, rather than new state in the library. This also edits library::pipeline, which three other open PRs change.

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:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/1914#issuecomment-7175893212) 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 removes the message in one case only. Message 971 (`LOADPIPELINE_NAMENOTFOUND`) is the expected result of every miss in the library's load-then-store design; a library loaded from a blob still gets it for each new pipeline, which covers every warm run. The complete fix for the debug-layer noise is one deny-list entry for that id on the info queue in `Host::new`, rather than new state in the library. This also edits `library::pipeline`, which three other open PRs change. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

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