nornir-mimir-graph (mimir_graph)
Mímir v2 graph engine (plan PLAN-MIMIR-V2-2026-10-12.md §4/§6/§11, lane 7): a small safe layer over SuiteSparse:GraphBLAS via our own graphblas-sys. Package name nornir-mimir-graph (mimir-graph on crates.io is someone else's); library name mimir_graph.
Needs the system library: sudo apt-get install -y libgraphblas-dev (7.4).
What is here
-
Matrix<T>/Vector<T>forbool,u64,f64— RAII (GrB_freeon drop), every call returnsResult,Sendbut notSync. -
runtime:GrB_init(GrB_NONBLOCKING)once per process (lazy), linked version check (7.x),set_threads/threads,unsafe finalize. -
CSR import:
Matrix::from_csr(nrows, ncols, offsets, cols, vals: Option<&[T]>)— validate, onememcpyinto malloc'd arrays,GxB_Matrix_pack_CSR(GraphBLAS takes ownership, no further copy). A borrowed slice can't be packed without that copy: GraphBLAS frees packed arrays with its ownfree.Matrix::from_csr_import— same contract viaGrB_Matrix_import(copies inside GraphBLAS); kept for the bench comparison.arrow::from_arrow_edges(batch, from_col, to_col, n_nodes)/from_arrow_edge_batches(&[batch], ..)—UInt64(from_ord, to_ord)columns: sorted-by-(from,to) fast path (count + cumsum straight into the packed offsets array,tobuffer copied once), sorted-by-from with jumbled rows (packed, duplicate-checked), otherwiseGxB_Matrix_build_Scalar(GraphBLAS parallel sort, duplicates collapse; reads a single batch's Arrow buffers in place).
-
ops:reach,reverse_reach,fan_in,fan_out,min_hops,max_on_path,mask_by,mask_vector,similarity(A·Aᵀ),components,diff— the algebra of each is tabled insrc/ops.rs.
Notes from the bench (BENCH-2026-10-12.md)
reverse_reach(mxv onA, no transpose) is 2–10× (typically ~5×) slower thanreachon a materialisedAᵀ. A lens doing several dependents walks should builda.transpose()once and callreachon it.- Direction-optimising BFS (push/pull switch with
Aᵀ) was tried and showed no clear win on the shared box (load 25–38); not kept. componentsis plain label propagation + one pointer jump per round, not FastSV; it is the slowest op (seconds at 10⁷–10⁸ edges).
Not here (yet)
- No op is missing for 7.4 reasons. Not written because no lens needs it yet: general
mxmwith a caller-chosen semiring, weighted shortest paths (min_hopsassumes unit edges), cycle listing (SCCs). - Bench numbers come from an example runner, not nornir's
register_bench!registry: the registry compiles into thenornirlib, which would make every nornir build link libgraphblas.