host, send, uav_pool: trim only unborrowed low-water spare pools at 1 Hz sweep #3381
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3381
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3381"
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?
@Maverick0351a on GitHub · 2026-11-29 22:32 UTC · original
Maverick0351a:fix/sweep-spare-low-watermark→main· +49 −10 · 2 files · 1 commits · openSummary
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.@tyr0nsur on GitHub · 2026-11-30 07:39 UTC · original
I reproduced a send-cache regression at
5cd08d8. Ingive_back, the cap loop removes the first entry after appending the newly returned buffer. If that buffer is larger than the entire cap, the loop evicts every existing spare before dropping the oversized buffer too. In a deterministic test with a 128 MiB cap, a 2 GiB one-shot return unnecessarily evicted the existing 16 and 64 MiB spares. This can happen with a large exact-size send from #3729 as well.Cherry-pickable commit
8fb4ea9restores the original largest-first cap eviction and preserves the remaining buffers' return order for the low-water trim. It reuses the hostSpareaccounting and drops the released buffers outside the lock. Both new tests failed with the original cap behavior and passed with the fix. On Windows, the spare filter passed 11 tests. I also applied this PR plus the follow-up and #3729 together on41adb551; all six send unit tests passed there (two hardware probes were ignored). Staged asset policy passed.Tested cache behavior only. In two existing RTX 4060/32 GB
.05logs, host pressure was logged but the 4 GiB upload refusal did not appear. No in-game timing measurement for this patch. Reviewed and tested with Codex assistance.@dyshay on GitHub · 2026-11-30 08:55 UTC · original
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched code pass. A run on an RTX 4090 is queued. Frame times will follow here.@Lyrnc on GitHub · 2026-11-30 14:01 UTC · original
Measured this side by side with the other fixes for the same send-spare churn on an RTX 5080 + 9800X3D, 32 GB (where
pressured()always holds), on vnv829188e9+ #3347. Walking, Series X native 1440p, DLSS off, 300 s windows; first round, one run each: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).
@Lyrnc on GitHub · 2026-11-30 14:13 UTC · original
Shootout, final (2 runs per arm): RTX 5080 + 9800X3D, 32 GB, vnv
829188e9+ #3347, walking, Series X native 1440p, DLSS off, world +30..330 s. Every arm has the same local per-step sweep timing.8b801739)AI use: Claude Code (Claude Opus 5.5).
5cd08d87bdtoa433e1ac0fa433e1ac0ftoc637ae56a6View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.