warm: name pipeline library worker threads so preload does not drop pipelines under soft RAM throttle #4410
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4410"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-30T19:57:29Z.
Related: #3648
What it changes
warm::into_library(the final step ofvictory preload) andwarm::fill_library(VICTORY_WARM_SHARED=1) spawned unnamed scoped worker threads (s.spawn(...)) to compile early and slow pipelines intohost-pipelines.bin.Inside
victory_gpu::compilemem::begin, pipeline worker threads are recognized by the"victory-pipelines-"thread-name prefix. Becausewarm's scoped worker threads were unnamed:compilemem::begintreated them as foreground title threads (!worker,WAIT_OTHER = 1 s,impatient = true).Verdict::Throttle, even with ~80 GB of commit remaining), compiles serialized one at a time and any waiting worker that waited longer than 1 s was refused withE_OUTOFMEMORY(0x8007000E).pipeline::make(which retries deferred pipelines afterRETRY_AFTER_MS), offlinewarm::into_library/fill_librarytries each pipeline once — so every deferred compile was permanently omitted fromhost-pipelines.binand had to be rebuilt on the next game launch.Fix (
apps/victory/src/warm.rs):library_worker_nameandspawn_library_workernaming scoped worker threads"victory-pipelines-warm-{index}"in bothfill_libraryandinto_library, matchingcompilemem::begin's"victory-pipelines-"prefix so offline workers pace patiently underVerdict::Throttlewhile still respecting the hard commit floor (Verdict::Refuse).warm::tests::library_workers_use_the_pipeline_worker_thread_name_prefix.How it was tested
victory preload --usedin an isolated temporaryVICTORY_CACHE_DIR).victory preload --usedstored 4,095 of 4,212 pipelines inhost-pipelines.bin, with 117 put off after waiting underVerdict::Throttle(free_physical_mb~1,127–1,208 MB, ~80 GB commit free) and 117memguardrefusal warnings.victory preload --usedstored 4,211 of 4,212 pipelines inhost-pipelines.bin, with 0 put off after waiting (1,101 waited to start, 0memguardwarnings; the single remaining pipeline returned a direct driverE_OUTOFMEMORYafter ~5.5 s).cargo testpassed for the crates it touches: yes (cargo test -j 4 -p victory --locked: 92/92 unit + 3/3 integration tests passed;cargo clippy -j 4 -p victory --all-targets --locked --no-deps -- -D warnings: 0 warnings;cargo run -p xtask -- policy --staged: 1 files ok).Checked for overlap
victory-gpu; does not touchapps/victory/src/warm.rsor worker thread naming).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T10:27:50Z.
On
2dc298e4, a later named worker can fail to start after an earlier worker has already completed pipelines. The scoped workers are joined, then the error is returned before the final library save or the remaining shared-mode marks.c02051614c38c8a76f9b97efc8a9521f9a1e5ba1 moves the error check after the existing save in both
into_libraryandfill_library. It still returns the original worker error without printing a successful completion. Review commitI ran the exact author and follow-up functions with a fake two-worker setup in which only the second spawn fails. The first worker completed one pipeline in each mode. The author head saved zero; the follow-up saved one and still returned the worker failure. Shared mode also wrote the first worker's mark. This exercise stubbed out D3D12, and the one-file staged policy passed.
Please keep the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change in.AI-assisted with OpenAI Codex.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T10:56:18Z.
Thanks @andrewpozdnakov7-jpg! Cherry-picked onto this branch as
60028f8a90(fromc02051614c) with your original Git author preserved. Verifiedflush()andknown::keep_library()handle partial/empty worker progress safely before propagatingworkers?without printing the completion summary, along withcargo test --locked -p victory,cargo clippy --locked -p victory --all-targets -- -D warnings, andcargo xtask policy.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:41:53Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed