Run: the title's warm-up starts itself, at load #2807
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T21:07:29Z.
What
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.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T21:14:33Z.
Review: COMMENTED
One thing to double-check:
SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL)only lowers thevictory-prebuildthread — on Windows, child threads are created atTHREAD_PRIORITY_NORMALand do not inherit the creator's priority. The scoped workerswarmspawns (which do the actual translation CPU work) will run at normal priority and compete head-on with the title's threads, so the 'few threads below its own priority' intent doesn't reach them. Lowering priority inside the worker threads (e.g. a hook at the top ofwarm's scoped worker, or a priority class on a job object) would be needed for the comment's claim to hold.Otherwise sound:
VICTORY_PREBUILD=0opt-out, quiet progress mode via a process-wide flag is safe sincerunnever coexists with atranslateinvocation, and the staged cache persists partial progress.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:23:33Z.
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.Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-25T21:25:26Z.
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).
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T22:03:42Z.
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:19:14Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.