perf(merge): classify branch merges from fragment lineage - #540
Open
azimafroozeh wants to merge 2 commits into
Open
perf(merge): classify branch merges from fragment lineage#540azimafroozeh wants to merge 2 commits into
azimafroozeh wants to merge 2 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ragnorc
self-requested a review
August 20, 2026 16:24
ragnorc
approved these changes
Aug 20, 2026
azimafroozeh
force-pushed
the
lineage-merge-deltas
branch
from
August 20, 2026 16:39
b8f31f2 to
b600ef7
Compare
azimafroozeh
force-pushed
the
lineage-merge-deltas
branch
from
August 20, 2026 16:49
b600ef7 to
e32769c
Compare
This was referenced Aug 21, 2026
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.
What & why
Branch merges now read only what changed. The classifier used to run full ordered scans of base, source, and target for every diverged table, so a merge cost O(rows) no matter how small the delta. Candidates now come from a Lance manifest diff per (base, side) pair: byte-identical fragments are skipped unread, new or rewritten fragments contribute their live rows, changed deletion files contribute exactly the deletion-vector difference. The classification loop itself is unchanged and runs over the candidates through chunked exact id IN filters, so merge cost tracks the delta.
Correctness is structural: Lance never rewrites a file behind its name, so every changed row must sit in a changed fragment or a deletion-vector diff, and false positives simply classify as unchanged. A fail-closed gate falls back to the full scan whenever any precondition is unprovable (Blob schema, schema/path/version-pin mismatch, missing stable row ids or the exact-id primary-key contract, non-linear history, candidate byte budget).
Measured with the end-to-end benchmark harness from #537 (release, local FS, warm, 5 reps, frozen validated fixtures, A/A floor under 1%):
Phase attribution puts the entire improvement on the removed scan phase, and write-path counters are byte-identical between modes: the classification route is the only behavioral change.
Backing issue / RFC
Checklist
Local verification
Notes for reviewers
Greptile Summary
The PR changes divergent branch-merge classification to discover candidate entities from Lance fragment and deletion-vector lineage, while retaining a fail-closed full-scan fallback and a debug verification mode.
OMNIGRAPH_MERGE_LINEAGEand updates vocabulary inventory metadata.Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Base, source, and target snapshots] --> B{Lineage preconditions proven?} B -- No --> C[Full ordered three-way scan] B -- Yes --> D[Diff fragment and deletion metadata] D --> E[Collect and chunk candidate ids] E --> F[Exact id filtered cursors] F --> G[Shared three-way classifier] C --> G G --> H[Stage deltas and deletions] H --> I[Validate and atomically publish merge]Reviews (3): Last reviewed commit: "review" | Re-trigger Greptile
Context used: