feat(graph): record rel change epochs alongside materialized CSR - #806
Merged
adsharma merged 1 commit intoAug 12, 2026
Merged
Conversation
Capture each rel table's storage changeEpoch on the graph entry immediately BEFORE the materializing scan. Consumers compare it to the table's current epoch and treat any mismatch as staleness, falling back to scanning live storage — closing the window where a rel table mutated after PROJECT_GRAPH (with node cardinality unchanged) would let the pinned CSR silently serve the old edge set. Capturing before the scan makes a mutation racing the materialization read as stale: conservative in the safe direction. Follow-up to the eager materialization; requested in extensions#54 review. 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.
Follow-up to #800, from the extensions#54 review: the pinned CSR's only consumption guard was the node dimension, so a rel-table mutation that leaves node cardinality unchanged could let the zero-copy path silently serve a stale edge set.
ParsedNativeGraphEntrynow records each rel table'schangeEpoch(parallel torelCsrResults), captured immediately before the materializing scan — a mutation racing the materialization bumps the epoch, so the consumer's equality check reads it as stale and falls back to live storage. Conservative in the safe direction.Test: epochs recorded per rel, and a post-mutation re-projection records a strictly later epoch. Suite:
ProjectGraphCsrTest7/7.The consuming check lands in extensions#54.
🤖 Generated with Claude Code