Run: the title's warm-up starts itself, at load #2809
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2809
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2809"
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?
@kais7654 on GitHub · 2026-11-25 21:07 UTC · original
kais7654:warm/the-runs-own-prebuild→main· +107 −1 · 5 files · 2 commits · openWhat
victory runnow starts the warm-up ofvictory translate --cache --pipelinesitself: after the title's imports are bound and before its main thread spawns, avictory-prebuildthread (below the title's priority, up to 4 threads) walks the title's folder and fills the two caches a run reads — the translated-shader cache (<cache>/shaders) and the host pipeline library (<cache>/pipelines). It saves what it makes as it grows: a stopped run keeps its work and the next one skips its entries.VICTORY_PREBUILD=0leaves the warm-up to the command, and the command keeps its progress lines; the run's warm-up stays quiet (its console is the title's).Why
The offline pre-build already makes every pipeline of the shader pack ahead of a run — but it was a command the README suggested before the first play. Who skipped it paid in the first runs: Grand Theft Auto VI's first world frame wants over 1,200 new pipelines (decision 0007: that frame took more than 30 s on the recording threads), and the shaders translate at first use, their draws waiting. With the warm-up started at load, the first run digs the caches while the title is still on its menus (below its priority, so it does not take the CPU from loading), and the next one finds everything there: what the frame asks for is loaded from the library, not compiled.
Notes
victory_gpu::pipeline::Prebuild→ the pipeline library), exactlytranslate --cache --pipelineswithuse_progress(false); the host device is the run's static host.translate --cache --pipelinesstays the way to warm other folders and to watch progress.VICTORY_PREBUILDrefuses0andoff); README documents the behavior.AI-assisted: implemented with Mistral Vibe.
@fuzeofficlal on GitHub · 2026-11-25 21:23 UTC · original
Reviewed and tested
ec64ba5bon Windows 11 (rustc 1.98.1MSVC) againstmain(13f91ca).Code review
Cache integrity looks safe on early exit (
Cache::get_or_convertandlibrary::write_atomicallystage to.tmp-{pid}-{n}and rename atomically underWRITING, anduse_shader_cache/use_pipeline_cacheare already initialized beforestart_warm_up). However, four practical issues stand out for running warm-up concurrently with title launch:THREAD_PRIORITY_BELOW_NORMAL(run.rs:72-76):SetThreadPriorityis called only on the coordinator thread, with the comment// The scoped workers spawn from here (below the title's threads).On Windows,CreateThread(used bystd::thread::scope) always starts new threads atTHREAD_PRIORITY_NORMALregardless of the creator's priority, so up to 4 scoped workers intranslate::warmandprebuild::runstill compete at normal priority with the title's own threads. Each worker needsSetThreadPriorityinside its own thread body (as inpipeline/make.rs:284).translate::warmandprebuild::runread files up toMAX_FILE = 2 GiBwhole viastd::fs::read, andprebuild::runretainsfiles: Vec<(PathBuf, Vec<u8>)>across the run—right while the title is mapping its executable and allocating startup memory.use_progress(false)only suppressestranslate::report();translate::warm(translate.rs:429-434) andprebuild::run(prebuild.rs:59, 112, 324, 331) still printcache/containers/pipelineslines to the title's console.library.lock()contention: warm-up sharesshader_cache::{HITS, MISSES}/library::{MADE, LOADED}with live title execution (skewing frame/run logs), initializeshost()early, andPrebuild::make()callslibrary::save(false)every 20 s holdinglibrary.lock()duringSerialize, which can briefly stall live pipeline lookups.Verification
cargo test --locked -p victory: 13/13 passed;cargo clippy --locked -p victory --all-targets -- -D warnings(default &--features diagnostics): 0 warnings;cargo xtask policy: 184 files ok.@cloph-dsp on GitHub · 2026-11-25 21:25 UTC · original
Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup, CARGO_BUILD_JOBS=2.
cargo test --locked -p victory --quiet-> 11 + 2 tests passed, 0 failed.cargo test --locked -p victory --bin victory the_warm_up_starts_unless_asked_off --quiet-> 1 passed, 10 filtered out.git diff --check origin/main..HEADclean.the_warm_up_starts_unless_asked_offis absent from origin/main, so the gate test is new here.Prebuildwarm-up thread at run load unlessVICTORY_PREBUILD=0/off, with progress output silenced during a run; the pure gate logic is what the synthetic test covers, no title assets were used.AI-assisted (Hy4 flash).
@kais7654 on GitHub · 2026-11-25 22:03 UTC · original
Fix applied:
run's warm-up now arms its workers themselves — each workerwarmmakes starts withSetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL)of its own (a run's;
translate's workers keep their caller's priority).The warm-up thread itself stays below normal as before
(
fb2d391). Clippy 0 on both feature profiles; the app's tests pass.@Marvisak on GitHub · 2026-11-26 02:19 UTC · original
Automated triage for the maintainers.
This makes
victory runstart the shader/pipeline warm-up (translate::warm) on a below-normal thread while the title loads, unlessVICTORY_PREBUILD=0is set. It addswindows-sysas a new dependency ofapps/victory(Cargo.toml and Cargo.lock), so it needs the maintainer's decision in any case. Points still open from the review above:use_progress(false)only silencestranslate::report. The warm-up's other output (for example inprebuild::run) still prints to the title's console.translate::warmreads whole files (up toMAX_FILE) while the title is loading, which raises peak memory at startup.CI: passing.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.