perf(resource): release settled peak render-target reserve after 20s stability window #3944
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3944"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by qlfu on 2026-11-30T12:36:39Z.
Summary
targets_room_kept(crates/victory-gpu/src/resource.rs), the default peak-based path already computes theGREW/settle(VICTORY_CARD_ROOM_FOR_TARGETS_SETTLE_MS, default 20 s) stability window on every call, buttargets_kept_from_peakignored it and held the 1.5x peak reserve indefinitely instead of releasing it once targets settle.targets_kept_from_peak_settled(most, targets, peak, still_ms, settle): oncesettle > 0 && targets >= 256 MiB && still_ms >= settle, returns0(matching the flat-reserve path'stargets_kept), freeing ~850 MiB of texture headroom on 12 GiB cards in steady-state gameplay while keeping the full reserve during startup/scene transitions and whensettle == 0.Verification
crates/victory-gpu/src/resource.rscovering pre-settle, settled,settle == 0, and below-256-MiB cases.cargo test -p victory-gpu --lib --locked -- resource:: --test-threads=1: passed (0 failed).cargo check -p victory-gpu --all-targets --all-features --locked: exit 0.git merge-tree --write-tree 41adb551 HEAD: clean merge.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T13:16:30Z.
I reproduced a scene-transition case at
aa0b9cc. After targets have settled, a sharp drop updateslastintargets_seenbut leaves the last growth timestamp unchanged. The automatic reserve can stay at zero while a prior target set has gone away and its replacements have not yet been made.The companion patch restarts the automatic stability timer after a 64 MiB or larger move in either direction. During replacement it holds only the gap to the preceding footprint, capped by the existing maximum. The explicit flat setting still uses the growth-only timer, and settle=0 retains the original peak calculation. The footprint and timer are sampled together so a competing reader cannot store an old timer value.
In a synthetic trace for the 2,560 MiB small-card cap, the original PR kept zero after a settled 1,712 MiB footprint dropped to 390 MiB. The patch keeps 1,322 MiB of admission headroom at that point, 812 MiB after the replacement footprint reaches 900 MiB, and zero after 20 seconds at 900 MiB. These are policy outputs. No title run or VRAM-usage claim. The focused resource suite passed 46 tests on an RTX 4060 and under WARP.
Companion commit
View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.