Skip to content

int_proxy reduce: tidy the backend interface and the retire harness - #810

Open
frankmcsherry wants to merge 4 commits into
TimelyDataflow:masterfrom
frankmcsherry:int-proxy-tidy-reduce
Open

int_proxy reduce: tidy the backend interface and the retire harness#810
frankmcsherry wants to merge 4 commits into
TimelyDataflow:masterfrom
frankmcsherry:int-proxy-tidy-reduce

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

No description provided.

frankmcsherry and others added 4 commits July 29, 2026 19:37
`retire` held fourteen scratch buffers as inline locals and distinguished its
two phases by comment alone. Those buffers and the times a retire reasons
against now live on a `Retire` struct, whose `run` walks the windows and whose
`determine` / `apply` / `flush` are the phases the comments named.

Pure motion; the only behavioral difference is that `tile_deltas` is cleared at
the start of `apply` rather than the start of the window, which nothing between
the two observes. Also drops a vestigial `'static` on `ProxyReduceBackend::ROut`
and corrects a comment that credited `drain` for what `append` does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ns in place

`reduce_corrections` took five undocumented parallel arrays and returned two
more. The inputs are now a `ReduceRound` and the outputs a `ReduceCorrections`,
each documenting how its lists segment by key.

The corrections are populated in place rather than returned owned, so the
harness's allocation survives the round instead of being replaced by a fresh
pair on every one of them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`seed_times` scanned the whole instance up front and returned a time for every
changed key, so a retire materialized its entire seed set before doing any work.
The harness then derived the changed keys from it and handed them back to the
backend to window.

`advance` replaces both it and `next_window`, on join's model: progress is an
inclusive lower bound on key hash that the backend advances to the exclusive
upper bound of the range it covers, and the window it populates now carries the
seeds for its own keys. What the harness contributes is the times earlier retires
withheld, presented flat and key-ordered for the backend to move through and
block its windows against.

The window is populated in place rather than returned owned, so its three
buffers survive from one window to the next.

The output session now opens on the first window with work, preserving the
behavior of the old changed-is-empty short circuit: a retire with nothing to do
ships no batches rather than an empty one per tile. `advance` correspondingly
draws a non-empty window unless it reports exhaustion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Twenty-one fields to eighteen, none of them costing an allocation.

`pended` becomes a local. It looked like a twin of `moments`, but the two are
drained differently: `append` leaves `moments`' capacity behind for the next key,
where `new_pending` takes `pended`'s allocation whole and leaves nothing. So it
either never allocated or was carried off, and a local does the same work. The
`moments` field now documents that asymmetry, since it is the reason only one of
the pair is a field.

`n_states` becomes a value returned by `determine` and passed to `apply`. It was
per-window state in a per-retire struct, and the dependency between the phases
was invisible.

`held` and `tile_of` were parallel by held index, and become one `tiles` list.

Also renames `cur_out` to `out_accum`, matching `in_accum` beside it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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