play: keep title pipeline book across translator updates and stamp standalone preload #4231
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4231"
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 nidea1 on 2026-11-30T17:37:53Z.
Related: #4176, #4184, #4150
What it changes
Two regressions in
5baad7e3(clear_stale_shaders) broke pipeline preloading after a translator update:clear_stale_incalledclear_shaders_in, which removes all ofcache/pipelines/— wiping the translator-independent title records (known-pipelines.bin,known-shaders.bin,early-pipelines.txt,slow-pipelines.txt,static-samplers.txt) right beforeplay::preloadran.warm::runthen saw0 pipelines known, built 0 host pipelines, andfinish_preloadstill recorded the exe as warmed, leaving the game to compile every pipeline live during play.clear_stale_innow deletes only translator-dependent artifacts:cache/shaders/,cache/pipelines/adapters/,cache/pipelines/host-pipelines.*,cache/pipelines/warm-done.txt, andcache/pipelines/warm-bad.txt, while keeping the title's recorded pipeline book intact sopreloadcan rebuild all known pipelines for the new translator.clear_shaders(victory clear-shaders/ F1CLEAR SHADER CACHE) keeps its full-folder removal behavior unchanged.victory preload/shaders/warmnever cleared stale artifacts or stampedtranslator.txt. Runningvictory preload(directly or throughscripts\play-nvidia.ps1 -Preload) populated the cache for the new translator without updatingtranslator.txt, so the very nextvictory playsaw a missing/stale mark and deleted the freshly preloaded cache.main.rsnow callsplay::clear_stale_shaders(named_cache)alongsideplay::apply_defaults()for top-levelCommand::Shaders,Command::Warm(these: None, skipping per-chunk worker subprocesses), andCommand::Preload, preservingVICTORY_CACHE_DIRandVICTORY_KEEP_OLD_SHADERS=1.(Note: this PR intentionally does not alter
play.rs's existingVICTORY_FRAMEGEN == 1automatic preload condition documented in #3941.)How it was tested
apps/victory), plus end-to-end verification ofclear_stale_inagainst a populated cache fixture containing both stale host artifacts and the five pipeline-book files.cache/pipelines/known-pipelines.bin,known-shaders.bin,early-pipelines.txt,slow-pipelines.txt, andstatic-samplers.txt, causing the subsequent preload to warm 0 pipelines; standalonevictory preloadlefttranslator.txtunstamped so the nextvictory playwiped its output.clear_stale_indeletesshaders/,pipelines/adapters/,pipelines/host-pipelines.*,warm-done.txt, andwarm-bad.txt, preserves all five pipeline-book files andimages/, writestranslator.txt, and is a no-op when re-run under the same translator ID. Standaloneshaders/warm/preloadclear stale artifacts and stamptranslator.txtbefore building.cargo testpassed for the crates it touches: yes (cargo test -p victory: 90/90 unit + 3/3 integration tests passed;cargo clippy -p victory --tests: 0 warnings inapps/victory;cargo run -p xtask -- policy --staged: 2 files ok).Checked for overlap
clear_stale_shaders/translator.txtor5baad7e3.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-30T17:50:44Z.
Also verified end-to-end on a live translator upgrade (RTX 3060 Ti 8 GB, Windows 11, Series S, DLSS Quality, FSR 3 FG, RT off):
victory.exe preloadafter upgrading across a translator change freed 10.9 GB of stale translated shaders and old host pipeline libraries while preserving all five title pipeline-book files (known-pipelines.bin,known-shaders.bin,early-pipelines.txt,slow-pipelines.txt,static-samplers.txt), stampedcache/translator.txt, and rebuilt 4,095/4,212 pipelines into a fresh 692 MB host pipeline library in 44 s.victory.exe playsaw the matchingtranslator.txt, kept the freshly preloaded cache intact, mapped the 692 MB pipeline library at startup, and reached steady play with no shader-compilation warning.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kwaarckmoon on 2026-11-30T17:57:50Z.
One more case this PR doesn't cover: on
play,VICTORY_KEEP_OLD_SHADERS=1set in the environment has no effect.clear_stale_shadersruns insideplay::prepare(..).and_then(..), afterpreparehas removed inheritedVICTORY_*variables, andVICTORY_KEEP_OLD_SHADERSis not inKEPT. So only--set VICTORY_KEEP_OLD_SHADERS=1or a line invictory-settings.txtkeeps the cache; the env var (as the doc comment suggests) is silently ignored. Reading it beforeprepare, next tonamed_cache, or adding it toKEPTwould fix it.Seen on v2026.11.30.02 (RTX 3070, Win 11):
playwith the env var set still printed "the old shader cache (8965 MB) was deleted".Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-30T19:35:20Z.
Good catch @Kwaarckmoon — adding
VICTORY_KEEP_OLD_SHADERStoKEPTalso preserves it for the childvictory preloadprocess spawned byplay::preload(which runsclear_stale_shaderstoo), while--set/victory-settings.txtstill override it.Opened follow-up PR #4387 to fix this on
main.