Repository navigation
Extract MergeLadder from MergeBatcher; split Extractor from Merger - #938
Merged
Merged
Conversation
The merge batcher's geometric ladder of chains is now `MergeLadder`, which holds no opinion about how updates leave it. `MergeBatcher` is a chunker, a ladder, and the carve by frontier, and behaves as before. The ladder offers `insert_chain`, `merge_all`, `chains`, and `retain_chains`; the last lets a batcher remove updates from the fronts of chains, keeping the weights chains were pushed with. `Merger` keeps `Chunk`, `merge`, `len`, and `allocation`. `Time` and `extract` move to `Extractor: Merger`, which only `MergeBatcher` requires. Implementors of `Merger` outside this repository move those two items into an `impl Extractor`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The merge batcher's geometric ladder of chains becomes
MergeLadder, a type other batchers can use.The ladder holds no opinion about how updates leave it; that opinion stays with
MergeBatcher.The first other user is the corgi half join's batcher (#937), which keeps chains in time order and releases prefixes from the fronts of chains rather than merging everything at each extraction.
Changes
MergeLadder<M: Merger>holds the chains with their cached weights, the stash, the merger, and the size accounting.new,insert_chain,merge_all,chains, andretain_chains.retain_chainslets a caller remove updates from each chain and re-accounts the chain for the logger.MergeBatcheris a chunker, a ladder, and the carve by frontier, with unchanged behavior, including the stash shared between merging and extraction.MergerkeepsChunk,merge,len, andallocation.Timeandextractmove to a newExtractor: Merger, which onlyMergeBatcherrequires.VecMergerandChunkMergerimplement both; their bodies are unchanged.Breaking change
Implementors of
Mergeroutside this repository movetype Timeandfn extractinto animpl Extractor.Testing
The workspace builds, and every test passes.
The two existing
MergeBatcherfrontier tests now push chains through the ladder.🤖 Generated with Claude Code