Repository navigation
Retain composite and disk parent rows until retention pressure - #337
Merged
Merged
Conversation
20 tasks done
Composite and disk stores eagerly removed redundant parent rows even with retention headroom. A single child does not establish that its parent's endpoint is unused: a later conversation branch can still resume there. MemoryStore already keeps such rows until pressure (NVIDIA#264, NVIDIA#302). Reclaim eligible rows in least-recently-used order under retention or incoming-allocation pressure, stopping once headroom returns, and do it before disk maintenance hands any leaf to the pool (leaves already held for handover count toward the target). A composite spill is lossless (the row goes to disk with the record), so it does not thin first; rows are reclaimed where an allocation needs room. Share candidate ordering and free-retention calculations with MemoryStore, queue restored memory rows, and remove queued keys at every removal site (as MemoryStore does), so the queue holds only resident records. Keep the NVIDIA#336 BACKLOG / 2 cap on in-flight truncates; at the cap, make_room can evict a whole record before reclaiming further rows. Parent endpoints stay reusable while space remains, and colder redundant rows go before any other record under pressure. The disk tier now writes the row of every spilled parent, which costs write bytes up front and a truncate later under pressure. Six regressions fail without the change and pass with it: rows kept with headroom and reclaimed in access order under pressure (composite and disk), rows reclaimed before disk maintenance retires leaves, and the thinning queue holding only resident records after expiry, eviction, discard and retirement (composite and disk). The composite, disk-store and memory modules pass on Linux. Not tested: GPU serving with a branching workload. Design-Signed-Off-By: yatesdr; design-review=ed22
yatesdr
force-pushed
the
fix/selene-composite-parent-rows
branch
from
November 18, 2026 22:25
a0c3ebe to
a66ca82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #335.
Retain composite and disk parent rows until retention pressure
Composite and disk stores eagerly removed redundant parent rows even
with retention headroom. A single child does not establish that its
parent's endpoint is unused: a later conversation branch can still
resume there. MemoryStore already keeps such rows until pressure
(#264, #302).
Reclaim eligible rows in least-recently-used order under retention or
incoming-allocation pressure, stopping once headroom returns, and do it
before disk maintenance hands any leaf to the pool (leaves already held
for handover count toward the target). A composite spill is lossless (the
row goes to disk with the record), so it does not thin first; rows are
reclaimed where an allocation needs room. Share candidate ordering and free-retention calculations with
MemoryStore, queue restored memory rows, and remove queued keys at every
removal site (as MemoryStore does), so the queue holds only resident
records. Keep the #336 BACKLOG / 2 cap on in-flight truncates; at the cap,
make_room can evict a whole record before reclaiming further rows.
Parent endpoints stay reusable while space remains, and colder redundant
rows go before any other record under pressure. The disk tier now writes
the row of every spilled parent, which costs write bytes up front and a
truncate later under pressure.
Six regressions fail without the change and pass with it: rows kept
with headroom and reclaimed in access order under pressure (composite and
disk), rows reclaimed before disk maintenance retires leaves, and the thinning queue holding only resident records after expiry,
eviction, discard and retirement (composite and disk). The composite,
disk-store and memory modules pass on Linux.
Not tested: GPU serving with a branching workload.
Linux (cn4): selene composite, disk_store, memory and shared::index, 157 passed.