play: keep VICTORY_KEEP_OLD_SHADERS from environment across prepare #4388
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!4388
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4387"
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?
@nidea1 on GitHub · 2026-11-30 19:35 UTC · original
nidea1:fix/keep-old-shaders-env→main· +10 −2 · 2 files · 2 commits · openFollow-up to #4232 (reported by @Kwaarckmoon).
What it changes
play::clear_stale_shaderschecksVICTORY_KEEP_OLD_SHADERS=1from the environment, andplay::preloadspawns a childvictory preloadprocess that runs the same check. However, onvictory play,clear_stale_shadersruns insideplay::prepare(..).and_then(..), afterprepareclears every inheritedVICTORY_*variable not listed inKEPT. BecauseVICTORY_KEEP_OLD_SHADERSwas not inKEPT, settingVICTORY_KEEP_OLD_SHADERS=1in the caller's environment was silently stripped and the old shader cache was still deleted (only--set VICTORY_KEEP_OLD_SHADERS=1or a line invictory-settings.txtworked)."VICTORY_KEEP_OLD_SHADERS"toKEPTinapps/victory/src/play.rsso the environment variable survivesplay::prepare(and any childvictory preloadspawned byplay), while an explicit--set VICTORY_KEEP_OLD_SHADERS=...orvictory-settings.txtline still overrides it.play::tests::play_keeps_the_storage_paths_when_resetting_switchesto coverVICTORY_KEEP_OLD_SHADERScase-insensitively.How it was tested
apps/victory); launcher env-handling fix (no runtime GPU change).stale_switch("VICTORY_KEEP_OLD_SHADERS")returnedtrue, soplay::preparestripped inheritedVICTORY_KEEP_OLD_SHADERS=1beforeclear_stale_shadersran.stale_switch("VICTORY_KEEP_OLD_SHADERS")andstale_switch("victory_keep_old_shaders")returnfalse, keeping the env var intact forclear_stale_shadersand childpreload.cargo testpassed for the crates it touches: yes (cargo test -j 4 -p victory --locked: 91/91 unit + 3/3 integration tests passed;cargo clippy -j 4 -p victory --all-targets --locked --no-deps -- -D warnings: 0 warnings;cargo run -p xtask -- policy --staged: 1 files ok).Checked for overlap
KEPT, does not includeVICTORY_KEEP_OLD_SHADERS).@babuakhil on GitHub · 2026-11-30 19:55 UTC · original
Checked on Windows 11 (Rust 1.98.1, pinned), on
main(e1251c31), which this is based on.cargo test -p victorypasses (91 unit, 1 + 2 integration), andcargo clippy -p victory --all-targets --no-deps -- -D warningsis clean. Not tested in the game.The order is as described. In
main.rs'sCommand::Playarm,play::prepareruns first and removes every nameleftovers()returns, which isstale_switchover the environment, and only then doesplay::clear_stale_shaders(named_cache)readVICTORY_KEEP_OLD_SHADERS. The other switches that arm needs (VICTORY_PRELOAD,VICTORY_CLEAR_SHADERS,VICTORY_CACHE_DIR) are read beforepreparefor that reason, and this one was missed. With theKEPTline taken back out, the extended test fails (stale_switch("victory_keep_old_shaders")is true), and with it the test passes.Keeping it in
KEPT, rather than reading it beforepreparelike the other three, also carries it into thevictory preloadchild, whose ownclear_stale_shaders(theShaders | Warm | Preloadarm) reads the same variable. So this is the better of the two ways to fix it.89e4e282f1to2afbf6da3c@andrewpozdnakov7-jpg on GitHub · 2026-12-01 10:10 UTC · original
The PowerShell launcher has the same gap as the native launcher.
play-nvidia.ps1removesVICTORY_KEEP_OLD_SHADERSbefore eitherwarm --usedorpreloadentersclear_stale_shaders. I added the setting to the script's existing preserved environment entries in 41de5c1588b861b59c4cc6b23b859d3c8018129f, directly on your2afbf6dahead. Review commitIn Windows PowerShell 5.1, I ran the exact environment filter with synthetic entries. Your head selected both uppercase and lowercase spellings of the setting for removal. The updated filter kept both and still selected an unrelated flag for removal. The script parsed and the one-file staged policy check passed.
The commit is ready to include here if you want both launchers to honor the setting. Please preserve the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding it in.AI-assisted with OpenAI Codex.
@nidea1 on GitHub · 2026-12-01 10:55 UTC · original
Thanks @andrewpozdnakov7-jpg! Cherry-picked onto this branch as
9eceadf7b2(from41de5c1588) with your original Git author preserved. Verifiedscripts/play-nvidia.ps1parses cleanly with CRLF preserved, along withcargo test --locked -p victory,cargo clippy --locked -p victory --all-targets -- -D warnings, andcargo xtask policy.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.