gpu: lazily attach host lists on reset and trim idle list/send pools under memory pressure #319
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/Belobug--VIctory-Belobug-AMD!319
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-319"
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?
@mynzjerko on GitHub · 2026-11-26 20:03 UTC · original
mynzjerko:perf/lazy-host-list-and-idle-trim→a-publier· +292 −52 · 4 files · 1 commits · closed without mergingAddresses the idle command-list allocator and upload-pool memory pressure noted on 32 GB / RX 9070 systems (see #298).
Summary
1. Lazy
HostListattachment acrossdetach/resetandthin::BACKS(RAM + CPU)list::detachandlist::detach_partseagerly popped or created afresh_list()(each holding a D3D12ID3D12CommandAllocatorand optional prelude allocator) and immediately calledfresh.close()so the idleListkept a liveHostListuntil its nextReset()— wherehost.reset()then reset the empty allocator and list a second time.VICTORY_THIN=1(default inscripts/play.ps1),thin::back_listalso created aHostList+close()even though everyRecordingstarts withRESET, andthin::BACKSwas an unbounded pool of rawBox<List>shells whose parked/abandoned entries retainedHostLists, uploads, and draw state.detach/detach_partssimplytake()list.host(leavingNone), eliminating redundantclose()+ secondreset()calls and preventing idle title lists andthin::BACKSfrom holding D3D12 command allocators.list::resetlazily attaches an already-open, already-resetHostListviafresh_list()whenlist.hostisNone(and callsHostList::mark_usedto preserveLISTS[3]accounting).thin::back_listallocates an empty shell (host: None),Recording::dropcallslist::release_idle_backto strip/recycle any unsubmittedHostList,earlierparts, uploads, and draw state before parking, andBACKSis bounded (BACKS_MOST = 128) with excess shells dropped outside the lock.2. Trim idle
HostListandsend::SPAREupload pools underVICTORY_RESIDENCY=1list::IDLE(previously always capped at 512 and never trimmed) now scales its limit withresidency(512 default -> 128 on <=32 GBlimited_host_ram-> 32 underpressured-> 0 undercritical_commit) and exposeslist::trim_idle()to drop the oldest idleHostLists outside the lock during the 1 Hz sweep.host::send::SPARE(previously always capped at 768 MiB and dropping buffers under the mutex) now scales its budget withresidency(768 MiB default -> 256 MiB limited -> 64 MiB pressured -> 0 critical; 256 MiB BAR unchanged), drops freed D3D12 upload buffers outside the lock, and exposessend::trim_spare()for the 1 Hz sweep.trim_spare_chunks()inhost.rswhenresidency::pressured() || residency::critical_commit().Verification (Windows 11, RX 9070 / 32 GB RAM)
cargo xtask policy: passed (269 files ok)cargo test -p victory-gpu --locked --lib -- --test-threads=1 list:: queue:: host::send:: residency::(default &--all-features): 21/21 passed, including live D3D12 tests for lazydetach/reset,release_idle_back, andtrim_idle_to(0)cargo test -p xtask --locked: 9/9 passedcargo clippy -p victory-gpu --no-deps --all-targets --all-features --locked: 0 warnings in all modified filescargo build --locked --profile diag -p victory --features diagnostics: clean build(Prepared with AI assistance; compiled and tested locally on Windows 11 with an AMD Radeon RX 9070.)
Pull request closed