Skip to content

Proxy time adapter - #904

Draft
frankmcsherry wants to merge 2 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:proxy-time-adapter
Draft

frankmcsherry wants to merge 2 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:proxy-time-adapter

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

Support to allow a proxy backend to use a different time type than advertised by the tactic. This is primarily to advertise a dynamic timestamp like Pointstamp<T> but specialize it to [T; K] behind the scenes.

frankmcsherry and others added 2 commits September 23, 2026 10:47
A proxy backend names `type Time: Timestamp + Lattice + From<T>`, the time in
which the tactic reasons and in which bridges, seeds, matches and emitted
records are presented. The tactics convert only frontiers: the join's meet,
and the reduce's `upper`, held capabilities, and carried times (back through
`T: From<Time>`). `std`'s reflexive `From` makes `Time = T` the unchanged
default, which the reference `VecReduceBackend` uses.

This separates the timestamp a dataflow advertises from the representation
its operators compute with: a backend whose times are dynamically sized can
present them to the tactic as a fixed-width, `Copy` value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYmDrD6KjihNREYsBvmTpP
A DDIR time is `Product<u64, PointStamp<u64>>`. Its dynamically sized
`PointStamp` is what the scope structure needs, but it spills to the heap two
scopes deep, and every clone, join and comparison in the proxy tactics walks
a vector. An operator knows its scope depth when rendered, and every time it
sees has at most that many scope coordinates.

`corgi::flat::Flat<K>` holds the epoch and scope coordinates in a `[u64; K]`,
padding with zeros where `PointStamp` strips them, so both forms are canonical
and their orders agree. It is `Copy`, never allocates, and converts to and from
`Time` with `From`, which the proxy tactics use for frontiers. It is never a
dataflow's timestamp, so its only path summary is the identity, `()`. `RowTime` reads
and writes it directly against a `ColTimes` lane column. The Corgi join and
reduce backends take the tactic's time as a parameter, and `Backend::join` and
`Backend::reduce` now receive the scope depth, from which Corgi picks
`Flat<depth + 1>` up to depth 3, and `Time` itself beyond.

Tests check the conversions round-trip and preserve order, join and meet, and
that reduce presentation agrees in both representations.

Corgi, 1 worker, 5 interleaved runs, medians (master-next -> this):

  scc    200k edges, 200 x 50     load 713 -> 630 ms   churn 4.08 -> 3.47 s
  count  1M rows, 200 x 500       load 101 -> 95 ms    churn 2.28 -> 1.79 s
  reach  2M edges, 100 x 100      load 805 -> 733 ms   churn 484 -> 437 ms
  kcore  200k edges, 200 x 50     within noise

Outputs match; interactive tests pass; AoC 2023 corgi 33/33.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYmDrD6KjihNREYsBvmTpP

This branch has not been deployed

No deployments
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