Warm-up mark: keyed on victory.exe's length and modified time, not its bytes hashed at every start #924

Open
0xkn0wh3r3 wants to merge 2 commits from upstream-pr/924 into main
0xkn0wh3r3 commented 2026-11-28 09:09:41 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 0xkn0wh3r3 on 2026-11-28T09:09:41Z.


Why

Every victory play start read and hashed the whole of victory.exe (11 MB) just to name its warm-up mark (%LOCALAPPDATA%\victory\warmed\<hash>). That took about 7.5 ms per start, on every start, to answer one question: has this build been warmed up yet?

What

  • warmup_mark now names the mark warmed\<length>-<modified time>: the exe's length in bytes and its last-write time (in 100 ns units since 1970).
  • A build writes the exe anew, so its time changes and it gets a mark of its own, even when the length is the same.
  • A copy keeps the time (Explorer, copy), so it keeps the mark, as before.
  • Trade-off: a copy that gets a fresh modified time, such as a new download of the same build, warms up once more.
  • When you upgrade: marks made under the old naming aren't found. That's harmless: a new exe needs its own warm-up anyway.

Tests

  • play::tests::a_rebuilt_exe_has_a_warmup_mark_of_its_own:
    • the same exe keeps its mark;
    • other bytes written later get another mark, even at the same length;
    • another length at the same time gets another mark;
    • a missing exe gets no mark.
  • Benchmark play::tests::bench_warmup_mark (ignored), on an 11 MB file, 5 rounds alternating with the old read-and-hash, 21 calls each:
    • before: medians 7.2 / 7.4 / 7.6 / 7.9 / 8.9 ms
    • after: 0.04–0.06 ms

CI steps run locally on this branch:

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
  • The same with --all-features: passes.
  • cargo test --workspace --locked --no-fail-fast: 1,125 passed, 2 failed, 50 ignored. The 2 failures are in crates this PR doesn't touch, and both pass 3 out of 3 when run alone; the machine was fully loaded at the time:
    • victory-loader threads::tests::exit_ends_the_other_threads_first
    • victory-gpu watch::tests::writes_in_partly_committed_view_blocks_are_reported

Clippy: the four findings that stop CI on main (Rust 1.98) is the same commit as in #816 and #819. Without it, main itself fails clippy. Drop it if main fixes them first.

Not covered: not yet tried with a real rebuild and play start. The test sets the modified times by hand.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5538601738 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/924). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-28T09:09:41Z. --- ## Why Every `victory play` start read and hashed the whole of `victory.exe` (11 MB) just to name its warm-up mark (`%LOCALAPPDATA%\victory\warmed\<hash>`). That took about 7.5 ms per start, on every start, to answer one question: has this build been warmed up yet? ## What - `warmup_mark` now names the mark `warmed\<length>-<modified time>`: the exe's length in bytes and its last-write time (in 100 ns units since 1970). - A build writes the exe anew, so its time changes and it gets a mark of its own, even when the length is the same. - A copy keeps the time (Explorer, `copy`), so it keeps the mark, as before. - **Trade-off:** a copy that gets a fresh modified time, such as a new download of the same build, warms up once more. - **When you upgrade:** marks made under the old naming aren't found. That's harmless: a new exe needs its own warm-up anyway. ## Tests - `play::tests::a_rebuilt_exe_has_a_warmup_mark_of_its_own`: - the same exe keeps its mark; - other bytes written later get another mark, even at the same length; - another length at the same time gets another mark; - a missing exe gets no mark. - Benchmark `play::tests::bench_warmup_mark` (ignored), on an 11 MB file, 5 rounds alternating with the old read-and-hash, 21 calls each: - before: medians 7.2 / 7.4 / 7.6 / 7.9 / 8.9 ms - after: 0.04–0.06 ms **CI steps run locally on this branch:** - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - The same with `--all-features`: passes. - `cargo test --workspace --locked --no-fail-fast`: 1,125 passed, 2 failed, 50 ignored. The 2 failures are in crates this PR doesn't touch, and both pass 3 out of 3 when run alone; the machine was fully loaded at the time: - victory-loader `threads::tests::exit_ends_the_other_threads_first` - victory-gpu `watch::tests::writes_in_partly_committed_view_blocks_are_reported` `Clippy: the four findings that stop CI on main (Rust 1.98)` is the same commit as in #816 and #819. Without it, `main` itself fails clippy. Drop it if `main` fixes them first. **Not covered:** not yet tried with a real rebuild and play start. The test sets the modified times by hand.
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/924:upstream-pr/924'
git switch 'upstream-pr/924'

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/924'
git switch 'upstream-pr/924'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/924'
git switch 'upstream-pr/924'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/924'
git switch 'main'
git merge --squash 'upstream-pr/924'
git switch 'main'
git merge --ff-only 'upstream-pr/924'
git switch 'main'
git merge 'upstream-pr/924'
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
trustno1-coder/VIctory-NVIDIA!924
No description provided.