GPU: save early pipeline list without re-serialising the library #3179
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3181"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:21:27Z.
Summary
pipeline::library::savepreviously checkedl.added == 0 && !l.prebuilt_changed && !USED_CHANGED.swap(false, Ordering::Relaxed)underlibrary.state, and then unconditionally calledGetSerializedSize(), allocated a buffer, calledID3D12PipelineLibrary1::Serialize(), and rewrotehost-pipelines.bineven whenadded == 0and onlyearly-pipelines.txt(USED_CHANGED) had changed. In addition, ifzeroed(size)orSerialize()failed and returned early,USED_CHANGEDhad already been cleared so theearly-pipelines.txtupdate was lost.Fix
l.added > 0 || l.prebuilt_changedand releaselibrary.statebefore calling a helpersave_files.USED_CHANGEDindependently by writingearly-pipelines.txtwithout serializing or rewritinghost-pipelines.binwhen the library itself has no new pipelines; restoreUSED_CHANGED = trueif creating the directory or writingearly-pipelines.txtfails so a later save retries.library_changedis true, keepingearly-pipelines.txtintact even if serialization fails or runs out of memory.Verification
Added three deterministic unit tests in
crates/victory-gpu/src/pipeline/library.rs:saving_only_the_early_list_skips_the_librarysaving_the_early_list_survives_failed_serializationsaving_the_early_list_retries_after_an_io_errorRan:
cargo test --locked -p victory-gpu pipeline::library -- --test-threads=1: 14 passed, 0 failedcargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default and--no-default-features): cleancargo test -p xtask --locked policy::tests::repository_passes_policy: passedImported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T11:26:59Z.
Review: APPROVED
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib pipeline::library:: -- --test-threads=1: 14/14 passed (includingsaving_only_the_early_list_skips_the_library,saving_the_early_list_retries_after_an_io_error, andsaving_the_early_list_survives_failed_serialization).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly saves the early pipeline list independently without re-serializing the full pipeline library.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by steven-seagull27 on 2026-11-26T12:05:02Z.
Confirmed
8a216f5across fresh processes on the RTX 5080 and Windows inbox WARP. An early-list-only save left the compiled binary untouched on both. When I held the early list open during a full save and released it before the retry, the next process recognized all 3/3 prebuilt keys, loaded all three PSOs from the disk cache and read back 96/96 correct words. Repeated twice per adapter.Writing the early list independently makes a measurable difference here: the overlapping #3188 head loses all three prebuilt keys under the same one-time sharing violation. Four-revision comparison and reusable restart test
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T14:59:45Z.
I combined your exact
8a216f5with #3751 at948e7b3inae4cb99. Both heads are direct parents. The merge routes the no-library fallback through yoursave_fileshelper, with the library-change argument false. Your helper also handles the retry after an early-list write fails.All 15 pipeline-library tests passed on Windows with WARP 1.0.22 and Agility 1.620.2. That includes your three independent-save tests and the new two-process test. The new test simulates an unavailable native library, retries after an I/O failure, and checks that both keys are recognized in a fresh process. Both strict GPU Clippy configurations and the asset policy also passed.
The combined commit is available for merge coordination. Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding my change into another commit.AI-assisted with OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.