Pipeline library: stores go on during a save, and the library is rebuilt past 1 GB #919
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/919"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by 0xkn0wh3r3 on 2026-11-28T09:05:54Z.
Why
The host pipeline library (
ID3D12PipelineLibrary1) only grows. It has no way to take a pipeline out, and every change of a translation stores its pipelines under new names beside the old ones. On an RTX 5070 Ti (16 GB) after some weeks of play the library held 80,703 pipelines in 4.78 GB, of which a run loaded about 1,000.Every save serialises the whole library. So:
What
Three commits:
VICTORY_LIBRARY_STORE_LATER=0: as before).VICTORY_LIBRARY_SAVE_S=20: as before). This overlaps #81, which spaces saves out during bursts of new pipelines and under memory pressure; the two can live together, or this part can go if #81 lands first.VICTORY_LIBRARY_KEEP_MB, default 1024;0: never). The pipelines the run loaded or made are written into a fresh library, which replaces the file. A run that used fewer than 1,000 pipelines (one that ended at the menu) leaves the library alone, so it does not lose the world's pipelines.victory preloadstill saves the whole library and never rebuilds. The early list still names the title's other pipelines, so the next run starts them early, as before. Those no longer in the library are compiled then, which the driver's own disk cache makes quick where it holds them.The rebuild line also counts names that came again and pipelines the new library refused.
Before / after
At the end of a play run on that RTX 5070 Ti:
4.78 GB to 25 MB. That run had loaded 1,199 pipelines and made 1,394, and that line could not say why only 928 were kept. It also predates the last commit, which counts repeated names (a pipeline the title makes twice is loaded twice) and refused stores, so the next log will say.
Correctness
a_rebuilt_library_holds_the_pipelines_it_was_given(needs a GPU): a library rebuilt from a list that names one pipeline twice holds it once, refuses it a second time, and opens again from its serialised bytes.only_large_libraries_of_runs_that_reached_the_world_are_rebuilt,saves_of_large_libraries_wait_longer: the thresholds.cargo test --workspace --locked --no-fail-fast: every crate passes, 0 failures (victory-gpu: 456 passed).modules::dstorage::tests::a_read_into_memory_guarded_for_a_moment_is_tried_again(victory-hle, untouched here) failed once in an earlier run, then passed in this one and three runs on its own.cargo clippy --workspace --all-targets --locked -- -D warningsstops at two findings that fail onmainalready (shadow.rs:1708manual_is_multiple_of,victory-shader/src/emit/mod.rs:2768let_and_return; #630 fixes them), and with--all-featuresat a third (descriptor.rs:1234manual_is_multiple_of). It reports nothing in the files this PR changes.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T09:21:32Z.
Review: APPROVED
Tested locally merged onto
main(63b902f).cargo xtask policypassed (294 files ok).cargo test -p victory-gpu --lib pipeline::passed (28 passed; 0 failed, includingonly_large_libraries_of_runs_that_reached_the_world_are_rebuilt,saves_of_large_libraries_wait_longer,a_rebuilt_library_holds_the_pipelines_it_was_given, andconcurrent_write_atomically_never_fails_or_truncates) with 0 compiler warnings.Great pipeline-library scaling and non-blocking save/rebuild behavior past 1 GB. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.