corgi reduce: delta-proportional presentation - #812
Merged
frankmcsherry merged 2 commits intoJul 31, 2026
Conversation
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>
antiguru
reviewed
Jul 31, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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