victory-gpu: pool HostList::upload buffers across command list resets #14
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14"
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?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T05:07:12Z.
## Summary
Pools mapped upload buffers allocated by
HostList::uploadacross command list resets (separately forshared = falseandshared = truecard_stepsbuffers) instead of creating and destroying a fresh D3D12 committed buffer per copy:crates/victory-gpu/src/host.rs.Deferred::list_uploadsuntil the list resets/drops (after its GPU fence has completed), then returns them viagive_list_uploads; buffers outside 64 KiB..16 MiB allocate exact size and drop unpooled.trim_spare_chunks()alongside scratch chunks, and keepsHostList::untouched()accurate.host::list_upload_pool_testsverifying size-class bucketing, real D3D12HostList::upload->close->resethandle reuse across bothshared/non-shared pools, oversized bypass, andtrim_spare_chunks()cleanup.Rig Specs Tested On
driver 621.24.0)Run Settings & Profile
diag@2a7608c(victory --release --features diagnostics)series-s(0.6666667internal scale)offDLSS quality(VICTORY_DLSS=1 VICTORY_DLSS_MODE=quality)offVICTORY_*Overrides:play.rsSETTINGSdefaults (VICTORY_LEVELS_ON_DEMAND=0,VICTORY_CARD_STEPS=2,VICTORY_TEXTURE_POOL=1,VICTORY_PRELUDE_UPLOADS=1,VICTORY_CARD_ACCOUNTING=1,VICTORY_D3D12_DRED=light)Measurements & Verification
10.65 fpsmedian (93.7 ms/frame, peaking at11.9 fps/83.7 mson balcony) vsbaseline-main8.9 fpsmedian (+1.75 fps)5,812 MBmax VRAM /6,945 MBmin budget (over = 0 MB,room_false = 16.7%vsbaseline-main5,864 MB/33.3%);19,394 MBprivate commit42,657uploaded (2,058 MB), final waiting drained to1,546(vsbaseline-main7,121,-5,575)median luma = 104.61,near_black = 0.0%,edge_energy = 6.97,magenta = 0.0%0crashes,0no host textureerrorsmapped()ran ~23 ms/sup to05:06:37until a single Windows/DXGI residency paging spike (717.1 msmax ->91.19 ms/soverall);made so far: 5,383 upload buffersalso still reflects directhost.upload_buffer()callers outsideHostList::upload(to be addressed separately).cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(294 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask(6 passed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu(450 passed; 0 failed; 36 ignored)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T06:04:31Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
This PR pools mapped upload buffers allocated by
HostList::uploadincrates/victory-gpu/src/host.rsacross command list resets, separated into twoSpare<Chunk>pools (SPARE_LIST_UPLOADandSPARE_LIST_SHARED_UPLOAD) forshared = falseandshared = true(card_steps::stage() > 1).What looks solid
Deferred::list_uploadsand returned viagive_list_uploadsonly whenDeferreddrops (onHostList::resetor list drop after GPU completion), matching the existingplane_uploads/give_chunkslifetime model.list_upload_classsafely rounds sizes in64 KiB..=16 MiB(LIST_UPLOAD_MIN..=LIST_UPLOAD_MAX) usingchecked_next_power_of_two(), andtake_list_uploadfalls back to exact-size allocation if the rounded-up allocation fails (withgive_list_uploadsdropping non-power-of-two or out-of-range buffers outside the mutex lock).LIST_UPLOAD_SPARE_MOST(64 MiB per kind, 16 MiB underresidency::limited_host_ram()), respectscratch_pool(), and are drained intrim_spare_chunks()even whenSPAREis empty.Deferred::hold_list_upload/DropkeepALIVE[6]/ALIVE[7]balanced, andHostList::untouched()checksdeferred.list_uploads.is_empty().host::list_upload_pool_testscovers size-class rounding, handle reuse acrossshared/non-sharedpools,untouched(), oversized bypass, andtrim_spare_chunks().Minor non-blocking notes
give_chunks,give_list_uploadsdoes not hook into the periodic 10-secondallocator_trim()(VICTORY_ALLOCATOR_TRIM=1) path (it only drains ontrim_spare_chunks()under host memory pressure).host_list_upload_pools_buffers_by_shared_kind_until_resetassumescard_steps::stage() <= 1in the test process environment when exercisinglist_a.uploadas the non-shared path.Verdict
CI is passing and the logic/safety look solid, but because this changes D3D12 host upload/shared buffer reuse and lifetime management in
crates/victory-gpu/src/host.rs, a local real-GPU smoke test is recommended before merging.Generated with Antigravity CLI (
agy).