Repository navigation
chore(experiments): lab-only D-RST-3 borrowed pattern-CSR view (deferred, evidence only) - #4
Merged
Merged
Conversation
experiments/relstore-visit is an isolated crate (own workspace, rust 1.99) that prepares a relationship layout once (u32 offsets, u32 neighbour slots, u64 stable fact ids, u32 source lane, ordered by (src, fact id)) and hands out a Copy view, pinned to the version the buffers were prepared from. The view implements the visit traits petgraph's Bfs and Dfs need, unmodified. The edge id is the fact id; the physical row is reported separately and moves on rebuild. Out-of-domain endpoints, duplicate fact ids, stale versions and malformed BlasGraph parts are refused, never dropped. Tests compare BFS/DFS orders against a DiGraph oracle built from the facts, cover parallel edges, self-loops, isolated nodes and empty relations, and check borrowed-buffer identity and zero allocations for the view and the neighbour walk. The `quack` feature adds the shared-layout falsifier: a Quack-compiled one-hop reads the same dst buffer at the same version, and the store prepares once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyWZYKycy6MoYDxHRVnV5K
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VyWZYKycy6MoYDxHRVnV5K
AdaWorldAPI
marked this pull request as ready for review
October 20, 2026 08:19
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Adds
experiments/relstore-visit, the D-RST-3 step of lance-graph'srelstore-quack-petgraph-traversal-v1plan (AdaWorldAPI/lance-graph#1622). It is an isolated crate with its own[workspace]and Rust 1.99, and it does not use the quarantinedOutgoingHop. The default build has no lance-graph dependency. Thequackfeature pins lance-graph mainfcd1f60e.What it is
RelationStore::preparebuilds a layout once:u32offsets,u32neighbour slots,u64stable fact ids and theu32source lane, ordered by(src, fact id). The store counts each preparation.prepare_from_blasgraph_partsbuilds the same layout from BlasGraphCsrStorage'snrows,ncols,row_ptrsandcol_indices. It has no values parameter, so the 2 KiBBitVecs cannot be passed in.PatternCsr<'_>is aCopyview made of three borrowed slices and a version, so constructing one allocates nothing. Asking for any other version returnsStale. It implementsGraphBase,GraphRef,IntoNeighbors,Visitable(FixedBitSet),NodeIndexable,NodeCount,NodeCompactIndexable,Data,IntoEdgeReferencesandIntoEdges.EdgeIdis the fact id;FactEdge::row()reports the physical row separately.OutOfDomain,DuplicateFact,Stale,TooLarge,MalformedCsr.quack_hop::one_hop(featurequack): Quack lowerssrc == s, mask-risc executes it over the preparedsrclane, and the neighbours are read from the prepareddstlane at the kept rows.Tests
The oracle is a
DiGraphbuilt from the facts rather than from the layout; the view's BFS/DFS order must match it exactly.quack: the Quack hop gives the same neighbours as the view, reads the samedstbuffer at the same version, and the store prepares once.Seven disable runs (each guard removed alone) each failed their named test; the table is in the README.
Measurements (release, ranges over 3 runs; n 100k, m 1M)
Csr, 5.5–7.2 forDiGraph.Csr, 42–51 ms forDiGraph. The view allocates only petgraph's traversal state. One early run showed the view 2.7× faster thanCsr; repeat runs did not reproduce it.srclane for each query.Open admission questions
srcis sorted. A sealed ordering witness (D-DIAMONDCmp::Range) would make it a range read. That decision belongs to D-RST-1/2.RelationVersionandRelationStoreare stand-ins until the store'sLayoutSealexists.IntoNeighborsDirectedneeds a reverse layout.usizetou32is a preparation, not a borrow.Generated by Claude Code