Move layout onto the Cursor; make navigation an optional capability#772
Open
frankmcsherry wants to merge 5 commits into
Open
Move layout onto the Cursor; make navigation an optional capability#772frankmcsherry wants to merge 5 commits into
frankmcsherry wants to merge 5 commits into
Conversation
Trace and Batch are now key/val-blind, carrying only Time. The borrowed/owned key, val, time, and diff types and their containers move onto the Cursor (and Chunk), reached via `<Tr::Batch as Navigable>::Cursor`. The LayoutExt trait and its blanket impl are deleted; Layout and WithLayout remain for batch construction only. This is behavior-preserving: every cursor still exists and is found the same way at runtime; only where the key/val/layout types are named has moved. All lib tests pass unchanged. Operators read key/val/diff from the batch cursor's GATs rather than the trace, so `as LayoutExt` becomes `as Cursor` throughout. join_core (Arranged and Collection) gained a diff type-param to pin a Multiply-on-projection bound the solver would not otherwise connect. A shared trace::BatchCursor<Tr> alias names a trace's cursor type. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BatchReader no longer requires Navigable, so a trace or batch can carry only Time without being able to produce a cursor. Navigating operators request the capability explicitly with a `Tr::Batch: Navigable` bound and a cursor bound that pins `Time = Tr::Time`; most already carried the Navigable bound, since naming a trace's cursor requires it, so this mostly just makes those bounds load-bearing. Behavior-preserving: the merge and build paths do not navigate, and every existing trace type is still Navigable, so all operators resolve as before; tests pass unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Chunk declared the full key/val/time/diff GAT bundle (plus containers) itself, only to feed its cursor. It now carries just Time and requires Navigable, so the layout opinions live solely on the chunk's cursor, reached via <Self::Cursor as Cursor>::Key like every other consumer. This matches how Trace and Batch carry only time and reach key/val through a cursor. Behavior-preserving; tests pass unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pure reorganization with no behavior change; tests pass unchanged.
- Fold `Tr::Batch: Navigable` into the `TraceReader<Batch: Navigable, ...>` bound, using associated-type-bound sugar to group each trace's constraints.
- Give the Cursor `owned_*` / `clone_time_onto` methods default bodies derived from their containers, dropping the redundant per-impl copies. (Default method bodies are stable, unlike associated-type defaults, so the GATs stay per impl.)
- Consolidate split `trace::{...}` imports into one grouped line per file.
- Add `Batch{Key,Val,ValOwn,Diff,DiffGat,TimeGat}` aliases for the batch-cursor type projections and sweep the verbose `<BatchCursor<Tr> as Cursor>::Val<'_>` spellings to them.
Co-Authored-By: Claude Opus 4.8 <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.
Makes the trace substrate agnostic to keys and values:
TraceandBatchcarry onlyTime, and all layout / key / val opinions move onto theCursor.Three behavior-preserving steps, one commit each:
Move layout off Trace/Batch onto the Cursor; remove
LayoutExt.The
LayoutExttrait and its blanket impl are deleted.The borrowed/owned key, val, time, and diff types and their containers now live on
Cursor(andChunk); operators read them via<Tr::Batch as Navigable>::Cursor.Layout/WithLayoutremain, used only for batch construction.Make the cursor an optional capability.
BatchReaderno longer requiresNavigable, so a trace or batch can carry onlyTimewithout being able to produce a cursor.Navigating operators request the capability explicitly with a
Tr::Batch: Navigablebound.Make
ChunkaNavigabletime-carrier.Chunkdrops its own key/val/diff GAT bundle, carrying onlyTimeand reaching key/val through its cursor like every other consumer.A
trace::BatchCursor<Tr>alias names a trace's cursor type and keeps the operator bounds readable.The changes are type-level only — they move where the key/val/layout types are named, not what runs.
The lib tests pass unchanged at each step, and perf measured at parity.
🤖 Generated with Claude Code