perf(gpu/ahead,host): bounded 8 MiB L0 SharedPool sub-allocator with residency pressure trimming #27
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!27
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/27/head"
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?
@justadudeinbulgaria on GitHub · 2026-12-01 18:16 UTC · original
justadudeinbulgaria:pr/bounded-l0-shared-pool→main· +606 −14 · 3 files · 1 commits · closed without mergingSummary
Ports the
L0(WRITE_BACK) shared-buffer heap pool fromAndrotim/MiniVI#289with strict memory/residency guardrails for 16–32 GB RAM and 8 GB VRAM GPUs, while intentionally omittingCardBumpPool:L0 SharedPoolonly (noCardBumpPool): On 8 GB GPUs, bump-poolingDEFAULTVRAM buffers co-mingles permanent/long-lived buffers with short-lived scratch UAVs fromuav_pool, preventingsweep_uav_spare()andVICTORY_CARD_PRESSUREfrom reclaiming VRAM cleanly.L0blocks (crates/victory-gpu/src/ahead.rs):<= 2 MiBCPU-visibleWRITE_BACKL0buffers (Host::shared_buffer_now) inside 8 MiB (128 × 64 KiBslot)ID3D12Heapblocks (VICTORY_BUFFER_POOL=0restores committed allocations).ever_usedskips zeroing fresh OS pages; recycled slots are zeroed after a2500 msREST_MScooldown via aSetPrivateDataInterfaceCOMIUnknownreclaim hook).64 × 8 MiB = 512 MiBon<= 32 GiBhosts,128 × 8 MiBon> 32 GiBhosts) and refuses new pool heaps wheneverresidency::shared_pressed() || residency::critical_commit()is true (falling back cleanly to exact-sizeCreateCommittedResource).ahead.rs,host.rs,residency.rs):ahead::trim_shared_pool()runs inahead::fill(),host::sweep()(so trimming works even withVICTORY_BUFFERS_AHEAD=0), andresidency::refresh()whenshared_tighttriggers.shared_trim_len/should_refill_sharedhost-pressure trimming toahead::fill()'s 64 KiB store.Verification
crates/victory-shader/*andshader_cache.rsuntouched).origin/main(48413c9):ahead::(3/3 passed, including live D3D12 placed-buffer allocation + sentinel zero-on-recycle test) &residency::(4/4 passed).10,000shared buffers served from only51bounded 8 MiB heaps (196xfewer WDDM kernel allocations; heap count plateaued flat at51between8,000and10,000buffers in recycling steady state).113 sto72 s(-41 s), withpressured=false,7.2–8.4 GiBfree physical RAM,15.2 GiBcommit headroom, and31 MBtexture staging.@ToLIManl on GitHub · 2026-12-02 12:54 UTC · original
Thank you @justadudeinbulgaria — great work on this one! Integrated onto v2.0
mainin commit5d7f3efwith fullCo-authored-bycredit:L0 SharedPoolsub-allocator (alloc_pooled_shared,trim_shared_pool,SharedBlock,SharedPool,SharedReclaimCOM reclaim hook) intoahead.rswhile preserving v2.0'sadaptive(),RetryGate, andram_pressure/card_pressure.trim_shared_poolintohost.rs::sweepandresidency.rs::refresh.alloc_pooled_sharedintohost.rs::shared_buffer_nowright afterpool::cpu_bufferso 8–16 GB VRAM/RAM systems get bounded 8 MiB L0 pooling and pressure trimming without regressing 32 GB+ hosts.Built, unit-tested (
victory-gpuahead::*6/6 passed), and shipped in the refreshedVIctory-Hydra-v2.0-Stage17.ziprelease. Closing since the PR targeted pre-v2.0 history and is now landed onmain.Pull request closed