Skip to content

GPU: report pipeline creation and loads after they succeed - #2959

Open
necrobytes wants to merge 1 commit into
Marvisak:mainfrom
necrobytes:fix/pipeline-log-outcomes
Open

necrobytes wants to merge 1 commit into
Marvisak:mainfrom
necrobytes:fix/pipeline-log-outcomes

Conversation

@necrobytes

@necrobytes necrobytes commented Nov 26, 2026 •

Copy link
Copy Markdown

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.

Signed-off-by: necrobytes <11080534+necrobytes@users.noreply.github.com>

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 kotekompotek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Owner

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

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants