warm --used fills the host pipeline library, and its done marks leave out the exe path (VICTORY_WARM_SHARED; off by default) #1618

Merged
Jesper-Andersson merged 1 commit from upstream-pr/1618 into main 2026-11-29 08:16:55 +00:00
Jesper-Andersson commented 2026-11-28 22:25:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Jesper-Andersson on 2026-11-28T22:25:02Z.


Relates to #1483 (the warm-mark half; the translator-key half is #1581)

What it changes

As #1483 describes, warm's done marks are keyed by the full path of the running victory.exe, so every new install folder or worktree warms all used pipelines again (about 4,250 pipelines, about 6.5 minutes here). On top of that, warm --used does not fill the host pipeline library. This PR is one commit in apps/victory/src/warm.rs (plus a note in docs/findings.md), all behind VICTORY_WARM_SHARED=1. It is off by default; unset, the marks are exactly as before, and a unit test pins the old mark value.

  • With VICTORY_WARM_SHARED=1, warm --used also stores every pipeline its workers made in the host pipeline library (host-pipelines.bin). Library entries are named by their DXIL, root signature and state, not by the exe.
  • The mark for such a pipeline is written only after a library save that contains it, so an interrupted pass keeps true marks.
  • The shared mark leaves the exe path out: it hashes the existing translator/driver/samplers fingerprint, the card and the word shared-library.
  • A shared mark counts only while the library file exists. The check looks in VICTORY_LIBRARY_DIR when that names a folder (the shared library folder proposed in #1583), and otherwise in the pipelines folder. The done marks stay in the pipelines folder, as #1583 keeps the early and slow lists per cache folder. On main without #1583, nothing writes the library into VICTORY_LIBRARY_DIR, so setting that variable alone only makes the shared marks not count; it is meant for use together with #1583.
  • Without --used, the switch prints that it doesn't apply. VICTORY_WARM_LIBRARY_THREADS (1 to 16, default 8) sets how many threads make the library entries.

The library is written through the existing library code (known::use_library / keep_library), into the cache folders under cache_dir (cache_subdir, which already checks victory_core::ensure_outside_repo). Nothing is written in the repository. With #1583 merged, these saves go through its writer lock unchanged.

The second half of #1483's cause, translator-key churn from test and comment edits, is left to #1581 (see below). This branch no longer carries our own version of that.

How it was tested

  • GPU and profile: RTX 2070 SUPER 8 GB, Windows 11, Series S, 1080p output, DLSS Performance, no ray tracing.
  • Before: a second worktree with the same translator warms all used pipelines again (about 6.5 minutes, measured earlier on our fork, as in #1483; not re-measured on this branch).
  • After (in game): not measured yet.
  • After: unit tests cover the mark (the shared mark ignores the exe path, follows the translator/driver/card and differs from the default mark; the default mark keeps its old value) and the library folder (VICTORY_LIBRARY_DIR followed when set and not empty). A release build passes. Pending: the in-game check that a second worktree on the same cache folder finds every mark and the library and has "0 to make". This PR stays a draft until that check is done.
  • For shader changes, the wave sizes tested: N/A (no translator changes).
  • cargo test passed for the crates it touches: yes (victory: 34 + 2 passed)
  • cargo clippy --no-deps -p victory: -p victory --all-targets -- -D warnings is clean (no new warnings).
  • cargo xtask policy: fails on upstream main's own crates/victory-shader/src/emit/lower.rs (667,523 bytes, over the 640 KiB limit; #1429; the open #1493 and #1527 fix it). Nothing this PR adds trips it, and the pre-commit asset check passed for every file it changes.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1581, #1583, #1253, #1001, #779, #1505, #1084, #1489
    • #1581 (translator key skips comments, tests and unrelated lock entries) covers the test-file part of #1483's churn in victory-gpu/build.rs, so this PR leaves it out. #1581 does not touch victory-shader/build.rs, which keeps its own fingerprint of all of src. That could be a small follow-up there.
    • #1583 (shared library folder VICTORY_LIBRARY_DIR with a writer lock) shares one library between cache folders. It doesn't fill the library from warm and doesn't change the warm marks. This PR is the warm side: it fills the library and finds it in the shared folder when #1583's variable is set. The two combine without changes.
    • #1253 (preload used pipelines by default) edits warm.rs at the preload entry. Different function, complementary.
    • #1001 (warm inherits victory-settings.txt and play shader defaults) edits warm.rs around the settings. Its fingerprint feeds this PR's mark unchanged.
    • #779 (quarantine follows the fingerprint) edits the bad-pipeline bookkeeping next to the done marks. Expect a small textual conflict, no logic conflict.
    • #1505 (preload progress against a real total) and #1084 (bound preload library workers) touch preload and warm.rs progress. Independent.
    • #1489 (warm shader cache reads without a metadata probe, draft) is in shader_cache.rs / victory-pipeline. Different files.

This was written with AI assistance (Claude Code).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5545168327 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1618). Originally posted by [Jesper-Andersson](https://github.com/Jesper-Andersson) on 2026-11-28T22:25:02Z. --- <!-- Labels: pr-fix, startup, shaders (in the title, as the template asks). --> Relates to #1483 (the warm-mark half; the translator-key half is #1581) ## What it changes As #1483 describes, `warm`'s done marks are keyed by the full path of the running `victory.exe`, so every new install folder or worktree warms all used pipelines again (about 4,250 pipelines, about 6.5 minutes here). On top of that, `warm --used` does not fill the host pipeline library. This PR is one commit in `apps/victory/src/warm.rs` (plus a note in `docs/findings.md`), all behind `VICTORY_WARM_SHARED=1`. It is off by default; unset, the marks are exactly as before, and a unit test pins the old mark value. - With `VICTORY_WARM_SHARED=1`, `warm --used` also stores every pipeline its workers made in the host pipeline library (`host-pipelines.bin`). Library entries are named by their DXIL, root signature and state, not by the exe. - The mark for such a pipeline is written only after a library save that contains it, so an interrupted pass keeps true marks. - The shared mark leaves the exe path out: it hashes the existing translator/driver/samplers fingerprint, the card and the word `shared-library`. - A shared mark counts only while the library file exists. The check looks in `VICTORY_LIBRARY_DIR` when that names a folder (the shared library folder proposed in #1583), and otherwise in the pipelines folder. The done marks stay in the pipelines folder, as #1583 keeps the early and slow lists per cache folder. On main without #1583, nothing writes the library into `VICTORY_LIBRARY_DIR`, so setting that variable alone only makes the shared marks not count; it is meant for use together with #1583. - Without `--used`, the switch prints that it doesn't apply. `VICTORY_WARM_LIBRARY_THREADS` (1 to 16, default 8) sets how many threads make the library entries. The library is written through the existing library code (`known::use_library` / `keep_library`), into the cache folders under `cache_dir` (`cache_subdir`, which already checks `victory_core::ensure_outside_repo`). Nothing is written in the repository. With #1583 merged, these saves go through its writer lock unchanged. The second half of #1483's cause, translator-key churn from test and comment edits, is left to #1581 (see below). This branch no longer carries our own version of that. ## How it was tested - GPU and profile: RTX 2070 SUPER 8 GB, Windows 11, Series S, 1080p output, DLSS Performance, no ray tracing. - Before: a second worktree with the same translator warms all used pipelines again (about 6.5 minutes, measured earlier on our fork, as in #1483; not re-measured on this branch). - After (in game): not measured yet. - After: unit tests cover the mark (the shared mark ignores the exe path, follows the translator/driver/card and differs from the default mark; the default mark keeps its old value) and the library folder (`VICTORY_LIBRARY_DIR` followed when set and not empty). A release build passes. **Pending:** the in-game check that a second worktree on the same cache folder finds every mark and the library and has "0 to make". This PR stays a draft until that check is done. - For shader changes, the wave sizes tested: N/A (no translator changes). - `cargo test` passed for the crates it touches: yes (victory: 34 + 2 passed) - `cargo clippy --no-deps -p victory`: `-p victory --all-targets -- -D warnings` is clean (no new warnings). - `cargo xtask policy`: fails on upstream main's own `crates/victory-shader/src/emit/lower.rs` (667,523 bytes, over the 640 KiB limit; #1429; the open #1493 and #1527 fix it). Nothing this PR adds trips it, and the pre-commit asset check passed for every file it changes. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1581, #1583, #1253, #1001, #779, #1505, #1084, #1489 - #1581 (translator key skips comments, tests and unrelated lock entries) covers the test-file part of #1483's churn in `victory-gpu/build.rs`, so this PR leaves it out. #1581 does not touch `victory-shader/build.rs`, which keeps its own fingerprint of all of `src`. That could be a small follow-up there. - #1583 (shared library folder `VICTORY_LIBRARY_DIR` with a writer lock) shares one library between cache folders. It doesn't fill the library from `warm` and doesn't change the warm marks. This PR is the warm side: it fills the library and finds it in the shared folder when #1583's variable is set. The two combine without changes. - #1253 (preload used pipelines by default) edits `warm.rs` at the preload entry. Different function, complementary. - #1001 (warm inherits `victory-settings.txt` and play shader defaults) edits `warm.rs` around the settings. Its fingerprint feeds this PR's mark unchanged. - #779 (quarantine follows the fingerprint) edits the bad-pipeline bookkeeping next to the done marks. Expect a small textual conflict, no logic conflict. - #1505 (preload progress against a real total) and #1084 (bound preload library workers) touch preload and `warm.rs` progress. Independent. - #1489 (warm shader cache reads without a metadata probe, draft) is in `shader_cache.rs` / `victory-pipeline`. Different files. This was written with AI assistance (Claude Code).
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!1618
No description provided.