perf(victory-gpu): speed up known-pipeline boot prefetch and loose-part deserialize #11
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/MahanYTT--VIctory-MA!11
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-11"
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?
@MahanYTT on GitHub · 2026-12-04 18:27 UTC · original
MahanYTT:perf/pipeline-boot-and-loose-parts→mega-upgrade-v3· +568 −128 · 7 files · 1 commits · merged 2026-12-04 20:18 UTCRoot Causes Addressed
pipeline/known.rs,pipeline/make.rs,pipeline.rs):walk_shadersused an 8 KiBBufReaderover 19,117 shader containers (~38k syscalls per scan); bumped to 256 KiB for bothwalk_shadersandwalk_pipelines.known::recipesformatted 16-byte keys intoStringvia 16×format!("{b:02x}")across all 89,320 pipelines (~1.52M heap allocations) and buffered all 4,999 recipes before starting a single worker. Now pre-parseswantedintoHashSet<[u8; 16]>, stops scanning early once all wanted IDs are found, and streams recipes directly tomake::prefetchin batches of 32 (Queue::push_prefetch_batch) under singlePREFETCHEDandQUEUElocks.known::recipes/make/namesre-read, zlib-decompressed, re-hashed (blake3), and cloned shared shader containers for every pipeline reference. AddedShader::full_hash,shader_cached,shader_from_owned, andShaderResolverso each unique shader is read, decompressed, and interned at most once.known::noteserializedGraphicsState(g.put) into aVec<u8>on the title thread before checkingBook::keys.contains(&id). AddedBook::note_graphicsto skip serialization for already-known IDs, reusedshader.full_hashinBook::note, and movedkeys/shadersin O(1) inBook::readwhen empty.CStringclones inGraphicsState::get.pipeline.rs,pipeline/library.rs):SHADERS,USED, andSLOWfromMutextoRwLock, with read-first checks onshader(),wanted_early(),note_used(),slow(),slow_ms(), andnote_time().Deserialize*PipelineStateXoverhead (device.rs):VICTORY_DESERIALIZE_DUMPin aOnceLockinstead of callingstd::env::var_oson every call (18k+ calls).WARNlogs (each performing kernelReadProcessMemoryreads,loose_metadata/loose_compute/deserialize_partsparsing, and 6,144 hexformat!allocations up to 16,384 calls) withloose_log_mode: one detailedWARNon call 1 (using single-allocationhex_preview, and skippingloose_computeunlessVICTORY_LOOSE_PIPELINES=1) and lightweight count-onlyDEBUGsummaries on powers of two ≥ 64.Verification
cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --tests -- -D warnings: 0 warnings, 0 errors (including allpipeline/make.rsdeferral tests).cargo clippy -p victory-gpu --target x86_64-pc-windows-msvc --features diagnostics --tests -- -D warnings: 0 warnings, 0 errors.device.rs,pipeline.rs,pipeline/known.rs, andpipeline/make.rs, and executed standalonerustc --testverification of the new pure-Rust helpers.