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

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

@⁠fuzeofficlal on GitHub · 2026-11-24 17:58 UTC · original
fuzeofficlal:fix/early-pipeline-keys-without-library-768 → main · +146 −37 · 1 files · 1 commits · closed without merging

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.
**@⁠fuzeofficlal** on GitHub · 2026-11-24 17:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/1429) `fuzeofficlal:fix/early-pipeline-keys-without-library-768` → `main` · +146 −37 · 1 files · 1 commits · closed without merging 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.
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 #768.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:31:23 +00:00
github-bot closed this pull request 2026-11-26 04:31:23 +00:00
Author
Owner

@⁠Filip722 on GitHub · 2026-11-25 00:28 UTC · original · edited 2026-11-25 00:32 UTC

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.

**@⁠Filip722** on GitHub · 2026-11-25 00:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1429#issuecomment-7148554915) · edited 2026-11-25 00:32 UTC 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](https://github.com/Filip722/VIctory/commit/02415cb4586fd6fed7c7afe4c7f06930ff10ec2e).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:27 UTC · original · edited 2026-11-25 06:27 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 01:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/1429#issuecomment-7149569548) · edited 2026-11-25 06:27 UTC <!-- victory-triage v1 head=88ecb4cfdd8a7f806eef65b74a5eef688e1f89c3 verdict=merge-candidate at=2026-11-25T06:27:45Z --> 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](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 22:01 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 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** on GitHub · 2026-11-25 22:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/1429#issuecomment-7175833005) 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.

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