Pipeline library: keep pipelines whose static samplers were primed; quick ones leave the slow list #1114

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

@⁠mrp1no on GitHub · 2026-11-28 13:28 UTC · original
mrp1no:library-primed-static-samplers → main · +142 −25 · 3 files · 1 commits · open

What happens

Pipelines with static samplers never go into the pipeline library (7fa0e95): one loaded in another process read through the samplers at its places in that process's driver table. They are made at every start, and on this PC the driver's own cache does not find them:

  • RTX 3060 12 GB, driver 621.40, i7-11700K, 32 GB, Windows 11, Series S. The log has host pipeline library saved bytes=0 ... made=1102 loaded=960 at every start (same build, same settings).
  • slow-pipelines.txt: 651 keys, 2.2 s median, 5.5 s p90.
  • With 8 workers that is 273-279 s at about 3.5 fps in the world after every start.

Since then samplers::prime makes the samplers of static-samplers.txt first, in one order, in every process, so their places are the same everywhere.

lut3d_probe on the RTX 3060 (64 samples each):

Case Filtered
stored, loaded (no shift) 64 / 64
stored, loaded after SHIFT=10 (the fault 7fa0e95 avoids) 0 / 64
stored and loaded both after SHIFT=10 (what the primed order gives) 64 / 64

What this changes

  1. Primed samplers go into the library. A pipeline whose static samplers were all made by prime is loaded from and stored in the library. Its name holds their places, so a list made again in another order finds none of the pipelines stored before.
    • Samplers met later in a run can come after the layer's own static samplers (compose, tiles, indirect). Pipelines with those are made, as now, and stored from the next start on, once prime has made them.
    • VICTORY_LIBRARY_STATIC_SAMPLERS=0 keeps none, as now; =1 keeps all, as before 7fa0e95.
  2. Quick pipelines leave the slow list. A pipeline listed as slow that comes in under SLOW_MS (now: loaded from the library) leaves slow-pipelines.txt. Listed, it still waited behind the quarter of the workers slow ones may have (make::slow_limit), two at a time here.

Measured (same PC, same save, prologue's cell)

Start Pipelines made / loaded Queue empty after the world's first frame fps meanwhile
main, every start 1102 / 960 about 4.5 min 3.4-3.7
this branch, first start (stores) 1102 / 974 about 3.5 min 3.5
this branch's part 1 alone, next start 11 / 2074 about 60 s 12-20
same, without the slow list's limit (VICTORY_PIPELINE_SLOW=0, which part 2 makes unneeded once the list is cleaned) 0 / 1942 17 s 10-20
  • The library grew from 18 MB to 210 MB.
  • Screenshots of the cell (colour grading, skin, the window's light) look the same as with the pipelines made in the run.
  • The posterized light with green and magenta fringes of 7fa0e95's runs did not show, in the screenshots or on screen. The person playing saw no colour fault over several starts.

Tests

  • pipeline::library::tests::primed_static_samplers_keep_the_library_under_their_places (new): kept only with places; the places are in the name; nothing changes for pipelines without them.
  • pipeline::library::tests::a_slow_pipeline_that_comes_quickly_leaves_the_slow_list (new).
  • pipeline::library::tests::pipelines_with_static_samplers_skip_the_library: unchanged, for the unprimed case.
  • cargo test -p victory-gpu --lib -- pipeline::: 27 passed.
  • cargo clippy -p victory-gpu --all-targets: only the shadow.rs warning that main has.

Not tried: other cards. The probe only checks the driver's sampler table, and the reasoning holds wherever prime runs first.

🤖 Generated with Claude Code

**@⁠mrp1no** on GitHub · 2026-11-28 13:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114) `mrp1no:library-primed-static-samplers` → `main` · +142 −25 · 3 files · 1 commits · open ## What happens Pipelines with static samplers never go into the pipeline library (7fa0e95): one loaded in another process read through the samplers at its places in that process's driver table. They are made at every start, and on this PC the driver's own cache does not find them: - RTX 3060 12 GB, driver 621.40, i7-11700K, 32 GB, Windows 11, Series S. The log has `host pipeline library saved bytes=0 ... made=1102 loaded=960` at every start (same build, same settings). - `slow-pipelines.txt`: 651 keys, 2.2 s median, 5.5 s p90. - With 8 workers that is **273-279 s at about 3.5 fps** in the world after every start. Since then `samplers::prime` makes the samplers of `static-samplers.txt` first, in one order, in every process, so their places are the same everywhere. `lut3d_probe` on the RTX 3060 (64 samples each): | Case | Filtered | |---|---| | stored, loaded (no shift) | 64 / 64 | | stored, loaded after `SHIFT=10` (the fault 7fa0e95 avoids) | 0 / 64 | | stored and loaded both after `SHIFT=10` (what the primed order gives) | 64 / 64 | ## What this changes 1. **Primed samplers go into the library.** A pipeline whose static samplers were all made by `prime` is loaded from and stored in the library. Its name holds their places, so a list made again in another order finds none of the pipelines stored before. - Samplers met later in a run can come after the layer's own static samplers (`compose`, `tiles`, `indirect`). Pipelines with those are made, as now, and stored from the next start on, once `prime` has made them. - `VICTORY_LIBRARY_STATIC_SAMPLERS=0` keeps none, as now; `=1` keeps all, as before 7fa0e95. 2. **Quick pipelines leave the slow list.** A pipeline listed as slow that comes in under `SLOW_MS` (now: loaded from the library) leaves `slow-pipelines.txt`. Listed, it still waited behind the quarter of the workers slow ones may have (`make::slow_limit`), two at a time here. ## Measured (same PC, same save, prologue's cell) | Start | Pipelines made / loaded | Queue empty after the world's first frame | fps meanwhile | |---|---|---|---| | main, every start | 1102 / 960 | about 4.5 min | 3.4-3.7 | | this branch, first start (stores) | 1102 / 974 | about 3.5 min | 3.5 | | this branch's part 1 alone, next start | 11 / 2074 | about 60 s | 12-20 | | same, without the slow list's limit (`VICTORY_PIPELINE_SLOW=0`, which part 2 makes unneeded once the list is cleaned) | 0 / 1942 | 17 s | 10-20 | - The library grew from 18 MB to 210 MB. - Screenshots of the cell (colour grading, skin, the window's light) look the same as with the pipelines made in the run. - The posterized light with green and magenta fringes of 7fa0e95's runs did not show, in the screenshots or on screen. The person playing saw no colour fault over several starts. ## Tests - `pipeline::library::tests::primed_static_samplers_keep_the_library_under_their_places` (new): kept only with places; the places are in the name; nothing changes for pipelines without them. - `pipeline::library::tests::a_slow_pipeline_that_comes_quickly_leaves_the_slow_list` (new). - `pipeline::library::tests::pipelines_with_static_samplers_skip_the_library`: unchanged, for the unprimed case. - `cargo test -p victory-gpu --lib -- pipeline::`: 27 passed. - `cargo clippy -p victory-gpu --all-targets`: only the `shadow.rs` warning that main has. **Not tried:** other cards. The probe only checks the driver's sampler table, and the reasoning holds wherever `prime` runs first. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pipelines with static samplers never went into the library (7fa0e95): a
pipeline loaded in another process read through the samplers at its
places in that process's driver table. Since the samplers of the list
are made first in one order (`samplers::prime`), those places are the
same in every process. On an RTX 3060 (driver 621.40) the driver's own
cache did not find these pipelines either: about 1,100 were made at
every start, 2.2 s each (median), 4.5 minutes at 3.5 fps in the world.

- A pipeline whose static samplers were all made by `prime` is loaded
  from and stored in the library, under a name that holds their places.
  Samplers met later in a run may come after the layer's own (composite,
  tiles): pipelines with them are made as before, and kept from the next
  start on. VICTORY_LIBRARY_STATIC_SAMPLERS=0 keeps none (as before),
  =1 keeps all (as before 7fa0e95).
- A pipeline listed as slow that comes in under SLOW_MS (loaded from the
  library) leaves slow-pipelines.txt: listed, it waited behind the
  quarter of the workers slow ones may have at every start.

lut3d_probe on the RTX 3060: stored and loaded with the same ten samplers
made first, 64 of 64 samples filtered; loaded after ten others, 0 of 64
(the fault 7fa0e95 avoids).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 14:33:33 +00:00
Author
Owner

@⁠cxy0072019-sketch on GitHub · 2026-11-28 13:59 UTC · original

Reproduced the restart improvement on an RTX 5070 Ti 16 GB (621.24), i5-14600KF, Windows 11. I applied b987e99 to a local #1069 / #932 / #1018 test branch. Series S, 1080p output, no DLSS or frame generation.

I copied the same warmed translation cache, 122,698,558-byte host pipeline library and static sampler list into two separate launch states. The two states had their own fresh driver caches. The executable and copied prologue save were identical. Enabled means the conservative default, and disabled sets VICTORY_LIBRARY_STATIC_SAMPLERS=0.

Restart Time from first 500+ draw sample to three consecutive 3D samples with zero pending pipelines Library made / loaded counters around 120 seconds
Disabled 148.0 s 1,245 / 1,145
Enabled 99.3 s 7 / 2,414

The office and complete face rendering were visible in both arms. One restart per arm on this machine, so the result is specific to this warmed-cache launch and says nothing about steady-state FPS.

**@⁠cxy0072019-sketch** on GitHub · 2026-11-28 13:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7240327275) Reproduced the restart improvement on an RTX 5070 Ti 16 GB (621.24), i5-14600KF, Windows 11. I applied `b987e99` to a local #1069 / #932 / #1018 test branch. Series S, 1080p output, no DLSS or frame generation. I copied the same warmed translation cache, 122,698,558-byte host pipeline library and static sampler list into two separate launch states. The two states had their own fresh driver caches. The executable and copied prologue save were identical. Enabled means the conservative default, and disabled sets `VICTORY_LIBRARY_STATIC_SAMPLERS=0`. | Restart | Time from first 500+ draw sample to three consecutive 3D samples with zero pending pipelines | Library made / loaded counters around 120 seconds | | --- | ---: | ---: | | Disabled | 148.0 s | 1,245 / 1,145 | | Enabled | 99.3 s | 7 / 2,414 | The office and complete face rendering were visible in both arms. One restart per arm on this machine, so the result is specific to this warmed-cache launch and says nothing about steady-state FPS.
Author
Owner

@⁠sawetco on GitHub · 2026-11-28 15:02 UTC · original

I compared the patch at b987e99 against my usual v2026.11.27.10 build with #541 and #1111. The test build added #1114 to that same base and started with copies of the same F1 settings, save, and VIctory cache. My setup was an RTX 5070 on Windows 11 with NVIDIA 621.40, Series X at 1080p to 1440p, DLSS Quality and DLSS Frame Generation 2x.

I launched the patched build twice and timed loading the same way as on the baseline. I saw no noticeable difference in loading time across those two launches.

**@⁠sawetco** on GitHub · 2026-11-28 15:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7241147897) I compared the patch at `b987e99` against my usual `v2026.11.27.10` build with #541 and #1111. The test build added #1114 to that same base and started with copies of the same F1 settings, save, and VIctory cache. My setup was an RTX 5070 on Windows 11 with NVIDIA 621.40, Series X at 1080p to 1440p, DLSS Quality and DLSS Frame Generation 2x. I launched the patched build twice and timed loading the same way as on the baseline. I saw no noticeable difference in loading time across those two launches.
github-bot force-pushed github-bot/gh-1114 from b987e99589 to f9fb842dda 2026-11-29 03:33:39 +00:00 Compare
Author
Owner

@⁠mrp1no on GitHub · 2026-11-29 03:28 UTC · original

Rebased onto current main (568c5e5). Main moved aniso_point_mip to crate::sampler, so primed_places now calls crate::sampler::aniso_point_mip. cargo check -p victory-gpu --tests is clean and the pipeline tests pass. #1268 is rebased on top.

**@⁠mrp1no** on GitHub · 2026-11-29 03:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7250073847) Rebased onto current main (568c5e5). Main moved `aniso_point_mip` to `crate::sampler`, so `primed_places` now calls `crate::sampler::aniso_point_mip`. `cargo check -p victory-gpu --tests` is clean and the pipeline tests pass. #1268 is rebased on top.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-29 08:28 UTC · original

Thank you! An earlier version of this pull request was merged into main with its original commits and is part of v2026.11.29.01, where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.

**@⁠trustno1-coder** on GitHub · 2026-11-29 08:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7253123884) Thank you! An earlier version of this pull request was merged into main with its original commits and is part of [v2026.11.29.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.01), where you are credited. GitHub does not show it as merged because new commits were pushed here after that merge. It stays open so those newer commits can be looked at next.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/library.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/1114/head:github-bot/gh-1114'
git switch 'github-bot/gh-1114'

Merge

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