Rust API
TL;DR
menobis-core owns numerical kernels, fitting loops, pair providers, generation,
and filtering. Python should reach these through PyO3 wrappers only.
Modules
| Module | Role |
|---|---|
distribution |
Pair laws for ME, B, W, and zero-inflated variants |
pairs |
PairDistributionProvider and candidate support abstractions |
fitting |
ME/B/W solvers, support masks, partial excess helpers |
generation |
Seeded samplers over provider-backed pair streams; microcanonical backends under generation::microcanonical |
filter |
Observed and absent-edge p-value sinks |
graph, stats, clustering |
Rust-native graph statistics |
cost / support helpers |
Cost and distance utilities used by fitting/provider code |
model |
Family/problem/sampling-plan ontology used by the unified router |
Key types
| Type | Description |
|---|---|
OccupationFamily |
ME Poisson, B Binomial(M), W Geometric/NegativeBinomial(M) selector |
PairDistribution |
Concrete pair law with sampling, expectation, occupation, p-values |
PairDistributionProvider |
Computes a pair distribution on demand |
CandidateSupport |
All-pairs or sparse-pairs support declaration |
SampledEdges |
Sparse generated edge output |
FitResult and constraint results |
Native fit multipliers and convergence flags |
Microcanonical generation modules
generation::microcanonical dispatches exact-constraint sampling by
constraint type (route.rs); see
Microcanonical algorithms:
generation/microcanonical/
├── occupation_mcmc/ fixed-strength routes: compressed state, 4-cycle chain,
│ fixed-(s,E) local kernel + bridge, fixed-(s,k) degree trace
│ and extras-first constructor, cost chain + gamma fit
├── conditional/ fixed-total pair-Gibbs chain (shared by E,T and k,T)
├── binary/ binary support sampling (degree-events)
├── support/ uniform support sampling (edges-events)
├── mcmc/ shared MCMC config, counters, outcome types
└── route.rs constraint dispatcher
Provider pipeline
FamilyKernel + ConstraintLayer + CostProvider -> PairDistributionProvider -> sink
Generation and filtering should share providers. Fitting should share the same family kernels and cost providers where possible, instead of duplicating ME/B/W formula code.
Current provider coverage
This is generation/filtering provider coverage, not proof that every fitting solver is conforming.
| Provider concept | Families |
|---|---|
| fixed strength | ME, B, W |
| strength-cost | ME, B, W |
| degree-events | ME, B, W |
| strength-edges | ME, B, W |
| strength-degree | ME, B, W |
| custom sparse rates | ME Poisson |
Required conformance
- B and W solver implementations must not call ME fitters and relabel results.
- Zero-inflated providers must follow the AGENTS occupation ontology.
- Partial paths must compute excess constraints and call the corresponding full solver on the free support.
- Heavy graph/statistical loops stay in Rust.
- External graph libraries remain downstream adapters unless MENoBiS adopts a metric as supported core functionality.
See Network Metrics for optional graph-library extension recipes and Architecture for the current module map.