Exploration: batches as data — Batch<T, B> { desc, inner: Option<B> } - #842
Open
frankmcsherry wants to merge 1 commit into
Open
Exploration: batches as data — Batch<T, B> { desc, inner: Option<B> }#842frankmcsherry wants to merge 1 commit into
Batch<T, B> { desc, inner: Option<B> }#842frankmcsherry wants to merge 1 commit into
Conversation
An exploratory replacement of the BatchReader and Batch traits with a
concrete struct: a batch is a Description plus an optional payload,
absent exactly when there are no updates. Payloads are unconstrained;
reading them is the Navigable capability, and everything else is the
business of whichever harness holds them.
Consequences, in rough order of significance:
* Empty batches are constructible by anyone (a description with no
payload): Batch::empty is a constructor, not a capability, and the
minting question (TraceWriter::seal, Spine::close) dissolves.
* Rc sharing is a payload type parameter, not a forwarding-impl family:
rc_blanket_impls shrinks to the Navigable/cursor forwarding, and
RcBuilder disappears (builders emit Rc payloads directly). External
Arc newtypes would need no batch impls at all.
* Description algebra hoists out of the payload mergers into the spine:
MergeState computes each merge result's description (adjacent lower/
upper, sinces joined with the compaction frontier), and mergers become
pure payload mergers handed a since. A merged payload that cancels
entirely becomes an absent payload.
* len() leaves the public batch surface: its only consumers were the
spine's accounting and logging, so it lives on SpinePayload (the
renamed SpineBatch), alongside the Merger opinion.
* TraceReader grows a Payload associated type; Tr::Batch becomes the
BatchOf<Tr> alias. The join/reduce/half-join tactics take payloads
(empty batches have nothing to join) with an explicit time parameter,
and the drivers keep descriptions for their frontier accounting.
The two kinds of nothing remain deliberately distinct in the spine:
MergeState::Single(None) is structural fuel bookkeeping with no
description at all; Batch { inner: None } is a recorded empty interval.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
frankmcsherry
marked this pull request as ready for review
August 22, 2026 01:45
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.
Replaces the
BatchReaderandBatchtraits with a struct: a batch is a description plus an optional payload, absent exactly when there are no updates.TraceReadergainstype Payload(batches areBatchOf<Tr>); reading a payload remains theNavigablecapability; merging and sizing are the fueled spine's opinions (SpinePayload, withMergerandlen). Consequences:empty) disappear.Rc/Arcsharing is a payload type parameter; the forwarding-impl family (RcBuilder, batch blankets) is deleted.Stacked on #841. Net −115 lines over 40 files; all workspace tests pass.
🤖 Generated with Claude Code