Launcher: shaders, warm and preload run on their own apply the defaults play applies #1971
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!1971
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1971"
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?
@eleboucher on GitHub · 2026-11-29 04:57 UTC · original
eleboucher:warm-keyed→main· +8 −2 · 1 files · 42 commits · openFixes #
What it changes
victory playputs its defaults table (SETTINGSinplay.rs) into the environment. Three of those defaults are part of the shader cache key inshader_cache.rsbuild():VICTORY_EARLY_DEPTH=1,VICTORY_NAN_SCRUB=1andVICTORY_BVH_MISS=1.victory shaders,victory warmandvictory preloadrun on their own did not apply them, so they translated and made pipelines under another key. A defaultplayafterwards missed every translation and the driver compiled again during the start; on a new translator that can last long enough for the title's 30 s hang watchdog (+0x23cf683, see #628).These three commands now apply what a plain
playapplies, through the samesettings()(defaults table plusvictory-settings.txt). A variable already set in the environment is kept, so warming under another value still works.play --preloadis unchanged: thepreloadit starts already has the start's environment.How it was tested
playvictory shadersthenvictory warm --used, thenplay):shaders from the cache and translated so far hits=0 misses=1709, and some pipelines took 20-44 s to make during the start568c5e5d, same sequence with none of the three variables set in the shell:shaderstranslated 25763 shaders fresh (116 s), thenplayloggedhits=1924 misses=0andhost pipelines all made made=1621 loaded=1113cargo test: not run forapps/victory;cargo xwin check --workspace --all-targetsand clippy onvictorypassChecked for overlap
warmonly and copies EARLY_DEPTH, AMBIENT_SPECULAR and WATER_LIGHT by hand, so it misses NAN_SCRUB and BVH_MISS; this one reusessettings()and coversshaders,warmandpreload), #549 (closed)@davemathews12 on GitHub · 2026-11-30 06:03 UTC · original
This fixes a real problem. #3451 is full of people who ran
victory.exe preload/warmby hand from a plain shell. Their caches are keyed without play's translator switches (VICTORY_BVH_MISS,VICTORY_NAN_SCRUB,VICTORY_EARLY_DEPTH,VICTORY_SAMPLED_MARKSare all named in the translator, so all are intranslation_fingerprint), and the game then compiles everything again in play.One interaction to guard against: the script launcher.
scripts\play-foxhound.ps1sets its own switch table, runsvictory preloadin that environment, and then starts the game withvictory run.rundoesn't callapply_defaults. Becauseapply_defaultsfills in every play default the environment lacks, the launcher's preload would gain any translator switch that play sets and the launcher doesn't. Its cache would then no longer match the game the launcher starts.That's already the case on
mainforVICTORY_SAMPLED_MARKS(andVICTORY_BVH_MISS/VICTORY_NAN_SCRUBuntil #3411 or #2722 lands). #3411 leavesSAMPLED_MARKSout of the launcher on purpose ("with them the save point took 2.7 GB more"), so the gap is meant to stay.Suggestion: apply the defaults only when none of play's settings are in the environment. That is a command typed in a plain shell; the launcher,
victory playand the F1 restart always set them. For example:With that, a hand-typed preload matches
victory play, and a launcher's preload keeps matching the launcher's own game.@eleboucher on GitHub · 2026-11-30 07:08 UTC · original
Thanks, done as you suggested:
apply_defaultsnow returns when any of play's settings is already in the environment, and otherwise fills them all. A hand-typedpreload/warm/shadersgets play's keys;play, the F1 restart andplay-foxhound.ps1keep their own switch table, so the launcher's cache still matches the game it starts withvictory run. Also merged main. The redcheckis main's own clippy errors (unwind_copy,victory-shaderanalysis.rs/native.rs), which #2048 clears.@ -1369,0 +1383,4 @@let Ok(home) = home() else { return };let menu = parse_menu(&std::fs::read_to_string(home.join("victory-settings.txt")).unwrap_or_default());let (s, _) = settings(&Plain::parse_from(["play"]).play, &menu, None);if s.keys().any(|k| std::env::var_os(k).is_some()) {@andrewpozdnakov7-jpg on GitHub · 2026-11-30 10:28 UTC · original
#3884 reproduces on the exact release/main
41adb551. All four listed switches are present inplayand in the cache-key path. I ran the production settings logic andshader_cache::translation()in separate Windows fixture processes. Play defaults Cache key inputsplaykey prefix43ddf8eba9a8c02701189934b9bc314fa6e5ddb, clean environment01189934b9bc314f01189934b9bc314fVICTORY_EARLY_DEPTH=043ddf8eba9a8c027125747ae336d4ee0The last case exits here because one setting is present. The override survives, but
NAN_SCRUB,SAMPLED_MARKS, andBVH_MISSremain unset. Its matching launch usesplay --set VICTORY_EARLY_DEPTH=0and has all three at1.I tested using the existing
VICTORY_MENU_PLAYmarker to recognize the two launchers' prepared environment, and filling only missing variables in a standalone shell. Clean preload still matches play. The single override now matches125747ae336d4ee0. A launcher-marked child retains its deliberately partial table and the same key8e34f419fb8fc944. The 28 existingplay::testspassed. Script launcher markerCould we use the launcher marker here, or have the existing launchers pass an explicit equivalent, so a standalone caller can keep one override and fill the remaining defaults? The fixture checked key equality. A gameplay preload run remains a separate check.
If you reuse this regression case or follow-up, please retain its authorship with
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@eleboucher on GitHub · 2026-11-30 10:30 UTC · original
Thanks, that is the better rule; done in
8b5d771dfollowing your suggestion (credit for the regression case and the marker idea is yours):apply_defaultsreturns whenVICTORY_MENU_PLAYis set (play/F1 restart set it at play.rs:1149,play-foxhound.ps1at line 310), and otherwise fills only the variables the shell did not set. So a clean standalone preload keys likeplay, a standalone shell with one override keeps it and gets the other defaults, and a launcher-marked child keeps its own table.victoryclippy is clean here; I have not re-run your key fixture.victory preloadrun on its own translates withoutvictory play's defaults, so the next start translates the shaders again #3884@andrewpozdnakov7-jpg on GitHub · 2026-11-30 10:35 UTC · original
Retested the exact updated head
8b5d771don Windows. All five fixture processes produced the expected keys. Clean preload and play both used01189934b9bc314f. With onlyVICTORY_EARLY_DEPTH=0, preload and the matching play launch both used125747ae336d4ee0. The launcher-marked child kept its partial environment and8e34f419fb8fc944.This resolves the environment-override case I raised. Thanks for the update.
@eleboucher on GitHub · 2026-11-30 14:58 UTC · original
Merged main (
c71899d9), no conflicts. Main already carriesapply_defaultsand its call, so this PR's diff is now only theVICTORY_MENU_PLAYearly return in play.rs.apply_defaultsreads play's currentSETTINGS, so the 14 entriesc71899d9turned on are covered; none of them is in the translation cache key. Windowscargo xwin check -p victory(with and without diagnostics) passes; the play:: and warm:: tests pass on Windows.victory preloadrun on its own translates withoutvictory play's defaults, so the next start translates the shaders again #3884@andrewpozdnakov7-jpg on GitHub · 2026-11-30 15:34 UTC · original
I reran the five Windows cache-key scenarios on release main
c71899dand the exact PR head2c45596. The fixture uses the launcher defaults and the production shader translation key.8e237e33026210df8e237e33026210dfVICTORY_EARLY_DEPTH=0: preload and playd9b08adeabe58304d9b08adeabe58304VICTORY_MENU_PLAYandSAMPLED_MARKSabsentSAMPLED_MARKS=1, keyd9b08adeabe58304b5e4de90a09821acThe remaining guard in this PR fixes the prepared-launcher case on release main. Standalone commands still fill in missing defaults and preserve explicit overrides. The scoped Windows test runs on the PR passed 29 launcher tests and 12 warm-up tests.
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.