slow-pipelines.txt counts library loads as slow compiles and never drops a key, so loadable early pipelines wait in the slow queue #442

Open
opened 2026-11-27 08:32:00 +00:00 by github-bot · 0 comments
Owner

@⁠Jesper-Andersson on GitHub · 2026-11-27 08:27 UTC · original

library::note_time puts a key on the slow list when a make takes 1 s or more, whether the pipeline was compiled or only loaded from the pipeline library, and nothing ever takes a key off. Every listed early pipeline then goes to the slow queue (a quarter of the workers, after all others), including pipelines the library holds.

Where

crates/victory-gpu/src/pipeline/library.rs:740-752 and crates/victory-gpu/src/pipeline/make.rs:88-92 at 014d52d:

// make.rs, Pending::make
let began = Instant::now();
let made = HostPipeline::new(&self.shaders, self.graphics.as_deref());
super::library::note_time(&self.key, began.elapsed().as_millis() as u64);

// library.rs
pub(crate) fn note_time(key: &str, ms: u64) {
    if ms < SLOW_MS {
        return;
    }
    // ... insert or raise; never removed

Why it matters

HostPipeline::new includes the library load. A load that faults in cold pages of the mapped library can take a second on a slow disk while the title streams, and then that key is on the list for good. Queue::push sends listed early pipelines to Queue::slow, capped by slow_limit() (workers / 4). Measured on a local branch (main plus about 50 merged PRs, RTX 2070 SUPER 8 GB, Ryzen 7 5800X, 32 GB, SATA QLC SSD, Series S profile + DLSS): the list held 1,817 of 3,224 early keys, and 736 to 987 early pipelines were still not made at world entry in 3 of 4 runs.

Suggestion

  • Count only compiles: tell from the library calls whether a make loaded or compiled. A compile of 1 s or more adds the key, a compile under 1 s takes it off, and a load does neither. Tests can pin the rule as a pure function of (ms, how it came about).
  • Separately, the loads' own page faults on the mapping can be taken out of their path by reading the mapped file ahead (PrefetchVirtualMemory on a background thread). With that on, 0 early pipelines were left at world entry in 6 of 6 runs, and the time until all were made went from 75 s to 34 s in one interleaved pair. The read-ahead of 981 MB took 33-55 ms with the file already in the OS cache.
  • PR: #443 (VICTORY_PIPELINE_SLOW_LIST, on by default; VICTORY_LIBRARY_PREFETCH=1, off by default).

Not checked

NVIDIA RTX 2070 SUPER only; no AMD, NVMe or Linux runs. The numbers come from a local branch, not main. A first run after a rebuild without victory warm --used still has a backlog of real compiles, which neither change helps.

AI use

AI-assisted (Claude Code): code reading, the fix and its unit tests. The game runs were done unattended on the local branch. No game files are included.

**@⁠Jesper-Andersson** on GitHub · 2026-11-27 08:27 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/issues/442) `library::note_time` puts a key on the slow list when a make takes 1 s or more, whether the pipeline was compiled or only loaded from the pipeline library, and nothing ever takes a key off. Every listed early pipeline then goes to the slow queue (a quarter of the workers, after all others), including pipelines the library holds. ## Where `crates/victory-gpu/src/pipeline/library.rs:740-752` and `crates/victory-gpu/src/pipeline/make.rs:88-92` at `014d52d`: ```rust // make.rs, Pending::make let began = Instant::now(); let made = HostPipeline::new(&self.shaders, self.graphics.as_deref()); super::library::note_time(&self.key, began.elapsed().as_millis() as u64); // library.rs pub(crate) fn note_time(key: &str, ms: u64) { if ms < SLOW_MS { return; } // ... insert or raise; never removed ``` ## Why it matters `HostPipeline::new` includes the library load. A load that faults in cold pages of the mapped library can take a second on a slow disk while the title streams, and then that key is on the list for good. `Queue::push` sends listed early pipelines to `Queue::slow`, capped by `slow_limit()` (workers / 4). Measured on a local branch (main plus about 50 merged PRs, RTX 2070 SUPER 8 GB, Ryzen 7 5800X, 32 GB, SATA QLC SSD, Series S profile + DLSS): the list held 1,817 of 3,224 early keys, and 736 to 987 early pipelines were still not made at world entry in 3 of 4 runs. ## Suggestion - Count only compiles: tell from the library calls whether a make loaded or compiled. A compile of 1 s or more adds the key, a compile under 1 s takes it off, and a load does neither. Tests can pin the rule as a pure function of (ms, how it came about). - Separately, the loads' own page faults on the mapping can be taken out of their path by reading the mapped file ahead (`PrefetchVirtualMemory` on a background thread). With that on, 0 early pipelines were left at world entry in 6 of 6 runs, and the time until all were made went from 75 s to 34 s in one interleaved pair. The read-ahead of 981 MB took 33-55 ms with the file already in the OS cache. - PR: #443 (`VICTORY_PIPELINE_SLOW_LIST`, on by default; `VICTORY_LIBRARY_PREFETCH=1`, off by default). ## Not checked NVIDIA RTX 2070 SUPER only; no AMD, NVMe or Linux runs. The numbers come from a local branch, not main. A first run after a rebuild without `victory warm --used` still has a backlog of real compiles, which neither change helps. ## AI use AI-assisted (Claude Code): code reading, the fix and its unit tests. The game runs were done unattended on the local branch. No game files are included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 08:32:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
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/avatarmanz--VIctory-7900XTX#442
No description provided.