GPU: report pipeline creation and loads after they succeed #2957

Open
necrobytes wants to merge 1 commit from upstream-pr/2959 into main
necrobytes commented 2026-11-26 01:31:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by necrobytes on 2026-11-26T01:31:18Z.


When D3D12 cannot create a host pipeline library, VICTORY_PIPELINE_LOG writes built … loaded for a pipeline the driver just created. In a short Proton run, all ten built records said loaded after VIctory reported that the library was unavailable. A failed create could also leave a built record and increment the creation count.

Record the outcome after a successful load or create. Both creation paths share the same bookkeeping, and a failed request clears the worker’s previous diagnostic record. This matters when using the trace to decide whether a warm run reused a pipeline. It also applies to hosts where an empty library is unavailable independently of #1722.

I verified this on Fedora 45 with an RX 9060 XT, RADV 26.2.7 and Proton Experimental. The regression tests force the missing-library path even on a host that supports pipeline libraries. With the original bookkeeping, the first-create and refused-create tests both failed. With the fix, both passed. In a fresh test process, one failed create moved the cumulative creation count from 0 to 1 on main and left it at 0 with the fix. The existing synthetic placed_uav_dispatch_writes_its_texture test passed readback on both versions. Its single fresh compute pipeline changed from loaded to made in the trace.

Workspace Clippy passed on the Windows GNU target with all targets and warnings denied, both with default features and with all features enabled. The staged asset-policy check passed. An additional native Linux workspace test build stopped in the unchanged shader crate on references to its Windows-only DXIL validator.

Claimed in the coordination thread. AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6617452560 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2959). Originally posted by [necrobytes](https://github.com/necrobytes) on 2026-11-26T01:31:18Z. --- When D3D12 cannot create a host pipeline library, `VICTORY_PIPELINE_LOG` writes `built … loaded` for a pipeline the driver just created. In a short Proton run, all ten `built` records said `loaded` after VIctory reported that the library was unavailable. A failed create could also leave a `built` record and increment the creation count. Record the outcome after a successful load or create. Both creation paths share the same bookkeeping, and a failed request clears the worker’s previous diagnostic record. This matters when using the trace to decide whether a warm run reused a pipeline. It also applies to hosts where an empty library is unavailable independently of #1722. I verified this on Fedora 45 with an RX 9060 XT, RADV 26.2.7 and Proton Experimental. The regression tests force the missing-library path even on a host that supports pipeline libraries. With the original bookkeeping, the first-create and refused-create tests both failed. With the fix, both passed. In a fresh test process, one failed create moved the cumulative creation count from 0 to 1 on main and left it at 0 with the fix. The existing synthetic `placed_uav_dispatch_writes_its_texture` test passed readback on both versions. Its single fresh compute pipeline changed from `loaded` to `made` in the trace. Workspace Clippy passed on the Windows GNU target with all targets and warnings denied, both with default features and with all features enabled. The staged asset-policy check passed. An additional native Linux workspace test build stopped in the unchanged shader crate on references to its Windows-only DXIL validator. Claimed in [the coordination thread](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7179744981). AI-assisted with Codex.
fuzeofficlal commented 2026-11-26 02:06:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:50:59Z.

Review: COMMENTED


Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1) — clean fix and ready to merge:

  • Clearing LAST.set(None) at the entry of pipeline_in (crates/victory-gpu/src/pipeline/library.rs:270-308) and recording LAST only after create()? or load(...) succeeds guarantees log_built (make.rs:148) never attributes a worker's previous successful pipeline to a newly refused one.
  • Refactoring pipeline_in also lets a_pipeline_loads_while_a_save_holds_the_library and the new a_refused_pipeline_has_no_built_record run deterministically against temporary directories without relying on a pre-existing on-disk library.

Local verification:

  • cargo test --locked -p victory-gpu --lib pipeline::: 23/23 passed on both RTX 5090 and WARP (VICTORY_D3D12_DEBUG=1)
  • cargo clippy --locked -p victory-gpu --tests -- -D warnings (default & --features diagnostics): 0 warnings
  • cargo xtask policy: 191 files ok
<!-- greyfinch-sync:Marvisak/VIctory:review:6067487334 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2959#pullrequestreview-6067487334). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T01:50:59Z. **Review:** COMMENTED --- Reviewed and verified against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`) — clean fix and ready to merge: - Clearing `LAST.set(None)` at the entry of `pipeline_in` (`crates/victory-gpu/src/pipeline/library.rs:270-308`) and recording `LAST` only after `create()?` or `load(...)` succeeds guarantees `log_built` (`make.rs:148`) never attributes a worker's previous successful pipeline to a newly refused one. - Refactoring `pipeline_in` also lets `a_pipeline_loads_while_a_save_holds_the_library` and the new `a_refused_pipeline_has_no_built_record` run deterministically against temporary directories without relying on a pre-existing on-disk library. **Local verification**: - `cargo test --locked -p victory-gpu --lib pipeline::`: **23/23 passed** on both RTX 5090 and WARP (`VICTORY_D3D12_DEBUG=1`) - `cargo clippy --locked -p victory-gpu --tests -- -D warnings` (default & `--features diagnostics`): 0 warnings - `cargo xtask policy`: 191 files ok
kotekompotek commented 2026-11-26 03:04:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:24:14Z.

Review: COMMENTED


Verified the bug: LAST.set() ran before the load attempt, so a refused pipeline inherited an earlier success's record. Now LAST is cleared up front and set at each actual outcome (loaded→true, made→false, refused→None). pipeline_in's Option<&Shared> injection is a clean way to test both paths. Consistent with the panic-drain fix in #2980.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067730941 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2959#pullrequestreview-6067730941). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T02:24:14Z. **Review:** COMMENTED --- Verified the bug: LAST.set() ran before the load attempt, so a refused pipeline inherited an earlier success's record. Now LAST is cleared up front and set at each actual outcome (loaded→true, made→false, refused→None). pipeline_in's Option<&Shared> injection is a clean way to test both paths. Consistent with the panic-drain fix in #2980.
Dukestar69 commented 2026-11-26 06:02:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:45:23Z.

Review: APPROVED


Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):

  • Diff review: Clearing LAST on entry to pipeline_in and incrementing MADE / setting LAST only after create() or load() succeeds ensures failed pipeline creations are never misreported as created or loaded (and never inherit an earlier worker record).
  • cargo test -p victory-gpu --features diagnostics pipeline::library::tests -- --test-threads=1 (RTX 5090): 12 passed, 0 failed (including a_refused_pipeline_has_no_built_record).
  • VICTORY_WARP=1 cargo test -p victory-gpu --features diagnostics pipeline::library::tests -- --test-threads=1 (WARP): 12 passed, 0 failed.
  • cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6069121872 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2959#pullrequestreview-6069121872). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T05:45:23Z. **Review:** APPROVED --- Tested locally merged onto `origin/main` (`63bcca4`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP): - Diff review: Clearing `LAST` on entry to `pipeline_in` and incrementing `MADE` / setting `LAST` only after `create()` or `load()` succeeds ensures failed pipeline creations are never misreported as created or loaded (and never inherit an earlier worker record). - `cargo test -p victory-gpu --features diagnostics pipeline::library::tests -- --test-threads=1` (RTX 5090): 12 passed, 0 failed (including `a_refused_pipeline_has_no_built_record`). - `VICTORY_WARP=1 cargo test -p victory-gpu --features diagnostics pipeline::library::tests -- --test-threads=1` (WARP): 12 passed, 0 failed. - `cargo clippy -p victory-gpu --features diagnostics --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Marvisak commented 2026-11-26 06:03:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:25:42Z.


Automated triage for the maintainers.

Merge candidate (recommending a look, not approving). On main, library::pipeline in crates/victory-gpu/src/pipeline/library.rs sets the diagnostics LAST record to loaded before it knows the outcome. Without a library, it then returns create() with that record still saying loaded, and it bumps MADE even when the create fails. With this PR, MADE/LOADED and LAST are recorded only after a load or create succeeds, and a failed request clears LAST, so make::log_built writes nothing for it. The new pipeline_in split lets the tests force the no-library path; a_refused_pipeline_has_no_built_record and the extended load-during-save test check the records the log should show. CI check passes.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183476225 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2959#issuecomment-7183476225). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:25:42Z. --- <!-- victory-triage v1 head=1355a2a0ff4944261056cb1e3d1f6166a71d1a3f verdict=merge-candidate at=2026-11-26T05:27:00Z --> Automated triage for the maintainers. **Merge candidate** (recommending a look, not approving). On `main`, `library::pipeline` in `crates/victory-gpu/src/pipeline/library.rs` sets the diagnostics `LAST` record to `loaded` before it knows the outcome. Without a library, it then returns `create()` with that record still saying `loaded`, and it bumps `MADE` even when the create fails. With this PR, `MADE`/`LOADED` and `LAST` are recorded only after a load or create succeeds, and a failed request clears `LAST`, so `make::log_built` writes nothing for it. The new `pipeline_in` split lets the tests force the no-library path; `a_refused_pipeline_has_no_built_record` and the extended load-during-save test check the records the log should show. CI `check` passes. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2959:upstream-pr/2959'
git switch 'upstream-pr/2959'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2959'
git switch 'upstream-pr/2959'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2959'
git switch 'upstream-pr/2959'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2959'
git switch 'main'
git merge --squash 'upstream-pr/2959'
git switch 'main'
git merge --ff-only 'upstream-pr/2959'
git switch 'main'
git merge 'upstream-pr/2959'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2957
No description provided.