perf(gpu,shader,pipeline): 8GB VRAM residency guard, hybrid core pinning, lock-free queues, and Pass 2 submit/descriptor/shader optimizations #41
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-logs
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ToLIManl--VIctory-Hydra!41
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-41"
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?
@xonix97 on GitHub · 2026-12-03 15:28 UTC · original
xonix97:perf/rtx5060-14650hx-8gb-vram→main· +1143 −239 · 14 files · 1 commits · openSummary
Two optimization passes targeting 8 GB VRAM GPUs (e.g. RTX 5060 Laptop GPU, NVIDIA Blackwell) and hybrid P/E-core CPUs (e.g. Intel Core i7-14650HX, 16 GB RAM):
Pass 1: 8 GB VRAM Residency, Hybrid Threading, Barriers & Lock-Free Command Queues
crates/victory-gpu/src/residency.rs,resource.rs,host.rs,shadow.rs):DEFAULT_VRAM_SOFT_CAP_BYTES = 6963 MiB, override viaVICTORY_VRAM_SOFT_CAP_MB), pressure tiers, dynamic mip clamping (effective_edge_max()), and L0 write-combinedD3D12_HEAP_TYPE_CUSTOMdemotion for textures (host_texture_as()) and >= 64 KiB UAV buffers (uav_buffer_now()) when over the soft cap on 8 GB GPUs.window_mapped_most()/window_mapped_for()) on small-BAR / 16 GB RAM 8 GB GPUs to prevent PCIe thrashing.crates/victory-gpu/src/cores.rs):hybrid_efficiency_sets(),slow_of()) and pinned background shader compiles / non-frame work to E-cores (keep_off_the_frames_cores(),keep_runtime_compiles_off_the_frames_cores()) while keeping frame-critical work on fast P-cores.crates/victory-gpu/src/pipeline/make.rs):30 speriodic PSO library save timer whenVICTORY_LIBRARY_SAVE_TIMER_Sis unset.crates/victory-gpu/src/host/place.rs):narrow_mask()toNARROW_ALLon discrete NVIDIA adapters supporting Enhanced Barriers unless overridden viaVICTORY_NARROW_BARRIERS.crates/victory-gpu/src/list/thin.rs):READY/WORDSmutexes with bounded lock-free MPMC rings (LockFreeRing,READY_RING,WORDS_RING), thread-localLOCAL_WORDSword chunk pooling, and scaleddefault_thin_threads().Pass 2: Submission Lock Split, Descriptor Batching, Shader Cache/Bitcode & PCIe Writeback Tuning
Host::submitCritical Section & Default Async Relay (crates/victory-gpu/src/host.rs):heaps_mark,first_heaps), write-watch range collection (Batch::collect_watch_ranges), asyncask_first, and command-list vector preallocation outsideself.submitted.lock().VICTORY_SUBMIT_SPLITandVICTORY_RELAY_COPYby default at runtime (!= "0"opt-out; disabled undercfg!(test)).crates/victory-gpu/src/descriptor/host.rs,draw.rs):CopyDescriptorsSimple(1)for exclusively-owned dynamic slots (is_dynamic_slot), writing directly in place.DynamicCopyBatch(HostHeap::make_listed_into+CopyDescriptorsflush indraw.rs::tables()) using a thread-local scratch buffer to batch cached dynamic table copies across a draw into a single COM call.crates/victory-pipeline/src/cache.rs,crates/victory-gpu/src/shader_cache.rs,crates/victory-shader/src/emit/bitcode.rs,crates/victory-shader/src/gfx10/mod.rs):CacheKey::from_partsto eliminate container-sizedVecconcatenation on every shader cache lookup.shader_cache::MEMORY_CACHEto a lock-free-read LRU cache (AtomicU64access stamps,VICTORY_SHADER_MEM_CACHEdefault8192) evicting the least-recently-used entry when full (cached loads already skip DXIL validation).Vec<u64>(fill_chars) acrossModule::emitblocks inbitcode.rsand pre-reservedpendingcapacity ingfx10::decode.crates/victory-gpu/src/shadow.rs):wc_no_backby default at runtime (VICTORY_WC_NO_BACK != "0") with a1024 KiBminimum size cutoff (VICTORY_WC_NO_BACK_MIN_KB,0undercfg!(test)) so large WC buffers stay on-card while small CPU-readback results (< 1 MiB) still copy back accurately.Verification
cargo clippy --workspace --lib --locked: compiles cleanly with 0 new warnings in modified files.cargo xtask policy --staged:asset policy: 14 files ok.cargo build --release --locked -p victory: succeeded (target/release/victory.exe).residency::tests,cores::tests,pipeline::make::tests,shader_cache::tests(12 passed),descriptor::host::tests(72 passed, 1 ignored),draw::tests(9 passed),host::tests(91 passed, 2 ignored),shadow::wc_no_back_tests(1 passed),texback::tests(4 passed),watch::many_askers_tests(11 passed),victory-pipeline(13 passed),victory(81 + 1 + 2 passed),victory-core(24 passed),victory-game(43 passed),victory-loader(86 + 2 + 2 passed),victory-pe(36 passed).60d36c7(untouched crates/tests):victory-shader --lib --testsfails to compile (missing field code_table),victory-formatsbcpack::tests::oracle_parity_*(3 failed),victory-hlegameinput/xmem(6 failed),xtaskrepo-wide asset policy (5 pre-existing files), andvictory-gpushadow::landing_tests::what_a_landing_wrote_is_not_sent_up_again.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.