Skip to content

Move layout onto the Cursor; make navigation an optional capability#772

Open
frankmcsherry wants to merge 5 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:navigable
Open

Move layout onto the Cursor; make navigation an optional capability#772
frankmcsherry wants to merge 5 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:navigable

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

Makes the trace substrate agnostic to keys and values: Trace and Batch carry only Time, and all layout / key / val opinions move onto the Cursor.

Three behavior-preserving steps, one commit each:

  1. Move layout off Trace/Batch onto the Cursor; remove LayoutExt.
    The LayoutExt trait and its blanket impl are deleted.
    The borrowed/owned key, val, time, and diff types and their containers now live on Cursor (and Chunk); operators read them via <Tr::Batch as Navigable>::Cursor.
    Layout/WithLayout remain, used only for batch construction.

  2. Make the cursor an optional capability.
    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.

  3. Make Chunk a Navigable time-carrier.
    Chunk drops its own key/val/diff GAT bundle, carrying only Time and 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

frankmcsherry and others added 4 commits June 27, 2026 16:17
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>
@frankmcsherry frankmcsherry changed the base branch from master to master-next June 28, 2026 02:38
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>
@frankmcsherry frankmcsherry marked this pull request as ready for review June 28, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant