Pipeline library: a run's end keeps a preload's library for the same translations #3895
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3895"
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 Trillazill on 2026-11-30T10:48:33Z.
What this changes
pipeline::library::finishrebuilds the library from the pipelines the run used once it is overVICTORY_LIBRARY_KEEP_MB(1,024 MB) and the run used 1,000 or more. That is right for a library full of names of earlier translations: the RTX run inkeep_bytes's comment had 80,703 pipelines, of which it loaded 986. It is wrong for a library a preload just filled. Every name in it is current, and one walk's rebuild threw away the places the walk did not visit. In #3883: 5,658 pipelines, 1,158 MB, rebuilt to 2,225 (164 MB). Those places then compiled again in play, at 566–1,023 ms a pipeline.Now:
known::keep_libraryis what bothvictory preloadpaths call: the periodic save during the fill and the final one. After saving, it writeshost-pipelines.preloadedbeside the library, holdingshader_cache::translation(). That is the hash of the translator's sources and of every switch that changes a translation, so it also decides the pipelines' names.compactreturns before rebuilding when that marker names the translations of this run, and says so:host pipeline library not rebuilt: a preload filled it for these translations.play's (#3884) also has a different marker. In that case its pipelines aren't the ones play uses, and the rebuild goes ahead as well.VICTORY_LIBRARY_KEEP_MBandCOMPACT_LEASTare unchanged.Tests
pipeline::library::tests::a_preloaded_library_is_kept_while_its_translations_are_current. It covers the same marker, a marker with a line ending, a changed translator, no marker, and an empty one.cargo test -p victory-gpu --lib -- pipeline::library::: 14 pass.-p victory-gpu --lib --tests): nothing in the lines this change adds or touches.cargo xtask policy --staged: ok (2 files).VICTORY_LIBRARY_KEEP_MB=100so that a 388 MB library is over the line:victory play --preload: the preload put 2,856 of 2,856 pipelines in the library in 2.9 min and wrote the marker.COMPACT_LEAST. At the end it loggedhost pipeline library not rebuilt: a preload filled it for these translations ... bytes=387625628 used=2921, and the file stayed at 387,625,628 bytes. Without the marker,compacts(387625628, 2921, 100 MB)is true, and the run would have rebuilt the library from its 2,921 pipelines.No game data, logs or other files from the title are in this change.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Trillazill on 2026-12-01T06:21:44Z.
Rebased onto main
5fabb46e. Conflict inlibrary.rs: main moved the rebuild intocompact_to_dir; the marker check sits before it, and the marker is removed after a written rebuild. Tests on the rebased branch:cargo test -p victory-gpu --lib -- pipeline::library::21 pass;cargo clippy -p victory-gpu --lib --testsno errors.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gut0to on 2026-12-01T15:24:14Z.
Code review location:
crates/victory-gpu/src/pipeline/known.rs; line 532Could the marker be written only after confirming the library was serialized?
save(true)returns no status, andsave_library()can return Ok(0) when it cannot acquire the writer lock.keep_library()then still writes the current translation marker, so a later run can skip compaction even though the preload never persisted its complete library. Please propagate a confirmed-save result before writing this marker and cover the skipped-writer path in a test.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gut0to on 2026-12-01T15:24:14Z.
Review: COMMENTED
AI-assisted review: I traced the preload save, writer-lock fallback, and later compaction skip. I used AI assistance and verified the incomplete-save path in the current source.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T15:35:24Z.
On
cf9b91b6, the binary library is saved in the active adapter directory whilehost-pipelines.preloadedis written in the shared root. That can protect another adapter’s library. The root marker is also written after a skipped or failed save.e2747fd2 publishes the marker after the binary library is successfully saved, beside that adapter’s file and under the same writer lock. Compaction checks and clears the adapter’s marker under that lock as well. Changing translations still permits a rebuild.
A focused Windows fixture ran the exact file save, marker and compaction code with two synthetic adapter directories and a stub serializer. A failed save left the prior binary untouched and produced no marker. The matching adapter kept its library, the other adapter could compact, and switching translations rebuilt the first and removed its stale marker. The fixture also confirmed that compaction defers while another writer holds the lock. The staged asset policy passed.
Please keep the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change in.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.