Repository navigation
host, send, uav_pool: trim only unborrowed low-water spare pools at 1 Hz sweep - #3381
Maverick0351a wants to merge 1 commit into
Conversation
…y unborrowed low-water spare pools at 1 Hz sweep trustno1-coder#3381 by Maverick0351a, head 5cd08d8.
…he 1 Hz sweep (PR trustno1-coder#3381) Port of trustno1-coder#3381, applied clean. On a PC under RAM pressure the 1 Hz sweep emptied the spare upload, scratch, send and UAV buffer pools every second (80 to 150 MiB of the active per-frame set), and the next frame stalled 20 to 253 ms in CreateCommittedResource and Map. Now send::SPARE tracks a low-water mark and only the unborrowed surplus is trimmed (all of it only under critical commit), and evicted resources are dropped outside the lock. Upstream: a 32 GB host, median 35.6 ms with a 1 Hz hitch before; not run on a 3080 here.
…n, engagement not shown
|
I reproduced a send-cache regression at Cherry-pickable commit Tested cache behavior only. In two existing RTX 4060/32 GB |
|
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch |
…wed low-water spare pools at 1 Hz sweep # Conflicts: # crates/victory-gpu/src/host.rs
|
Measured this side by side with the other fixes for the same send-spare churn on an RTX 5080 + 9800X3D, 32 GB (where
This PR had the best fps and the fewest long frames in this round. The second round is running and I'll post it here. The 9.3 ms left in this PR's trim step is spent on the submitting thread; #3994 moves the release to its own thread, so the two could combine. AI use: Claude Code (Claude Opus 5.5). |
|
Shootout, final (2 runs per arm): RTX 5080 + 9800X3D, 32 GB, vnv 829188e + #3347, walking, Series X native 1440p, DLSS off, world +30..330 s. Every arm has the same local per-step sweep timing.
AI use: Claude Code (Claude Opus 5.5). |
Summary
sweep()runs once per second (1 Hz) insideHost::submitwhen!behind(all in-flight submissions have landed, so 100% of the active per-frame D3D12 upload, scratch, submission-send, and UAV buffers have just been returned to the spare pools).physical_free < 5 GiB(pressured() == trueandkeeps_under_pressure() == false, even with > 60 GiB of commit headroom available), the 1 Hzsweep()previously called immediatetrim_to(16 MiB)/trim_to(0)onUPLOAD_SPARE,SPARE,SPARE_SHARED,UAV_SPARE, andsend::SPARE:send::trim()did not track a low-water mark (low), removed the largest buffers first (spare.remove(0)), and droppedID3D12ResourceinsideSPARE.lock().trim_spare_uploads(),trim_spare_chunks(), anduav_pool::sweep_uav_spare()usedtrim_toinstead ofSpare::trim_above(most), destroying80-150 MiBof the active per-frame working set every second at!behindonly for the very next frame to stall for20-253 mscallingCreateCommittedResource+Mapin D3D12 (frame_times: 27 frames, median 35.6 ms, p99 52-115 ms; 1 over 50 msat 1 Hz;VICTORY_SEND_OWN: 27-253 ms taking them out of the CPU sides).(kept, bytes, low)insend::SPARE, evicts only the unborrowed low-water surplus (spare.low.saturating_sub(floor)) insend::trim()unlesscritical_commit()is true, and drops evictedID3D12Resourceallocations outsideSPARE.lock().Spare::trim_abovein the 1 Hzsweep()hooks (trim_spare_uploads(),sweep_spare_chunks(), anduav_pool::sweep_uav_spare()) when!critical_commit(), while preserving immediatetrim_spare_chunks()for F7 hard flush (drop_spare_chunks()),xmemfallback, and tests.