Skip to content

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

Open
mrp1no wants to merge 1 commit into
trustno1-coder:mainfrom
mrp1no:library-primed-static-samplers
Open

mrp1no wants to merge 1 commit into
trustno1-coder:mainfrom
mrp1no:library-primed-static-samplers

Conversation

@mrp1no

@mrp1no mrp1no commented Nov 28, 2026 •

Copy link
Copy Markdown

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

…nd drop quick ones from the slow list

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 <noreply@anthropic.com>
@cxy0072019-sketch

Copy link
Copy Markdown

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

sawetco commented Nov 28, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants