Pipeline library: a run's end keeps a preload's library for the same translations #3895
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3895
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Trillazill on GitHub · 2026-11-30 10:48 UTC · original
Trillazill:fix/library-keeps-preload→main· +59 −1 · 2 files · 1 commits · openWhat 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
Pipeline library: a run's end keeps a preload's library for the same translations (#3883)to Pipeline library: a run's end keeps a preload's library for the same translations4ba9a4462dtocf9b91b6ba@Trillazill on GitHub · 2026-12-01 06:21 UTC · original
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.@gut0to on GitHub · 2026-12-01 15:24 UTC · original · reviewed
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.
@ -529,2 +529,4 @@/// translations of now: a run's end leaves it whole (#3883).pub fn keep_library() {super::library::save(true);super::library::note_preloaded();@gut0to on GitHub · 2026-12-01 15:24 UTC · original
Could 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.@andrewpozdnakov7-jpg on GitHub · 2026-12-01 15:35 UTC · original
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.