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

Open
Androtim wants to merge 1 commit from upstream-pr/300 into main
Androtim commented 2026-12-02 00:24:54 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T00:24:54Z.


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.
<!-- greyfinch-sync:Androtim/MiniVI:issue:5597230212 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T00:24:54Z. --- ## 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 commented 2026-12-02 00:50:29 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T00:50:29Z.


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.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7331017303 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7331017303). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T00:50:29Z. --- 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 commented 2026-12-02 01:03:37 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T01:03:37Z.


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).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7331267142 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7331267142). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T01:03:37Z. --- <!-- 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`)._
Androtim commented 2026-12-02 01:50:18 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T01:50:18Z.


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.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7332164330 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332164330). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T01:50:18Z. --- 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 commented 2026-12-02 02:09:25 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T02:09:25Z.


Rebased onto \main\ (\

<!-- greyfinch-sync:Androtim/MiniVI:comment:7332533397 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332533397). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T02:09:25Z. --- Rebased onto \main\ (\
Androtim commented 2026-12-02 02:20:10 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T02:20:10Z.


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.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7332723637 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/300#issuecomment-7332723637). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-02T02:20:10Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/300:upstream-pr/300'
git switch 'upstream-pr/300'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/300'
git switch 'upstream-pr/300'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/300'
git switch 'upstream-pr/300'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/300'
git switch 'main'
git merge --squash 'upstream-pr/300'
git switch 'main'
git merge --ff-only 'upstream-pr/300'
git switch 'main'
git merge 'upstream-pr/300'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Androtim/MiniVI!300
No description provided.