perf(merge): read only new catalog commits when opening branch state - #541
Open
azimafroozeh wants to merge 1 commit into
Open
perf(merge): read only new catalog commits when opening branch state#541azimafroozeh wants to merge 1 commit into
azimafroozeh wants to merge 1 commit into
Conversation
azimafroozeh
marked this pull request as ready for review
August 21, 2026 09:07
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Second PR of the merge-latency series, following #540. With the walk removed there, merge cost tracks commit-history depth: opening a branch's state for a merge re-derives its commit projection from a full
__manifestscan every time (~1.5 s p50 and ~24.6k catalog GET calls per merge on a 3500-commit store), and history only grows. This PR makes that read incremental: reuse the already-decoded state when it is provably current, read only the catalog commits appended since, and degrade to exactly today's full scan on anything unprovable.OuterPreparep50, 3,500-commit store, repeat mergesThe repeat-merge shape re-diverges one long-lived branch pair per rep (the pattern the cache serves; fresh-branch runs cannot produce a hit). The residual is the non-FF base snapshot's historical scan, the publish path's per-attempt scan, and the publishing coordinator's post-publish rebuild: named follow-ups.
Backing issue / RFC
Checklist
merge_projection_cache.rs: incremental refresh pinned by probe counters, delete/recreate fenced via merge outcome; fold oracled against the full scan across the whole merge suite in debug; ignored release micro-benchmark of the refresh)Local verification
cargo test -p omnigraph-engine(debug): green; one pre-existing sandbox-only failure (external-blob special-file test, unrelated)cargo test -p omnigraph-engine --release --lib projection_refresh_deep_catalog -- --ignored --nocapture: the 40x row abovecargo clippy -p omnigraph-engine --all-targets,cargo fmt --all, vocabulary guard (all three surfaces): cleanNotes for reviewers
Greptile Summary
The PR adds a per-branch merge-authority cache and incrementally refreshes retained manifest projections by folding newly appended fragments and graph-head deletion-vector changes, while falling back to a full scan for unrecognized transitions.
Confidence Score: 5/5
The PR appears safe to merge; the incremental path is fenced by branch identity and fragment-shape checks and falls back to a full manifest scan when the delta cannot be proven.
The retained projection remains coupled to its exact manifest version, normal Lance merge-insert updates match the modeled new-fragment and immutable deletion-vector shape, and compaction, restoration, branch recreation, malformed deltas, or refresh failures cannot silently reuse the cached state.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Merge requests branch authority] --> B{Cached coordinator exists?} B -- No --> C[Open branch and fully scan manifest] C --> D[Retain state and projection accumulators] B -- Yes --> E[Probe latest manifest incarnation] E --> F{Incarnation current?} F -- Yes --> G[Reuse cached authority] F -- No --> H{Branch identifier unchanged and delta provable?} H -- Yes --> I[Remove superseded graph heads] I --> J[Fold live rows from new fragments] J --> K[Install refreshed state and lineage] H -- No --> L[Full manifest scan] L --> D D --> G K --> G G --> M[Capture snapshot and commit graph for merge]Reviews (1): Last reviewed commit: "perf(merge): read only new catalog commi..." | Re-trigger Greptile
Context used: