Expand description
§CMCA: Chatman Multifractal Consequence Allocation
bcinr-cmca is an authoritative systems library implementing deterministic,
branchless, and allocation-free algorithms for runtime telemetry, calibration,
monitoring, and cascade allocation (see allocator) of bounded computational
systems. “Covariance Monitoring and Calibration Assessment” was this crate’s
earlier, calibration-only framing; see docs/CMCA_EXPLANATION.md for the
canonical-name reconciliation across this crate’s calibration (observatory)
and cascade-allocation (allocator) responsibilities.
Under the strict constraints of the Radon Law (Cyclomatic Complexity $CC=1$), this module provides tools to audit the health and stability of mathematical substrates without introducing timing side-channels, dynamic heap allocations, or panic-prone execution paths.
§Architectural Foundations
The crate enforces an autonomic feedback loop structured around the standard MAPE-K (Monitor, Analyze, Plan, Execute, Shared Knowledge) control loop:
- Observe: Collect telemetry metrics (such as scaling factors, condition bounds, and drift metrics).
- Infer: Compute safety flags branchlessly using fixed-point arithmetic invariants.
- Propose: Report validation states indicating whether to proceed or trigger recertification.
§Key Modules
fixed: Q16.16 fixed-point arithmetic implementation designed for $CC=1$ operations.allocator: Linear bounds-checked and panic-free bump allocators.observatory: The evaluation engine that computes calibration safety flags based on mathematical thresholds.dme_route: Canonical content-addressed DME route selector. It performs SELECT only; its decisions carry no authority and cannot execute consequences.
§allocator::allocate is fixed to this crate’s own N=8/K=4/Q=4 shape (CMCA-108)
allocator::allocate and allocator::allocate_single_lens – this crate’s
certified, branchless, allocation-free allocation path – are compiled
against this crate’s own object/measure/lens counts (N = 8, K = 4,
Q = 4, from generated::consequence_mass::case_studies), not
generic over caller-chosen sizes. A caller can supply different factor
values but not a different shape without this crate being
regenerated against a different ontology/*.ttl. See
allocator::allocate’s doc comment for why (the branchless kernel
beneath it unrolls against the literal constants 8/4/4) and for
cascade::consequence_mass, the escape hatch for arbitrary tree
shapes.
§Which entry point do I want? (CMCA-119)
Five overlapping ways to get an allocation share out of this crate – this section is a navigation aid, not a restatement of each one’s own doc comment (follow the links below for the real detail):
allocator::allocate– start here for the common case: one LAMBDA-weighted allocation vector across the wholeN/K/Qobject registry, evaluated againstFeasibleRegion::CURRENT. Seeexamples/basic_allocation.rsfor a full runnable walkthrough.allocator::allocate_in– the same computation asallocate, but over a caller-chosenallocator::FeasibleRegioninstead of alwaysCURRENT; use this when evaluating a hypothetical/candidate region rather than the live one.allocator::allocate_single_lens– returns exactly one lens’s allocation vector for one measure, bypassing the LAMBDA blend across allK x Qpairs; use this to inspect “what would lensqalone say” instead of the combined answer.cascade::consequence_mass(requiresalloc) – the escape hatch for tree shapes other than this crate’s fixedN = 8/K = 4/Q = 4; use this when the object/measure/lens counts aren’t the ones this crate was regenerated against.escort::escort_distribution(requiresalloc) – the fractional-exponent escort distributionL_q(i) = p_i^q / SUM_j p_j^qbuilt directly onallocator::power; use this when you need an escort weighting over an arbitrary mass vector, independent of the object-registry allocation machinery above.
§Example Usage
use bcinr_cmca::fixed::NonNegativeFixed;
use bcinr_cmca::observatory::{evaluate_calibration, ObservatoryFlag};
let kappa_hat = NonNegativeFixed::from_bits(131072);
let kappa_under = NonNegativeFixed::from_bits(131072);
let epsilon_on = NonNegativeFixed::from_bits(65536);
let gamma_min_plus_hat = NonNegativeFixed::from_bits(131072);
let gamma_min_plus_under = NonNegativeFixed::from_bits(131072);
let epsilon_gram = NonNegativeFixed::from_bits(65536);
let d_js = NonNegativeFixed::ZERO;
let epsilon_drift = NonNegativeFixed::from_bits(65536);
let s_meas = NonNegativeFixed::ONE;
let s_leaf = NonNegativeFixed::from_bits(32768);
use bcinr_cmca::observatory::{MeasurementArtifact, SupportStanding, ModeDelta};
let artifact = MeasurementArtifact {
point_estimate: kappa_hat,
lower_bound: kappa_under,
upper_bound: kappa_hat,
support_standing: SupportStanding { is_supported: true, smoothing_applied: false },
effective_sample_size: NonNegativeFixed::ONE,
dependence_standing: 0,
numeric_error: NonNegativeFixed::ZERO,
drift: d_js,
gram_lower_bound: gamma_min_plus_under,
graph_digest: 0,
control_mode_digest: 42,
proposal: ModeDelta::ProposeDelta,
};
let status = evaluate_calibration(
&artifact, epsilon_on, epsilon_gram, epsilon_drift, s_meas, s_leaf,
);
assert!(status.is_ok());Re-exports§
pub use allocator::check_hierarchy_acyclic;pub use allocator::HierarchyRefusal;pub use allocator::LensSelectionRefusal;pub use allocator::StabilityRefusal;pub use dme_route::select_dme_route;pub use dme_route::select_gall_route;pub use dme_route::verify_dme_route_decision;pub use dme_route::verify_gall_route_decision;pub use dme_route::AuthorityStanding;pub use dme_route::ConsequenceClass;pub use dme_route::DmeRouteDecision;pub use dme_route::DmeRouteRefusal;pub use dme_route::DmeRouteRequest;pub use dme_route::GallRouteDecision;pub use dme_route::GallRouteRefusal;pub use dme_route::GallRouteRequest;pub use dme_route::GallWorkIdentity;pub use dme_route::RouteCandidate;pub use dme_route::RouteClass;pub use dme_route::RouteExplanation;pub use dme_route::WorkKnowledge;pub use dme_route::WorkStanding;
Modules§
- allocation_
receipt - Allocation audit-trail receipts
- allocator
- Cascade Resource Allocator
- dme_
route - DME route selection: deterministic SELECT over admitted bounded execution classes. This module grants no authority and contains no execution/DO surface. Canonical DME route-selection contract for Chatman Multifractal Cascade Allocation.
- fixed
- generated
- generated_
profile - lrc
- observatory
- Calibration Observatory and Telemetry Engine
- sa2a
- Authority-free SA2A resource-allocation consumer boundary. SA2A third-consumer boundary for CMCA. This module consumes powerless PreparedEffect/resource/receipt identities only. It never mints authority or performs effects.
- stability_
theorem - Weighted Small-Gain Theorem: independent numeric verification
Macros§
Functions§
- dummy_
branchless - A branchless mock/dummy function utilized in tests and contract validation.