Skip to content

int_proxy: backends may complete keys themselves (trimmed assist) - #1116

Open
frankmcsherry wants to merge 5 commits into
master-nextfrom
tactics-assist-trimmed
Open

frankmcsherry wants to merge 5 commits into
master-nextfrom
tactics-assist-trimmed

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

The int_proxy join and reduce backends may complete a key themselves, rather than present it to the tactic.
This brings the two assist spikes (proxy-assist-join, proxy-assist-spike) onto master-next, with a smaller DD surface than proxy-assist-both.

The DD surface

  • JoinInstance borrows its batches and gains present_all; a join backend may leave a key out of the bridges and emit its output, every pair of its updates, from the following cross.
  • ReduceInstance gains present_all; a reduce backend may complete a key that direct finds one time for, commit its output to the batch, and report the times it carries beyond upper in the new ReduceWindow::carried.
  • next_window takes the due (key, time) associations (Due, now public) in place of the changed keys.
  • direct is public, the one-time rule both the tactic and backends apply.
  • BackendFrontier sets present_all, so as-of reads see every key.
  • A backend that completes nothing is unchanged; the vec backend needed four lines.

DD non-test: +175/−47. DD tests: +361/−4 (a completing join backend and a completing reduce wrapper, checked against presenting ones, inside and outside BackendFrontier, in an iterative dataflow, and for a key that carries a time beyond upper).

The corgi backends

  • Join (+468/−311): the leaf path now finds a whole block's runs on both sides first (SideRuns, matched), then decides per key whether to complete it or stage it. This folds the old leaf_probe, leaf_merge and leaf_merge_primitive into one path. Completion itself (completes, Pairs, cross_rows, mixed_signs, net_side) is about 170 lines.
  • Reduce (+536/−91): a second evaluation path for direct keys (Direct, Rows, net, complete), reading time lanes in place.

Measured

On 92c9ae1, mini-01, one worker, three alternating trials, answers identical; CPU, lower is better.

workload this branch #1069
LDBC SF1 one-off −22.8% −11.6%
SCC 50 churn ticks −35.0% −1.4%

The #1069 column is from an earlier rotation against the same base.
Corgi completed every reduce key on LDBC. On SCC churn 70.5% of reduce keys are owed a carried time, and all of them are direct once the backend sees their due times, which is why next_window takes Due. The join completes 90–100% of keys on the workloads measured.

Not yet tight

These repeat logic that lives elsewhere and are candidates to fold together before landing:

  • The one-time rule is in DD (direct) and again on corgi lanes (Direct::candidates).
  • The join's replay threshold is in the tactic (join_key) and again in corgi (replays).
  • Netting by value and time is in net_side (join), net (reduce), and the consolidation in stage_runs.

Also open:

  • The reduce.rs module doc still says completion is for keys "not owed a carried time", which commit 5 made stale.
  • The tactic builds changed only to test whether it is empty.
  • JoinInstance's borrowed fields exist only for present_all.
  • No assertion checks that corgi's lane-wise choice of direct keys agrees with direct.

Commit messages mention local measurement branches (map/tactics-*); they are not pushed.

🤖 Generated with Claude Code

frankmcsherry and others added 5 commits November 24, 2026 09:50
A join backend may leave a key out of the bridges and emit its output, every
pair of its updates, from the following `cross`, which the iterator now calls
after every block. A reduce backend may leave out a key not in `changed` whose
one time `direct` finds, commit its output to the batch itself, and report the
times it carries beyond `upper` in the new `ReduceWindow::carried`, which the
tactic adds to its pending times. `present_all` on both instances lets
`BackendFrontier` ask for every key in a unit it reads as of a frontier.

A backend that completes nothing is unchanged. The tests add a completing
join backend and a completing reduce wrapper over the vec backend, and check
them against presenting ones, inside and outside `BackendFrontier`, in an
iterative dataflow, and for a key that carries a time beyond `upper`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The corgi join backend of map/tactics-tighten (c1651784), on the smaller
contract: `advance` records the row pairs of the keys it completes, and the
following `cross` crosses them before the tactic's matches. The threshold
for completing a key is stated here, as the tactic's own choice need not agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The corgi reduce backend of map/tactics-tighten (c1651784), on the smaller
contract: the retire's upper bound comes from the description `begin`
receives, the times completed keys carry go to `ReduceWindow::carried`, and a
key in `changed`, which the tactic owes a carried time, is presented rather
than completed, so the backend needs no due times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key owed a carried time is presented, as the backend is not told its due
times. The tactic now applies `direct` to every key it is presented, its due
times among the seeds, in place of its narrower single-seed shortcut, and
carries the other records' joins with the key's time. No contract change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measurement variant of map/tactics-surface. `next_window` takes the due
`(key, time)` associations (`Due`, now public) in place of the `changed` keys,
so a backend may complete a key owed a carried time, with its due times among
the seeds. The corgi reduce restores tighten's lane-wise use of the due times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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