perf(victory-gpu): reclaim idle host list allocators, thin backing lists, and spike indirect buffers #494
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/494"
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 LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T12:59:28Z.
Summary
VICTORY_RECLAIM_LISTS=1(off by default, preserving existing default behaviour until A/B-measured in-game):idle_cap: 512 / 256 / 64 / 0) and periodic idle eviction vialist::let_go_idle()hooked intohost::sweep().list::boxed()whenVICTORY_RECLAIM_LISTS=1is set.list/thin.rs) and word buffers under host RAM pressure; evicted backing lists are dropped directly viaBox::from_raw(since backing lists never go throughobject::hand_outand haverefs == 0, soobject::release_boxed::<List>would be a no-op and leak them), andimpl Drop for Listpurges any staleVALUE_WAITSentries.indirect_keep_limit(1 MiB, 256 KiB under pressure), overflow batch buffers, and oversizedstates/twinsmaps onHostList::reset()whenVICTORY_RECLAIM_LISTS=1.evict_idle,idle_cap,backs_cap,indirect_keep_limit,release_back_drops_unreferenced_backing_list, andhost_list_reset_trims_oversized_indirect_buffer_when_reclaim_enabled.Verification
cargo +stable-x86_64-pc-windows-gnu test -p victory-gpu host_list_reset_trims_oversized_indirect_buffer_when_reclaim_enabled -- --nocapturecargo +stable-x86_64-pc-windows-gnu test -p victory-gpu list:: -- --nocapturecargo +stable-x86_64-pc-windows-gnu run -p xtask -- policy->asset policy: 295 files ok.VICTORY_RECLAIM_LISTS=1).Checklist
E_NOTIMPL), never a fake success.Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T15:49:10Z.
Thanks for going after the allocator RAM. I found no reuse of an allocator still in flight (
recycleonly sees listslist::ranreported, andlet_go_idleonly evicts lists already reset). Before merge:boxed()now takes pooled lists, andHostList::reset()drops indirect buffers above 1 MiB (256 KiB under pressure) on every reset. The last one can cost frame time: a pass that needs a >1 MiB indirect buffer every frame (cutscenes, chases) will now free and recreate a UAV buffer each frame. Please either put the new reclamation behind an env switch, or give before/after numbers for both thelists' allocatorsprivate RAM and fps on such a scene, and say in the description which defaults change.evict_idle, the caps,indirect_keep_limit,release_back). Reverting thereset()drops or the sweep would not fail any test. A test that grows a list's indirect buffer past the limit, resets it and checks that it is gone (and kept below the limit) would cover the new path.object::release_boxed::<List>, but the code (list/thin.rs,release_back) usesBox::from_raw, and your own test explains whyrelease_boxedwould leak. Please update the text.We will also run it in game on our side.
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T16:25:13Z.
Addressed all 3 points:
elease_boxed) and document \VICTORY_RECLAIM_LISTS=1.
Re-verified \host_list_reset_trims_oversized_indirect_buffer_when_reclaim_enabled, \list::\ (11 passed), and \xtask policy.
Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-28T00:15:28Z.
Main just took #563 (the VIctory copy moved to Vice-Tay
4f15f09e) and #564 (memory stack), and this PR now conflicts inthird_party/victory/crates/victory-gpu/src/host.rs,third_party/victory/crates/victory-gpu/src/list.rs. Please rebase on current main, rerun the tests for the files you touch, and force-push.Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-28T08:19:38Z.
Rebased onto
main(132da61), resolving conflicts inhost.rsandlist.rswhile preserving both#564'sidle_trim_seconds/texture_backs/close_open_listschanges and this PR'sVICTORY_RECLAIM_LISTS=1-gated reclamation.Verified locally:
cargo test -p victory-gpu host_list_reset_trims_oversized_indirect_buffer_when_reclaim_enabled: 1 passed, 0 failedcargo test -p victory-gpu list::: 15 passed, 0 failedcargo run -p xtask -- policy:asset policy: 377 files okImported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-30T00:57:02Z.
Closing since the upstream project has been discontinued. Thanks for everything!
Pull request closed