Repository navigation
perf(reconcile): build the incremental overlap matrix in one pass over the members (#1424) - #1427
Merged
Merged
Conversation
…r the members (#1424) reconcile_plan's overlap matrix intersected every new group with every old entity: groups x entities BTreeSet intersections, almost all empty. An incremental reconcile of a 260k delivery over a 260k corpus therefore ran past 15 minutes on er-dev at 100% of one CPU, after #1417 had already made the full path take seconds. Found by #561's live proof; a local sample of the incremental run showed it all in reconcile_plan. overlap_matrix now indexes each record's old entities once and drops each new group's members into their cells: O(total members). The index keeps every entity a record is in, so the result equals the pairwise definition even if p_old were not a partition. overlap_matrix_equals_the_pairwise_definition pins that, including a record in two entities, a departed record and new ones. Local repro (debug build): an incremental reconcile of 260k over 260k went from never finishing (sampled, then killed) to 27.7 s. er-reconcile's goldens and the er-cli lake tier (68/68) pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 09:36 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Closes #1424
What
reconcile_plan's overlap matrix is built in one pass over the members through a record → old-entities index, instead of intersecting every new group with every old entity.Why
Found by #561's live proof on er-dev. After #1417 a full reconcile of 260k takes seconds, but an incremental one (a second 260k delivery over the first) still ran past 15 min at 100% of one CPU. A local sample put it all in
reconcile_plan: groups × entities BTreeSet intersections, about 6.8×10¹⁰ and almost all empty.Proof
make checkexit 0 before the rebase. The rebase crosses only #1425 (scripts) and #1421 (test fixtures), no shared code. Newoverlap_matrix_equals_the_pairwise_definitionchecks equality with the old pairwise definition, including a record in two entities, a departed record and new records. er-reconcile's goldens and the er-cli lake tier (68/68) pass. Local repro, debug build: incremental reconcile of 260k over 260k went from never finishing (sampled, then killed) to 27.7 s.Risk & rollback
The output is identical by construction, and the test pins it. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T10:41:50Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — b2bdf35, rust 46248283616 + frontend 46248283629 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46248283617
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — the deploy of a7ffca5 (46248780292), which contains b2bdf35, succeeded; live: the Prove a runner task survives a spot reclaim mid-job (drop refresh-dev) #561 run's incremental reconcile over ~780k records took 40 s
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer success
Donethrough the automation rather than byhand, and the issue closed: — Incremental reconcile is O(groups × entities): every new group intersected with every old entity #1424 CLOSED by perf(reconcile): build the incremental overlap matrix in one pass over the members (#1424) #1427 via automation
(a skill, a reference, memory) — or nothing new was learned: — an incremental reconcile has a cost the full path never exercises; Prove a runner task survives a spot reclaim mid-job (drop refresh-dev) #561's live job is the regression record
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
The index keeps every entity a record is in, so the result equals the pairwise definition even if
p_oldwere not a partition.🤖 Generated with Claude Code