Skip to content

Pipelines: the early list started from the book at the title's first pipeline (builds on #1114) - #1268

Open
mrp1no wants to merge 2 commits into
trustno1-coder:mainfrom
mrp1no:pipeline-prefetch
Open

mrp1no wants to merge 2 commits into
trustno1-coder:mainfrom
mrp1no:pipeline-prefetch

Conversation

@mrp1no

@mrp1no mrp1no commented Nov 28, 2026

Copy link
Copy Markdown

Builds on #1114 (its commit is the first one here); only the last commit is new. Without #1114 there is nothing to gain: the pipelines with static samplers are compiled at every start, and those compiles set the pace. Measured: 1,301 made, the queue empty 205 s after the world's first frame, as without this.

What happens

The early list (early-pipelines.txt: the pipelines earlier runs drew with) is started when the title creates each pipeline. The title creates about 1,400 of them at its start, and about 900 more only when it loads a save, a few seconds before the world's first frame. Those 900 are loaded from the library then. While the title's threads run, a load takes 0.1-0.2 s on the lowest-priority workers.

Measured with #1114 alone on an RTX 3060 (driver 621.40), i7-11700K, 32 GB, Series S, 720p:

  • 150 pipelines were still queued at the world's first frame.
  • The world came in at 3-15 fps.
  • The queue emptied 43-60 s after that frame.

What this changes

  • Prefetch at the title's first pipeline. The early list's pipelines are described from known-pipelines.bin (the book VICTORY_PIPELINE_BOOK=1 keeps; play turns it on) and started at once, on a thread of their own: 2,383 described in 0.2-0.3 s. They load during the logos and the menu.
  • One pending pipeline per key. When the title creates one of them, make::adopt gives it the same pending pipeline, so each is loaded once. Only keys on the early list are shared; every other pipeline gets its own, as now.
  • VICTORY_PIPELINE_PREFETCH=0: as before.
  • The library's save line also says how long a load and a make took on average (load_ms_each, make_ms_each).

Measured (same PC, same save, warm library)

Start Queued at the world's first frame Queue empty after it
#1114 alone about 150 43-60 s
#1114 + this, 3 starts 2 / 96 / 19 7 / 41 / 21 s

It varies with how soon the save is loaded after the menu (Enter was pressed by a script within seconds).

Tests

  • pipeline::make::tests::a_pipeline_made_ready_is_the_one_the_title_gets (new): a key on the early list gives one pending pipeline; any other key gives each its own.
  • cargo test -p victory-gpu --lib -- pipeline::: 28 passed.
  • cargo clippy -p victory-gpu --all-targets: only the shadow.rs warning that main has.

🤖 Generated with Claude Code

@cxy0072019-sketch

Copy link
Copy Markdown

I ran a paired startup check on an RTX 5070 Ti (621.24) with an i5-14600KF, Series S mode, and 1080p output. Both runs used the same executable with #1114, identical copies of a recorded pipeline library and story save, separate driver cache directories, DLSS Quality, and 3× frame generation. The startup input script was the same.

Startup measure Prefetch off Prefetch on
First meter sample with at least 3,000 draws, after launch 69.24 s 68.81 s
Pending pipelines at that sample 702 677
Time from that sample to the first of three successive zero-pending samples 127.25 s 152.34 s

The enabled run logged wanted=2664 described=2627 started=2615 ms=244. I did not reproduce a faster queue drain in this pair. The meter reports roughly every five seconds, and the first qualifying samples had different draw counts (6,315 and 8,595), so this is one startup observation on this configuration. Both queues were empty by the later doorway test. The enabled run needed an extra reposition at the handle, which makes the two doorway FPS samples unsuitable for estimating the effect of prefetch.

@mrp1no

mrp1no commented Nov 28, 2026

Copy link
Copy Markdown
Author

Thanks for the paired run. Your setup is the case where this cannot help, and I should have said so more plainly in the description.

With separate, fresh driver caches, about 700 pipelines were still pending at the first 3,000-draw sample in both runs. That queue is set by compiles, not loads:

  • Prefetch only starts work earlier. A compile still takes its seconds, and once both runs are in the world the workers have the same queue to get through.
  • Here, with a warm library, 2 / 96 / 19 were pending at the world's first frame over three starts, against about 150 without prefetch.

The library's save line now tells the two cases apart. Could you look at host pipeline library saved ... made=… loaded=… load_ms_each=… make_ms_each=… near the end of each log?

  • Mostly made with make_ms_each of a second or more: the drain is compile-bound, and the same with or without this.
  • Mostly loaded at tens of milliseconds each: that is the case this targets.

A second start on the same driver caches, with the library from the first, would show it.

local and others added 2 commits November 29, 2026 04:26
…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>
…pipeline

At the title's first pipeline, the early list's pipelines (those earlier
runs drew with) are described from known-pipelines.bin and started at once;
when the title creates one of them it gets the same pending pipeline
(make::adopt), so each is loaded once. The title creates about 900 of them
only when it loads a save, seconds before the world's first frame.
VICTORY_PIPELINE_PREFETCH=0: started only at the title's creation, as before.
The library's save line says how long a load and a make took on average.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants