Skip to content

GPU: persist early-pipeline keys even without a host pipeline library - #1429

Closed
fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/early-pipeline-keys-without-library-768
Closed

fuzeofficlal wants to merge 1 commit into
Marvisak:mainfrom
fuzeofficlal:fix/early-pipeline-keys-without-library-768

Conversation

@fuzeofficlal

Copy link
Copy Markdown
Contributor

Fixes #768.

Summary

  • Decouple early-pipelines.txt persistence from library() in pipeline::library::save so hosts or compatibility layers where ID3D12PipelineLibrary1 is unavailable (or fails serialization) still atomically write sorted early-pipelines.txt keys whenever USED_CHANGED is set.
  • Only advance the SAVE_EVERY throttle timestamp when dirty state exists, and restore USED_CHANGED on directory or atomic-write errors.

Verification

  • Added early_pipeline_keys_persist_and_reload_without_a_host_library testing library == None persistence, deduplicated sorted output, and next-launch reload via wanted_early across RTX 5090, AMD Radeon(TM) Graphics, and D3D12 WARP.
  • cargo clippy --workspace --all-targets --all-features and cargo xtask policy: passed.

edsuuu referenced this pull request in edsuuu/VI-BR-PORT Nov 24, 2026
…ine library

Ported onto our background saver: the early list is written when the host
has no pipeline library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Filip722

Filip722 commented Nov 25, 2026 •

Copy link
Copy Markdown

I tested the Windows MSVC build of 48bf0d7 under Proton Experimental 11.0-20261112 on Bazzite 44, RTX 5060 Laptop GPU, driver 615.78.08 and vkd3d-proton ec20719. The new missing-library test passed, including reloading the saved keys. The focused library suite on the PR head was 2 passed and 1 failed. The failure was the existing rejected-blob test at empty library creation.

Adding only #347 (197c7ac) to the same head gave 3 passed and 0 failed in the same suite (0.82 s). This covers the missing-library path through the regression fixture. OpenAI Codex assisted with the build, tests and report.

I also pushed a test-only follow-up on this PR head. It forces directory creation and atomic replacement to fail, removes each obstruction and verifies the original keys are saved and reloaded. Removing the dirty-flag restoration on a failed write reproduced the expected test failure. Restoring it passed on the same Proton setup (0.81 s). Cherry-pickable test commit.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. It merges cleanly. On main, library::save (crates/victory-gpu/src/pipeline/library.rs) returns early when library() is None, so a run where the host refuses the pipeline library never writes early-pipelines.txt, and the next launch has nothing to start early (#768, measured under Proton). The PR splits the saving into save_to. The early list is written whenever USED_CHANGED was set, with or without a library. USED_CHANGED is restored when the directory or the write fails. The library path behaves as before. I checked it against note_used and wanted_early on main. One point for the maintainer: early_pipeline_keys_persist_and_reload_without_a_host_library sets the process-wide DIR to a temp directory and depends on the global USED_CHANGED. Any other test in the same binary that reaches make.rs note_used or save can race with its first assertion, and later saves go to the deleted temp path. A test-local cache path would make it robust.

CI: passing (check).


Generated by Claude Code

Decouple saving `early-pipelines.txt` from `ID3D12PipelineLibrary1` in
`crates/victory-gpu/src/pipeline/library.rs` so runs without a host
pipeline library (or when library serialisation fails) still atomically
record used title pipeline keys in MRU order for warmup on the next
launch.

Closes Marvisak#768.
@fuzeofficlal
fuzeofficlal force-pushed the fix/early-pipeline-keys-without-library-768 branch from 48bf0d7 to 88ecb4c Compare November 25, 2026 04:05
Ortomanic pushed a commit to Ortomanic/victory-fork that referenced this pull request Nov 25, 2026
Consume the dirty flag with the key snapshot and restore it when writing the snapshot fails. A forced save can then persist the same keys after a temporary filesystem obstruction clears.

Exercise the actual cache filename and retry without recording another key. Ported from the VIctory handoff and the retry test on Marvisak/VIctory#1429 with assistance from OpenAI Codex (GPT-6.2-astra).

(cherry picked from commit 6ca01748abf0daddf4c6ea804f932d9f85e8159d)
Ortomanic pushed a commit to Ortomanic/victory-fork that referenced this pull request Nov 25, 2026
Consume the dirty flag with the key snapshot and restore it when writing the snapshot fails. A forced save can then persist the same keys after a temporary filesystem obstruction clears.

Exercise the actual cache filename and retry without recording another key. Ported from the VIctory handoff and the retry test on Marvisak/VIctory#1429 with assistance from OpenAI Codex (GPT-6.2-astra).

(cherry picked from commit 6ca01748abf0daddf4c6ea804f932d9f85e8159d)
Ortomanic pushed a commit to Ortomanic/victory-fork that referenced this pull request Nov 25, 2026
Consume the dirty flag with the key snapshot and restore it when writing the snapshot fails. A forced save can then persist the same keys after a temporary filesystem obstruction clears.

Exercise the actual cache filename and retry without recording another key. Ported from the VIctory handoff and the retry test on Marvisak/VIctory#1429 with assistance from OpenAI Codex (GPT-6.2-astra).

(cherry picked from commit 6ca01748abf0daddf4c6ea804f932d9f85e8159d)
@Marvisak

Copy link
Copy Markdown
Owner

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 serves no host once the cause is fixed. On Windows library() is None only without a GPU or without ID3D12Device1, and then no pipeline is made either. The case measured in #768 is Wine/vkd3d-proton refusing the non-null empty blob, which #1722 fixes directly. This also rewrites save(), which several other open PRs change, and its test sets the process-wide DIR to a temporary directory and asserts on the global USED_CHANGED, so other tests in the same binary can race it.

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

@Marvisak Marvisak closed this Nov 25, 2026
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.

Contribution access for a tested Proton early-pipeline cache fix

3 participants