perf(launcher): restrict warm-state fingerprint to shader-cache variables #434

Open
github-bot wants to merge 5 commits from github-bot/gh-434 into main AGit
Owner

@⁠mauroalvare on GitHub · 2026-11-26 18:43 UTC · original
mauroalvare:perf/launcher-warm-state-cache-keys → main · +221 −16 · 1 files · 5 commits · open

Change

Restricts warm_state::env_key() in crates/anyxboxx-launcher/src/warm_state.rs to the VICTORY_* variables that actually affect victory warm (base c3cc029).

Previously, warm_state::env_key() excluded only VICTORY_GAME_DIR and VICTORY_LOG and hashed every other VICTORY_* variable into warm-state.txt. As a result, changing any runtime-only Play-page option — Resolution (VICTORY_DISPLAY_MODE), Windowed/Borderless (VICTORY_WINDOW_MODE), Keyboard layout (VICTORY_KEYBOARD), Stats overlay (VICTORY_OVERLAY), Auto-A (VICTORY_AUTO_A), Frametime CSV (VICTORY_FRAMETIME_DUMP), Preset (Fast / Quality / 12 GB card / 8 GB card), XG library (VICTORY_XG_DLL, VICTORY_XG_MODE), or non-shader runtime switches like VICTORY_RELAY — changed the smart-warm fingerprint and forced a redundant ~7-minute victory warm pass on the next launch, even though VIctory's shader cache key (shader_cache::build + victory_shader::emit::translation_fingerprint) and compute pipeline warm filters (pipeline/make.rs::left_out) were identical.

What changed:

  • warm_state::env_key() now hashes only VICTORY_* keys that can change victory warm's output:
    • cache location/key (VICTORY_CACHE_DIR, VICTORY_CONFIG, VICTORY_SHADER_CACHE_KEY),
    • compute pipeline warm filters (VICTORY_ACTIVATE_RAYS, VICTORY_BVH_BUILDER, VICTORY_RT_RESOLVE, VICTORY_SKIP_PIPELINES),
    • host wave/view overrides (VICTORY_HOST_MAX_WAVE, VICTORY_HOST_WAVE, VICTORY_VIEW_LIMIT, VICTORY_WARP),
    • shader translator switches read by third_party/victory/crates/victory-shader/src.
  • Added warm_state::tests::every_shader_translator_switch_is_in_the_warm_key, which scans third_party/victory/crates/victory-shader/src (following the same pattern as options::tests::every_variable_an_option_names_exists_in_victorys_sources) so any future shader translator switch added to VIctory cannot be missed.

Linked issue: N/A

Verification

Base reproduction (c3cc029, before the fix):

cargo test -p anyxboxx-launcher play_page_runtime_options_do_not_invalidate_the_warm_marker
-> FAILED. 0 passed; 1 failed
   runtime-only Play options (P1080, Borderless, Azerty, overlay=false, auto_a=true, frametime_dump=true)
   changed fingerprint from "b622455edb98ba77" to "6635182b93cddf12"

After the fix:

cargo test -p anyxboxx-launcher                                -> ok. 213 passed; 0 failed; 1 ignored (0.42s)
cargo clippy -p anyxboxx-launcher --all-targets -- -D warnings -> Finished `dev` profile (0 warnings)

Note: detached::tests::sleeper is the launcher's helper test marked #[ignore]. Pure CPU launcher unit tests on Windows x64 (Ryzen 7 9700X, RTX 5070 Ti, 32 GB RAM).

Oracle and test data

New unit tests in crates/anyxboxx-launcher/src/warm_state.rs use synthetic temporary directories and check fingerprint across Play-page runtime options, presets (Quality, MidVram, LowVram), and real cache-affecting switches (VICTORY_SHADER_OPT, VICTORY_RT_RESOLVE, VICTORY_CACHE_DIR, VICTORY_SKIP_PIPELINES), plus a source check against third_party/victory/crates/victory-shader/src. Fails on base c3cc029 and passes with this change. No game, console, or SDK files were used.

Checklist

  • The PR covers a single reviewable behaviour.
  • A test fails without this change and passes with it.
  • The commands and results of each check are given above.
  • An unimplemented function returns an error (E_NOTIMPL), never a fake success.
  • README: the same change in all 9 languages (test_readme_sync.py checks it).
  • No game, console or SDK file, no key, no dump, no download link.
  • Findings drawn from a title: limited to what rule 2 of AGENTS.md allows (names, slots, argument shapes, flag values, HRESULTs, IIDs, counts), with how they were obtained; no address or RVA.
  • Code taken from another project: compatible licence and credit in THIRD_PARTY.md.

Made with AI assistance (Antigravity).

**@⁠mauroalvare** on GitHub · 2026-11-26 18:43 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/434) `mauroalvare:perf/launcher-warm-state-cache-keys` → `main` · +221 −16 · 1 files · 5 commits · open ## Change Restricts `warm_state::env_key()` in `crates/anyxboxx-launcher/src/warm_state.rs` to the `VICTORY_*` variables that actually affect `victory warm` (base `c3cc029`). Previously, `warm_state::env_key()` excluded only `VICTORY_GAME_DIR` and `VICTORY_LOG` and hashed every other `VICTORY_*` variable into `warm-state.txt`. As a result, changing any runtime-only Play-page option — Resolution (`VICTORY_DISPLAY_MODE`), Windowed/Borderless (`VICTORY_WINDOW_MODE`), Keyboard layout (`VICTORY_KEYBOARD`), Stats overlay (`VICTORY_OVERLAY`), Auto-A (`VICTORY_AUTO_A`), Frametime CSV (`VICTORY_FRAMETIME_DUMP`), Preset (`Fast` / `Quality` / `12 GB card` / `8 GB card`), XG library (`VICTORY_XG_DLL`, `VICTORY_XG_MODE`), or non-shader runtime switches like `VICTORY_RELAY` — changed the smart-warm fingerprint and forced a redundant ~7-minute `victory warm` pass on the next launch, even though VIctory's shader cache key (`shader_cache::build` + `victory_shader::emit::translation_fingerprint`) and compute pipeline warm filters (`pipeline/make.rs::left_out`) were identical. What changed: - `warm_state::env_key()` now hashes only `VICTORY_*` keys that can change `victory warm`'s output: - cache location/key (`VICTORY_CACHE_DIR`, `VICTORY_CONFIG`, `VICTORY_SHADER_CACHE_KEY`), - compute pipeline warm filters (`VICTORY_ACTIVATE_RAYS`, `VICTORY_BVH_BUILDER`, `VICTORY_RT_RESOLVE`, `VICTORY_SKIP_PIPELINES`), - host wave/view overrides (`VICTORY_HOST_MAX_WAVE`, `VICTORY_HOST_WAVE`, `VICTORY_VIEW_LIMIT`, `VICTORY_WARP`), - shader translator switches read by `third_party/victory/crates/victory-shader/src`. - Added `warm_state::tests::every_shader_translator_switch_is_in_the_warm_key`, which scans `third_party/victory/crates/victory-shader/src` (following the same pattern as `options::tests::every_variable_an_option_names_exists_in_victorys_sources`) so any future shader translator switch added to VIctory cannot be missed. Linked issue: N/A ## Verification Base reproduction (`c3cc029`, before the fix): ``` cargo test -p anyxboxx-launcher play_page_runtime_options_do_not_invalidate_the_warm_marker -> FAILED. 0 passed; 1 failed runtime-only Play options (P1080, Borderless, Azerty, overlay=false, auto_a=true, frametime_dump=true) changed fingerprint from "b622455edb98ba77" to "6635182b93cddf12" ``` After the fix: ``` cargo test -p anyxboxx-launcher -> ok. 213 passed; 0 failed; 1 ignored (0.42s) cargo clippy -p anyxboxx-launcher --all-targets -- -D warnings -> Finished `dev` profile (0 warnings) ``` Note: `detached::tests::sleeper` is the launcher's helper test marked `#[ignore]`. Pure CPU launcher unit tests on Windows x64 (Ryzen 7 9700X, RTX 5070 Ti, 32 GB RAM). ## Oracle and test data New unit tests in `crates/anyxboxx-launcher/src/warm_state.rs` use synthetic temporary directories and check `fingerprint` across Play-page runtime options, presets (`Quality`, `MidVram`, `LowVram`), and real cache-affecting switches (`VICTORY_SHADER_OPT`, `VICTORY_RT_RESOLVE`, `VICTORY_CACHE_DIR`, `VICTORY_SKIP_PIPELINES`), plus a source check against `third_party/victory/crates/victory-shader/src`. Fails on base `c3cc029` and passes with this change. No game, console, or SDK files were used. ## Checklist - [x] The PR covers a single reviewable behaviour. - [x] A test fails without this change and passes with it. - [x] The commands and results of each check are given above. - [x] An unimplemented function returns an error (`E_NOTIMPL`), never a fake success. - [x] README: the same change in all 9 languages (`test_readme_sync.py` checks it). - [x] No game, console or SDK file, no key, no dump, no download link. - [x] Findings drawn from a title: limited to what rule 2 of `AGENTS.md` allows (names, slots, argument shapes, flag values, HRESULTs, IIDs, counts), with how they were obtained; no address or RVA. - [x] Code taken from another project: compatible licence and credit in `THIRD_PARTY.md`. Made with AI assistance (Antigravity).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:46:57 +00:00
github-bot force-pushed github-bot/gh-434 from ac568c361b to 34d23eacf0 2026-11-26 20:24:58 +00:00 Compare
github-bot changed title from perf(launcher): restrict warm-state fingerprint to shader-cache variables to perf(launcher): key shader precompilation on cache-relevant settings 2026-11-26 20:33:54 +00:00
github-bot changed title from perf(launcher): key shader precompilation on cache-relevant settings to perf(launcher): restrict warm-state fingerprint to shader-cache variables 2026-11-27 00:37:43 +00:00
github-bot force-pushed github-bot/gh-434 from 34d23eacf0 to 488ad7401d 2026-11-27 00:37:43 +00:00 Compare
Author
Owner

@⁠LooperSalty on GitHub · 2026-11-26 23:21 UTC · original

Thanks! After #454 moved third_party/victory to the Vice-Tay base, this PR's own test (every_shader_translator_switch_is_in_the_warm_key) fails in CI: eleven translator switches of the new base are missing from CACHE_KEYS. Adding them makes the test pass locally (17/17 in warm_state):

    // Translator switches of the Vice-Tay base (#454).
    "VICTORY_BVH_BOUNDS",
    "VICTORY_BVH_FENCES",
    "VICTORY_HELPER_OWN",
    "VICTORY_LDS_FLAGS",
    "VICTORY_NAN_GUARD",
    "VICTORY_PC_DXC",
    "VICTORY_PORT_CBV",
    "VICTORY_RDNA_FLOAT",
    "VICTORY_THREAD_TICKET",
    "VICTORY_WAVE_DUMP",
    "VICTORY_WAVE_WIDE_ONLY",

VICTORY_WAVE_WIDE_ONLY matters most: anyxboxx run sets it now. Could you add them after "VICTORY_WAVE_WIDE",? Then it is ready to merge.

🤖 Review by Claude Code on behalf of the maintainer

**@⁠LooperSalty** on GitHub · 2026-11-26 23:21 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/434#issuecomment-7205471984) Thanks! After #454 moved `third_party/victory` to the Vice-Tay base, this PR's own test (`every_shader_translator_switch_is_in_the_warm_key`) fails in CI: eleven translator switches of the new base are missing from `CACHE_KEYS`. Adding them makes the test pass locally (17/17 in `warm_state`): ```rust // Translator switches of the Vice-Tay base (#454). "VICTORY_BVH_BOUNDS", "VICTORY_BVH_FENCES", "VICTORY_HELPER_OWN", "VICTORY_LDS_FLAGS", "VICTORY_NAN_GUARD", "VICTORY_PC_DXC", "VICTORY_PORT_CBV", "VICTORY_RDNA_FLOAT", "VICTORY_THREAD_TICKET", "VICTORY_WAVE_DUMP", "VICTORY_WAVE_WIDE_ONLY", ``` `VICTORY_WAVE_WIDE_ONLY` matters most: `anyxboxx run` sets it now. Could you add them after `"VICTORY_WAVE_WIDE",`? Then it is ready to merge. _🤖 Review by [Claude Code](https://claude.com/claude-code) on behalf of the maintainer_
Author
Owner

@⁠mauroalvare on GitHub · 2026-11-26 23:37 UTC · original

Thanks for updating the branch against #454 and checking the new switch set. 488ad74 includes the Vice-Tay options that affect warming, including VICTORY_WAVE_WIDE_ONLY, and uses VICTORY_SHADER_KEY for the cache mode. VICTORY_WAVE_DUMP only emits diagnostics, so its value stays out of the fingerprint. All 17 warm-state tests passed locally.

**@⁠mauroalvare** on GitHub · 2026-11-26 23:37 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/434#issuecomment-7205707770) Thanks for updating the branch against #454 and checking the new switch set. `488ad74` includes the Vice-Tay options that affect warming, including `VICTORY_WAVE_WIDE_ONLY`, and uses `VICTORY_SHADER_KEY` for the cache mode. `VICTORY_WAVE_DUMP` only emits diagnostics, so its value stays out of the fingerprint. All 17 warm-state tests passed locally.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/434/head:github-bot/gh-434'
git switch 'github-bot/gh-434'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-434'
git switch 'github-bot/gh-434'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-434'
git switch 'github-bot/gh-434'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-434'
git switch 'main'
git merge --squash 'github-bot/gh-434'
git switch 'main'
git merge --ff-only 'github-bot/gh-434'
git switch 'main'
git merge 'github-bot/gh-434'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.