gpu: reduce WDDM Commit and SwapDelta peaks on <=32 GiB hosts #172
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!172
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/172/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?
@jules-noelaudoux on GitHub · 2026-11-29 23:58 UTC · original
jules-noelaudoux:fix/reduce-commit-memory→main· +1008 −42 · 10 files · 2 commits · closed without mergingSummary
Reduces Windows WDDM Commit,
SwapDelta, and host private memory peaks on<= 32 GiBRAM systems without regressing frame times:host/buffers.rs): Consolidates32 KiB ..= <4 MiBUPLOAD,WRITE_BACK(Shared),DEFAULT(Uav), andGPU_UPLOADbuffers into dedicated 16 MiBID3D12Heappools (ALLOW_ONLY_BUFFERS), avoiding Windows 11 + NVIDIA WDDM permanent 32 MiB internal slab retention on smallCreateCommittedResourcecalls and returning empty blocks to Windows commit after a short rest.residency.rs): Addscommit_pressured()with hysteresis on<= 32 GiBhosts (<= 8 GiBfree physical RAM or<= 9 GiBfree commit to enter;>= 10 GiBand>= 11 GiBto clear) so trimming engages before heavy pagefile thrashing begins.ahead.rs,host.rs,host/send.rs,list.rs,pool.rs,texture.rs):ahead64 KiB pre-allocated buffers (512initial /256kept on<= 32 GiBRAM) and truncates undercommit_pressured().list::trim_idle()(default45s/30sunder pressure;VICTORY_LIST_POOL_IDLE_S=0disables),send::trim_spare()(4 MiBfloor on limited RAM), andbuffers::trim()inhost::sweep(), reducesPRELUDES_KEPT(256 -> 64), and gatesID3D12CommandAllocatorreplacement behindVICTORY_ALLOCATOR_REPLACE=1to avoid permanent 1024 MiB WDDM driver arena commit growth.pool::room()spare staging/texture blocks andtexture::let_go_idle()staging idle timeout (<= 1,000 ms) undercommit_pressured().shadow.rs,resource.rs):GPU_UPLOADBAR single-copy paths on<= 32 GiBRAM hosts when supported for>= 4 MiBwindows (keeping< 4 MiBin the 16 MiB pool) and write-combined buffers>= 1 MiB(VICTORY_WC_BAR=0|1|2still overrides), while capping combinedWINDOW_CARD_BYTES + WINDOW_MAPPED_BYTES.vram_keep_or_commit()andslot_evictcommit-pressure floors inresource.rs(running fullvram_keep_or_commitevery 8 sweeps under softcommit_pressured()while keepingMiniVI'sweighed()real-budget guard).Rig Specs Tested On
10.0.26300.0), NVIDIA Driver621.40Run Settings & Profile
release—MiniVIb46464d(before) vs ported branch (f1b364f, rebased cleanly ontomain271a850as13733f1)series-x,2560x1440native (--res 1440)offoff(--dlss off)off(0)VICTORY_*Overrides:victory.exe play <exe> --res 1440 --dlss off(stockplaydefaults, isolated emptyVICTORY_HOMEandVICTORY_CACHE_DIR)mem-watchwindow +mem-audit)Measurements & Verification
Before (
b46464d) vs After (f1b364f), cold cache, identical settings:b46464d)draws >= 500)11.1 med(8.7–17.0,p50=89.8 ms)12.1 med(8.7–16.3,p50=82.8 ms)9.5–9.7 fps(103.5–105.4 ms)11.7–12.5 fps(79.8–85.5 ms)mem-auditend)27,515 MiB23,848 MiB-3,667 MiB(-3.58 GiB)mem-watchend / rate)27,272 MiB(+732.7 MiB/min)24,022 MiB(+268.1 MiB/min)-3,250 MiBmem-auditend)21,717 MiB19,551 MiB-2,166 MiBmem-auditend)5,798 MiB4,297 MiB-1,501 MiBmem-watchend)5,165 MiB5,748 MiB+583 MiBMEM_PRIVATE22,491 MiB18,907 MiB-3,584 MiBnvidia-smi/ queue)13,008 / 16,376 MiB(11,905 MB)11,642 / 16,376 MiB(10,470 MB)-1,366 MiBWAIT_RESIDENT(cumulative)16,800waits /2,017.3 ms2,000waits /349.9 ms0(0errors,0allocation failures)cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --locked -p xtask(6 passed; 0 failed)cargo test -p victory-gpu --lib -- --test-threads=1(572 passed; 0 failed; 37 ignored)@Androtim on GitHub · 2026-11-30 00:04 UTC · original · edited 2026-11-30 15:02 UTC
Automated triage for the maintainers (not an approval).
Verdict:
needs-rebase· CI (check):noneThis PR no longer merges cleanly into
main.To change the verdict: Rebase onto current
mainand resolve conflicts; CI and triage will run again automatically.Generated with Antigravity CLI (
agy).@jules-noelaudoux on GitHub · 2026-11-30 00:19 UTC · original
Thanks for the detailed automated review — all findings have been addressed in the latest commit on
fix/reduce-commit-memory:Changes Made
buffers.rs,host.rs):zero_init: booltoHeapPool::takeand tracked the monotonically advancingfresh_fromwatermark on eachBlock(viaRanges::take_from).Kind::Shared/Kind::GpuUpload):shared_buffer_withandmapped_card_bufferrequestzero_init = trueand clear reused slices viawrite_bytes(0, size), whileupload_buffersetszero_init = false.Kind::Uavpools: whenzero_init = true(uav_buffer_withwithwait_residency), allocations only take from untouched[fresh_from, BLOCK)ranges so callers never inherit stale reused bytes without a zeroing pass.ID3D12Resourcebefore returning slot onMap()failure (buffers.rs):drop(resource)beforegive(piece, now)so the sub-allocated slot is not marked free while the COM resource still references the placed offset.HeapPoolmutex acrossCreateHeap(buffers.rs):create_pool_heap()(ID3D12Device::CreateHeap+ optional residency wait / persistentMap) outside thekind.pool().lock()critical section, inserting/linking the new block cleanly once reacquired.buffers.rs,host.rs):placed_buffers_work_and_reclaim_on_dropto checkhost()without silently no-oping, queryD3D12_FEATURE_D3D12_OPTIONS16::GPUUploadHeapSupportedbefore exercisingKind::GpuUpload(which WARP may not expose), and verifyKind::Sharedreuse zeroing.uav_fresh_only_skips_reused_dirty_ranges.32 KiB ..= < 4 MiBsub-allocation threshold) and documentedVICTORY_ALLOCATOR_REPLACE=1onallocator_trim.Verification
cargo xtask policy --staged: passcargo test --locked -p xtask: 6 passed, 0 failedcargo clippy --workspace --all-targets --locked -- -D warnings: pass (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: pass (0 warnings)cargo test -p victory-gpu --lib -- --test-threads=1: 573 passed, 0 failed, 37 ignored (all 3host::buffers::tests::*tests passed)SCENE >=500 draws: n=23, med=12.0 fps, p50=83.5 ms, draws 2252..13162,WAIT_RESIDENT=2400 / 454.2 ms),MEM_AUDITWS=20606 MiB,Commit=24587 MiB,SwapDelta=3981 MiB(MEM_WATCH25.1s:Commit 24852 -> 24745 MiB), 0 errors/crashes.@Androtim on GitHub · 2026-12-01 01:38 UTC · original
Closing stale/conflicted backlog PR per #276. Superseded by the active root-architecture replacement pillars with isolated plain --release A/B verification.
Pull request closed