Release idle snapshot buffers and streamline write-range tracking #108
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!108
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-108"
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?
@zzzz-26 on GitHub · 2026-11-30 13:02 UTC · original
zzzz-26:codex/memory-bookkeeping→main· +23 −296 · 4 files · 49 commits · closed without mergingCPU snapshots can retain allocations indefinitely after a workload spike, while repeated write declarations scan every pending range and allocate temporary vectors for each subtraction. This change expires unused snapshot buffers and keeps exact write declarations sorted for faster duplicate, coverage and completion handling.
Snapshot allocation and destruction happen outside the cache lock. Idle buffers expire after 30 seconds normally or 2 seconds under memory pressure, with at most 32 releases per sweep; checked-out snapshots remain untouched. Existing count and size limits remain.
VICTORY_IDLE_TRIM=0disables expiry.Range tracking preserves exact declaration identities and flight counts. It uses binary search for duplicates, linear coverage traversal, and merge-based exact retirement. Existing residency pressure handling and the fence-quarantined GPU buffer cache remain unchanged. There are no launcher, shader, resolution, upscaling or frame-generation changes.
CPU benchmark
Measured on 2026-11-30, AMD Ryzen 7 7800X3D, Windows, rustc 1.98.1 (48a229cea). The standalone benchmark builds with
rustc --edition=2024 -O; it calls the updated production range helpers and reproduces the previous algorithms from base7281175in the same executable. Each process warms both paths, alternates their measurement order across 11 samples of 20 operations, and reports the median microseconds per operation. The table below takes the median of each column across three process runs; ratios are previous/updated medians.Coverage cases deliberately use disjoint ranges with many holes: these stress repeated subtraction and are not a representative gameplay trace. Mixed declarations include permuted sorted-vector insertions and repeated declarations (4× the range count), so insertion costs are included. Retirement includes cloning the same pending list in both paths. The relay baseline uses its existing binary search; only the non-relay baseline uses linear membership. Assertions check coverage, declarations and relay retirement against the previous implementation before timing.
These results measure CPU range bookkeeping only. They do not establish FPS gains, GPU gains, reduced process working set, or unchanged visual quality in gameplay. The pool expiry policy is covered by deterministic ownership/age/accounting tests, not a RAM-usage benchmark. No game was launched or visual comparison performed. Peak workloads and allocation churn still need gameplay evaluation; sorted-vector insertion is linear and pressure-driven expiry may require later reallocation.
Reproduce from the repository root:
Raw measurements:
docs/benchmarks/memory-bookkeeping-{1,2,3}.csv. All 18 focused tests passed (four range, five pool, nine relay); diagnostics compilation passed. Synthetic ignored unit benchmarks are separate from the standalone measurements above.@readmet3xt-lab on GitHub · 2026-12-01 01:34 UTC · original
Thanks. On hold for measurement: the microbenchmarks are clear, but what decides it is the game itself: the PC's memory over a session and the frame time, before and after, at one place. Memory use is the subject of the next work phase, and this will be measured there.
For the rebase: please leave out the CSV files and the standalone benchmark source under
docs/andscripts/, or say why they should live in the repository.Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.
@readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original
One more note: GitHub closed this pull request by itself when main's history was rewritten, and it cannot be reopened. That is not a rejection. The points above still apply; please open a new pull request from the current main when you have them.
Pull request closed