Warm --used fills the host pipeline library by default; library marks leave out the exe path (#1483) #4199

Open
github-bot wants to merge 3 commits from github-bot/gh-4198 into main AGit
Owner

@⁠t91a60 on GitHub · 2026-11-30 17:21 UTC · original
t91a60:orchestrator/issue-1483/warm-library → main · +120 −23 · 4 files · 3 commits · open

Refs #1483 (closed as stale, but its cause is still on main).

What it changes

Issue #1483: warm's done bookkeeping is keyed by the full path of the running victory.exe, so a build in a new folder re-warms every used pipeline (~4,250, ~6.5 min). Its second half: plain warm --used never fills the host pipeline library (host-pipelines.bin).

This is the warm half, in apps/victory/src/warm.rs plus two small helpers:

  • warm --used now fills the host pipeline library by default (fill_library, the same use_library/keep_library calls preload's into_library uses). VICTORY_WARM_SHARED=0 restores the old behaviour (off by default, as in #1618).
  • A pipeline is marked done by the driver cache's path-keyed fingerprint and, once a library save holds it, by a library fingerprint that leaves the program path out (translator/driver/samplers + card). The library itself names a pipeline by its translated code, root signature and state (pipeline/library::name), so the library key was already content-hashed and path-free; the warm mark now matches it.
  • A warm reads both kinds of marks. Library marks count only while this adapter's saved library is actually on disk, so a deleted library does not suppress the warm. That check is a new small helper (library::saved -> known::library_saved) because the library is saved under a per-adapter folder (adapters/<kind>-<vendor>-<device>-<subsys>-<rev>/host-pipelines.bin), not at the pipelines folder's root.
  • The driver-cache mark (and the quarantine fingerprint) stay keyed by the program path, deliberately: the driver cache may depend on it. VICTORY_WARM_SHARED=0 keeps writing only that mark.

Translator hash

No change: the shader-cache key (VICTORY_TRANSLATOR in crates/victory-gpu/build.rs) already skips comments and #[cfg(test)] modules and hashes only the Cargo.lock packages the translator uses (that was #1581). crates/victory-shader/build.rs still hashes raw sources into VICTORY_SHADER_SOURCE_HASH, but that value is not part of the shader-cache key, and stripping tests there would need real parsing, so it is left alone.

Risk / conservative choices

  • This flips a default. The first warm --used after the update pays the in-process library pass once (the workers have already put the pipelines in the driver cache, so the pass should mostly be cache hits); after that, any folder sharing the cache folder sees the library marks and makes nothing. VICTORY_WARM_SHARED=0 opts out.
  • A user who already has path marks and an empty library sees 0 to make and the library is not back-filled until the next new pipeline, --again, or a folder with a different path warms. Documented in docs/findings.md.
  • The library marks are also card-keyed, so two cards still keep separate marks.

How it was tested

Unverified: this machine has no cargo/rustc (cargo, rustc are not on PATH and no toolchain is under %USERPROFILE%\.cargo). Nothing was compiled or run. Please run on a machine with the pinned toolchain:

cargo test --locked -p victory
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked

New unit tests (not executed here):

  • warm_shared_is_on_unless_it_is_zero - VICTORY_WARM_SHARED is on unless exactly 0.
  • done_marks_read_the_driver_and_the_library - path marks always count; library marks count only when the library file is present.
  • Existing mark tests still pin the old path-based value for VICTORY_WARM_SHARED=0.

git diff --check is clean. Asset policy was not run (needs the workspace tool); the change adds no binary or large file.

Checked for overlap

  • #1618 (merged): added the library pass and exe-free marks behind VICTORY_WARM_SHARED=1, off by default. This PR turns the same machinery on by default, adds the path mark beside the library mark, and fixes the library-presence check for the per-adapter library folder.
  • #2731 (merged): marks by pipeline content; unchanged.
  • #1583 (open): VICTORY_LIBRARY_DIR; the new presence check follows the same folder choice.
  • #1581 (merged): translator key skips comments/tests; no change here.
**@⁠t91a60** on GitHub · 2026-11-30 17:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4198) `t91a60:orchestrator/issue-1483/warm-library` → `main` · +120 −23 · 4 files · 3 commits · open Refs #1483 (closed as stale, but its cause is still on `main`). ## What it changes Issue #1483: `warm`'s done bookkeeping is keyed by the full path of the running `victory.exe`, so a build in a new folder re-warms every used pipeline (~4,250, ~6.5 min). Its second half: plain `warm --used` never fills the host pipeline library (`host-pipelines.bin`). This is the warm half, in `apps/victory/src/warm.rs` plus two small helpers: - `warm --used` now fills the host pipeline library by default (`fill_library`, the same `use_library`/`keep_library` calls `preload`'s `into_library` uses). `VICTORY_WARM_SHARED=0` restores the old behaviour (off by default, as in #1618). - A pipeline is marked done by the driver cache's path-keyed fingerprint **and**, once a library save holds it, by a library fingerprint that leaves the program path out (translator/driver/samplers + card). The library itself names a pipeline by its translated code, root signature and state (`pipeline/library::name`), so the library key was already content-hashed and path-free; the warm mark now matches it. - A warm reads both kinds of marks. Library marks count only while this adapter's saved library is actually on disk, so a deleted library does not suppress the warm. That check is a new small helper (`library::saved` -> `known::library_saved`) because the library is saved under a per-adapter folder (`adapters/<kind>-<vendor>-<device>-<subsys>-<rev>/host-pipelines.bin`), not at the pipelines folder's root. - The driver-cache mark (and the quarantine fingerprint) stay keyed by the program path, deliberately: the driver cache may depend on it. `VICTORY_WARM_SHARED=0` keeps writing only that mark. ### Translator hash No change: the shader-cache key (`VICTORY_TRANSLATOR` in `crates/victory-gpu/build.rs`) already skips comments and `#[cfg(test)]` modules and hashes only the `Cargo.lock` packages the translator uses (that was #1581). `crates/victory-shader/build.rs` still hashes raw sources into `VICTORY_SHADER_SOURCE_HASH`, but that value is not part of the shader-cache key, and stripping tests there would need real parsing, so it is left alone. ## Risk / conservative choices - This flips a default. The first `warm --used` after the update pays the in-process library pass once (the workers have already put the pipelines in the driver cache, so the pass should mostly be cache hits); after that, any folder sharing the cache folder sees the library marks and makes nothing. `VICTORY_WARM_SHARED=0` opts out. - A user who already has path marks and an empty library sees `0 to make` and the library is not back-filled until the next new pipeline, `--again`, or a folder with a different path warms. Documented in `docs/findings.md`. - The library marks are also card-keyed, so two cards still keep separate marks. ## How it was tested **Unverified: this machine has no `cargo`/`rustc`** (`cargo`, `rustc` are not on PATH and no toolchain is under `%USERPROFILE%\.cargo`). Nothing was compiled or run. Please run on a machine with the pinned toolchain: ``` cargo test --locked -p victory cargo clippy --workspace --all-targets --locked -- -D warnings cargo test --workspace --locked ``` New unit tests (not executed here): - `warm_shared_is_on_unless_it_is_zero` - `VICTORY_WARM_SHARED` is on unless exactly `0`. - `done_marks_read_the_driver_and_the_library` - path marks always count; library marks count only when the library file is present. - Existing mark tests still pin the old path-based value for `VICTORY_WARM_SHARED=0`. `git diff --check` is clean. Asset policy was not run (needs the workspace tool); the change adds no binary or large file. ## Checked for overlap - #1618 (merged): added the library pass and exe-free marks behind `VICTORY_WARM_SHARED=1`, off by default. This PR turns the same machinery on by default, adds the path mark beside the library mark, and fixes the library-presence check for the per-adapter library folder. - #2731 (merged): marks by pipeline content; unchanged. - #1583 (open): `VICTORY_LIBRARY_DIR`; the new presence check follows the same folder choice. - #1581 (merged): translator key skips comments/tests; no change here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:08:28 +00:00
github-bot force-pushed github-bot/gh-4198 from da93f56f2e to f46bb8a0a1 2026-12-01 00:52:28 +00:00 Compare
github-bot changed title from Warm --used fills the host pipeline library by default, and its library marks leave out the exe path (#1483) to Warm --used fills the host pipeline library by default; library marks leave out the exe path (#1483) 2026-12-01 00:58:03 +00:00
github-bot force-pushed github-bot/gh-4198 from f46bb8a0a1 to d70737bd58 2026-12-01 13:32:39 +00:00 Compare
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/4199/head:github-bot/gh-4198'
git switch 'github-bot/gh-4198'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4198'
git switch 'github-bot/gh-4198'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4198'
git switch 'github-bot/gh-4198'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4198'
git switch 'main'
git merge --squash 'github-bot/gh-4198'
git switch 'main'
git merge --ff-only 'github-bot/gh-4198'
git switch 'main'
git merge 'github-bot/gh-4198'
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/trustno1-coder--VIctory-NVIDIA!4199
No description provided.