Add graph_tensor symbolic-to-numeric bridge#121
Open
MesTTo wants to merge 4 commits into
Open
Conversation
c950f77 to
5ba4f04
Compare
Adds the thin fact layer over the interning base: FactId liveness via a weight tombstone (remove_fact tombstones, insert_fact revives the same FactId, the Lucene "live documents" model), live_fact_count, and facts_by_relation, an index from a relation head to its facts so a consumer (EGraph::from_equalities, RelationAdjacency::from_sidecar) scans one relation instead of the whole sidecar. Deliberately excludes incremental maintenance (prefix staleness watermarks, delta application, PathMap re-sync scans): incremental maintenance is deferred project-wide, and PathMap's own shared_node_id COW identity is the right staleness primitive when it becomes needed, not a value-count watermark.
Replaces the hand-rolled 128-bit FNV in TermIdentitySidecar with the canonical Expr::hash (gxhash128 over the term's byte span), the same structural hash the rest of MORK already uses. The hash is only a collision-bucket filter -- exact encoded bytes are compared before an identity is reused -- so the swap cannot change which terms share a TermId, on ground or adversarial input. Modeled in Alloy (fac22_term_identity in MesTTo/alloy-mork): HashSwapPreservesIdentity is UNSAT. Addresses the maintainer's "reuse, don't reimplement" direction (no bespoke hash where the crate has one). term_identity (4) and egraph (2) suites pass.
5ba4f04 to
22cc0e6
Compare
This was referenced Jul 4, 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.
Adds
graph_tensor.rs: a symbolic-relation → CSR-adjacency bridge with GNN/analytics ops (2-hop SpGEMM, GCN normalized adjacency, PageRank), behind the opt-ineinsumfeature.Every numeric op delegates to the existing linalg crate (
Csr::from_edges,Csr::matmul,einsum_auto) — this is the graph-analytics consumer of the linalg einsum/CSR kernels, not a new numeric kernel, and it is distinct from the dense einsum-attention path (tensor_ops). It reuses the term-identity sidecar for the symbol↔dense bijection; the only hand-written numeric code is a 4-line relu. The default build is unaffected.