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

local and others added 2 commits November 28, 2026 14:27
…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.

1 participant