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

Open
mrp1no wants to merge 1 commit from upstream-pr/1114 into main
mrp1no commented 2026-11-28 13:28:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mrp1no on 2026-11-28T13:28:29Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5540600167 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114). Originally posted by [mrp1no](https://github.com/mrp1no) on 2026-11-28T13:28:29Z. --- ## 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)
cxy0072019-sketch commented 2026-11-28 13:59:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cxy0072019-sketch on 2026-11-28T13:59:07Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240327275 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7240327275). Originally posted by [cxy0072019-sketch](https://github.com/cxy0072019-sketch) on 2026-11-28T13:59:07Z. --- 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.
sawetco commented 2026-11-28 15:02:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by sawetco on 2026-11-28T15:02:10Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7241147897 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7241147897). Originally posted by [sawetco](https://github.com/sawetco) on 2026-11-28T15:02:10Z. --- 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.
mrp1no commented 2026-11-29 03:28:59 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mrp1no on 2026-11-29T03:28:59Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7250073847 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7250073847). Originally posted by [mrp1no](https://github.com/mrp1no) on 2026-11-29T03:28:59Z. --- 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.
trustno1-coder commented 2026-11-29 08:28:09 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T08:28:09Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253123884 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1114#issuecomment-7253123884). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-29T08:28:09Z. --- 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 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/1114:upstream-pr/1114'
git switch 'upstream-pr/1114'

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