Skip to content

feat(graph): record rel change epochs alongside materialized CSR - #806

Merged
adsharma merged 1 commit into
LadybugDB:mainfrom
zachwinter:feat/project-graph-csr-epochs
Aug 12, 2026
Merged

feat(graph): record rel change epochs alongside materialized CSR#806
adsharma merged 1 commit into
LadybugDB:mainfrom
zachwinter:feat/project-graph-csr-epochs

Conversation

@zachwinter

Copy link
Copy Markdown
Contributor

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.

ParsedNativeGraphEntry now records each rel table's changeEpoch (parallel to relCsrResults), 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: ProjectGraphCsrTest 7/7.

The consuming check lands in extensions#54.

🤖 Generated with Claude Code

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>
@adsharma
adsharma merged commit 41f704d into LadybugDB:main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants