crates/knut-rel2graph-bench/src/lib.rs
//! # knut-rel2graph-bench
//!
//! A scalable **benchmark + correctness harness** for bifröst's rel2graph
//! engine. It (1) defines a realistic 12-table ERP relational schema, (2)
//! generates deterministic synthetic instances of it at a chosen `scale`,
//! (3) runs the *real* bifröst mapping fabric over that data to build a
//! [`GraphMutation`](knut_bifrost::GraphMutation), and (4) asserts the graph is
//! CORRECT and measures how construction TIME scales.
//!
//! Everything runs through bifröst's **public** rel2graph API — the
//! `MappingSpec` + `Transform` fabric, `GraphPlan::from_mapping`, and thund's
//! `to_thund_pipeline` projection. No live FalkorDB is needed; correctness is
//! asserted at the `GraphMutation` / `VertexSet` / `EdgeSet` seam.
//!
//! ## The correctness rules asserted (see the bench design doc for citations)
//! * **table → node label, PK → node key** — node count per label == distinct
//! PKs of that table.
//! * **FK → edge** — edge count per relationship == that FK's cardinality.
//! * **M:N junction table → EDGE, not a spurious vertex** — the two junction
//! tables emit edges only; no `OrderItem`/`ProductSupplier` label ever appears.
//! * **no dangling endpoints** — every non-null edge endpoint resolves to a node.
//! * **composite / self-referential keys** — the junction composite keys and the
//! `Employee-[:REPORTS_TO]->Employee` self-loop map correctly.
//!
//! These hold as property-style invariants at **every** scale.
pub mod export;
pub mod generate;
pub mod harness;
pub mod prng;
pub mod schema;
pub use export::{ExportManifest, export_networkx, write_source_parquet};
pub use generate::{GeneratedDb, generate};
pub use harness::{GraphSummary, build_mutation, distinct_count, nonnull_count, summarize};
pub use prng::Rng;
pub use schema::{Table, mapping_spec, schema};
/// The default seed used across the harness — fixed so every run is reproducible.
pub const DEFAULT_SEED: u64 = 0x9E37_79B9_7F4A_7C15;