Skip to content

corgi reduce: delta-proportional presentation - #812

Merged
frankmcsherry merged 2 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:corgi-reduce-delta
Jul 31, 2026
Merged

corgi reduce: delta-proportional presentation#812
frankmcsherry merged 2 commits into
TimelyDataflow:master-nextfrom
frankmcsherry:corgi-reduce-delta

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

The reduce presentation is the corgi backend's one remaining non-delta-proportional path — 95% of an incremental round's profile, ~50% in collect_present's per-retire O(trace) rescan alone (measured: scc steady-state at 5.4x vec per round, vs ~1.1x under open-loop concurrency and 2.2x FASTER than vec on large flat scans).

Opening commit: seek-vs-scan, decided per retire when the changed-set and trace sizes are known. Narrow changed sets over seekable (single-leaf) keys gallop via find_ranges — no key hashing; broad churn keeps the scan. Steady-state reach improves 4.51s → 2.10s, past the vec backend (0.84x); scc improves 794 → 597ms/round, with the residual attributed to genuinely-broad cascade retires.

Planned follow-ons in this PR's arc: the windowed reduce-presentation seam (the reduce sibling of #809's join reshape), then presentation memoization behind it — the pieces that own scc's remaining gap.

🤖 Generated with Claude Code

collect_present was the one non-delta-proportional path left: an O(trace)
rescan (plus per-chunk key re-hashing) every retire, ~50% of an incremental
round's profile. It now decides per retire, when the sizes are known: a
narrow changed set over seekable keys (single-leaf: ids ARE key values, so
the ascending changed set converts to a needle column) gallops each chunk
once per changed key with find_ranges — no hashing at all; broad churn keeps
the scan, whose flat membership test beats marginal seeking (a find_ranges
probe is a structurally-dispatched binary search; SEEK_ADVANTAGE=16 measured
as a load regression before widening to 64). Hashed ids of structural keys
cannot be inverted into needles and always scan.

Steady-state (1000 rounds x batch 100, 100k/200k): reach 4.51s -> 2.10s —
past the vec backend's 2.51s (1.8x -> 0.84x); scc 794 -> 597ms/round, the
residual being retires whose label cascades genuinely broaden the changed
set — the windowed-presentation seam's territory, not a threshold's.
Load-shaped scc unchanged (3.60s).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread interactive/src/corgi/reduce.rs
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@frankmcsherry
frankmcsherry marked this pull request as ready for review July 31, 2026 15:05
@frankmcsherry
frankmcsherry merged commit 465c6bd into TimelyDataflow:master-next Jul 31, 2026
6 checks passed
@frankmcsherry
frankmcsherry deleted the corgi-reduce-delta branch July 31, 2026 15:07
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.

2 participants