feat(victory): automatic cold-cache shader warmup before first launch #300

Open
github-bot wants to merge 1 commit from github-bot/gh-300 into main AGit
Owner

@⁠Androtim on GitHub · 2026-12-02 00:24 UTC · original
Androtim:feat/auto-cold-cache-warmup → main · +391 −75 · 8 files · 1 commits · open

Summary

Addresses the cold-cache warmup priority in #276 so first-run testers and players after GPU driver or translator changes get an automatic shader + pipeline preload before launch instead of heavy in-game compile hitches.

  • D3D12-free warmup stamp (crates/victory-gpu, crates/victory-hle):
    • Added streamline::adapter_driver_stamp() using DXGI adapter/driver metadata without creating a D3D12 device (keeping play::load_mfg() initialization ordering intact).
    • Extracted D3D12-free shader_cache::translation_settings_stamp() and re-exported shader_cache from ictory-hle.
    • Updated pipeline::known::Book::fingerprint() to use dapter_driver_stamp() when available.
  • Automatic cold-cache detection & opt-out (pps/victory/src/{play,main}.rs):
    • Added cache_is_warm / write_preload_stamp checking preload-stamp.txt + non-empty shaders/ entries (unrelated runner updates keep warm caches warm).
    • Added play --no-preload, VICTORY_AUTO_PRELOAD=0 opt-out (preserved in KEPT and
      estart_args), and hidden preload --auto.
    • Wired automatic cold-cache warmup before play::load_mfg() and stamp persistence after Command::Preload.
  • Faster scan & clearer progress (pps/victory/src/{translate,warm}.rs):
    • Expanded may_hold_shaders extension filter to skip non-shader text/media/font assets.
    • Added time + count progress output (percentage and elapsed seconds) across shader translation and pipeline warming.

Verification

  • \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy\ -> \sset policy: 319 files ok\
  • \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin MiniVI --locked\ -> 49 passed, 0 failed
  • \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib --locked shader_cache::\ -> 3 passed, 0 failed
  • \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib --locked streamline::\ -> 17 passed, 0 failed
  • \cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --locked --all-targets -- -D warnings\ -> passed
  • \cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --locked --all-targets --features diagnostics -- -D warnings\ -> passed
  • \cargo +1.98.1-x86_64-pc-windows-gnu build --release --bin MiniVI --locked\ + \objdump -p\ -> standard Windows DLLs only; \play --help\ / \preload --help\ verified.
**@⁠Androtim** on GitHub · 2026-12-02 00:24 UTC · [original](https://github.com/Androtim/MiniVI/pull/300) `Androtim:feat/auto-cold-cache-warmup` → `main` · +391 −75 · 8 files · 1 commits · open ## Summary Addresses the cold-cache warmup priority in #276 so first-run testers and players after GPU driver or translator changes get an automatic shader + pipeline preload before launch instead of heavy in-game compile hitches. - **D3D12-free warmup stamp (crates/victory-gpu, crates/victory-hle):** - Added streamline::adapter_driver_stamp() using DXGI adapter/driver metadata without creating a D3D12 device (keeping play::load_mfg() initialization ordering intact). - Extracted D3D12-free shader_cache::translation_settings_stamp() and re-exported shader_cache from ictory-hle. - Updated pipeline::known::Book::fingerprint() to use dapter_driver_stamp() when available. - **Automatic cold-cache detection & opt-out (pps/victory/src/{play,main}.rs):** - Added cache_is_warm / write_preload_stamp checking preload-stamp.txt + non-empty shaders/ entries (unrelated runner updates keep warm caches warm). - Added play --no-preload, VICTORY_AUTO_PRELOAD=0 opt-out (preserved in KEPT and estart_args), and hidden preload --auto. - Wired automatic cold-cache warmup before play::load_mfg() and stamp persistence after Command::Preload. - **Faster scan & clearer progress (pps/victory/src/{translate,warm}.rs):** - Expanded may_hold_shaders extension filter to skip non-shader text/media/font assets. - Added time + count progress output (percentage and elapsed seconds) across shader translation and pipeline warming. ## Verification - \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy\ -> \sset policy: 319 files ok\ - \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin MiniVI --locked\ -> 49 passed, 0 failed - \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib --locked shader_cache::\ -> 3 passed, 0 failed - \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib --locked streamline::\ -> 17 passed, 0 failed - \cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --locked --all-targets -- -D warnings\ -> passed - \cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --locked --all-targets --features diagnostics -- -D warnings\ -> passed - \cargo +1.98.1-x86_64-pc-windows-gnu build --release --bin MiniVI --locked\ + \objdump -p\ -> standard Windows DLLs only; \play --help\ / \preload --help\ verified.
- Detect cold shader caches using DXGI adapter/driver identity + translation-settings stamp without initializing D3D12 prior to MFG hooks.
- Automatically invoke preload when cache is cold unless --no-preload or VICTORY_AUTO_PRELOAD=0 is set.
- Skip strictly non-shader asset extensions in translate scanner and add elapsed-time progress reporting in translate and warm.
- Verify with xtask policy, MiniVI + victory-gpu unit tests, dual clippy, release build, and objdump.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 00:29:43 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 00:50 UTC · original

Full diff (639ae869, +391 -75 across 8 files) audited and looks solid:

  • streamline::adapter_driver_stamp() and shader_cache::translation_settings_stamp() stay strictly D3D12-free before play::load_mfg().
  • play::cache_is_warm runs after play::prepare(options) and play::preload(&ready.exe, true) inherits the resolved env vars, so write_preload_stamp matches cache_is_warm deterministically while non-shader MiniVI updates keep warm caches intact.
  • --no-preload / VICTORY_AUTO_PRELOAD=0 kill-switches are preserved in KEPT and restart_args; may_hold_shaders and progress reporting look clean and 100% clean-room.

CI run 46778682482 failed solely on the known unrelated Windows runner flake (descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes); triggered gh run rerun --failed. Will merge as soon as CI finishes green.

**@⁠Androtim** on GitHub · 2026-12-02 00:50 UTC · [original](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7331017303) Full diff (`639ae869`, `+391 -75` across 8 files) audited and looks solid: - `streamline::adapter_driver_stamp()` and `shader_cache::translation_settings_stamp()` stay strictly D3D12-free before `play::load_mfg()`. - `play::cache_is_warm` runs after `play::prepare(options)` and `play::preload(&ready.exe, true)` inherits the resolved env vars, so `write_preload_stamp` matches `cache_is_warm` deterministically while non-shader `MiniVI` updates keep warm caches intact. - `--no-preload` / `VICTORY_AUTO_PRELOAD=0` kill-switches are preserved in `KEPT` and `restart_args`; `may_hold_shaders` and progress reporting look clean and 100% clean-room. CI run `46778682482` failed solely on the known unrelated Windows runner flake (`descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes`); triggered `gh run rerun --failed`. Will merge as soon as CI finishes green.
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 01:03 UTC · original · edited 2026-12-02 21:02 UTC

Automated triage for the maintainers (not an approval).

Verdict: needs-rebase · CI (check): passing

This PR no longer merges cleanly into main.

To change the verdict: Rebase onto current main and resolve conflicts; CI and triage will run again automatically.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-12-02 01:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7331267142) · edited 2026-12-02 21:02 UTC <!-- minivi-triage v1 head=ba6a9d381af42fe28e86cf8ff7a150824088c9df verdict=needs-rebase ci=passing at=2026-12-02T21:02:42Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `passing` This PR no longer merges cleanly into `main`. **To change the verdict:** Rebase onto current `main` and resolve conflicts; CI and triage will run again automatically. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 01:50 UTC · original

After merging #301 (0a9eca48), this PR now has a small rebase conflict in apps/victory/src/play.rs (KEPT env-var allowlist). Please rebase onto main (0a9eca48), fold in the quick real-GPU smoke test (cold cache auto-warmup -> warm cache skip -> --no-preload / VICTORY_AUTO_PRELOAD=0), and optionally read VICTORY_AUTO_PRELOAD after play::prepare so --set VICTORY_AUTO_PRELOAD=0 is honored too.

**@⁠Androtim** on GitHub · 2026-12-02 01:50 UTC · [original](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332164330) After merging `#301` (`0a9eca48`), this PR now has a small rebase conflict in `apps/victory/src/play.rs` (`KEPT` env-var allowlist). Please rebase onto `main` (`0a9eca48`), fold in the quick real-GPU smoke test (cold cache auto-warmup -> warm cache skip -> `--no-preload` / `VICTORY_AUTO_PRELOAD=0`), and optionally read `VICTORY_AUTO_PRELOAD` after `play::prepare` so `--set VICTORY_AUTO_PRELOAD=0` is honored too.
github-bot force-pushed github-bot/gh-300 from 639ae86978 to ba6a9d381a 2026-12-02 02:11:30 +00:00 Compare
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 02:09 UTC · original

Rebased onto \main\ (\

**@⁠Androtim** on GitHub · 2026-12-02 02:09 UTC · [original](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332533397) Rebased onto \main\ (\
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 02:20 UTC · original

Verified clean rebase onto main (0a9eca48), CI green (46792897725), and the auto_env fix moving VICTORY_AUTO_PRELOAD after play::prepare(options).

Removed triage: needs rebase. Note that your previous comment was truncated by a PowerShell \0 escape right after Rebased onto main ( — please re-post the 3-step real-GPU smoke test result (cold-cache auto-warmup + Streamline/MFG init -> warm-cache skip -> --no-preload / VICTORY_AUTO_PRELOAD=0) using a single-quoted here-string (@' ... '@) so we can verify and merge cleanly.

**@⁠Androtim** on GitHub · 2026-12-02 02:20 UTC · [original](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332723637) Verified clean rebase onto `main` (`0a9eca48`), CI green (`46792897725`), and the `auto_env` fix moving `VICTORY_AUTO_PRELOAD` after `play::prepare(options)`. Removed `triage: needs rebase`. Note that your previous comment was truncated by a PowerShell `\0` escape right after `Rebased onto main (` — please re-post the 3-step real-GPU smoke test result (cold-cache auto-warmup + Streamline/MFG init -> warm-cache skip -> `--no-preload` / `VICTORY_AUTO_PRELOAD=0`) using a single-quoted here-string (`@' ... '@`) so we can verify and merge cleanly.
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
  • crates/victory-gpu/src/shader_cache.rs
  • crates/victory-gpu/src/streamline.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-300'
git switch 'github-bot/gh-300'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-300'
git switch 'github-bot/gh-300'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-300'
git switch 'main'
git merge --squash 'github-bot/gh-300'
git switch 'main'
git merge --ff-only 'github-bot/gh-300'
git switch 'main'
git merge 'github-bot/gh-300'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Androtim--MiniVI!300
No description provided.