Skip to main content

dsfb_dscd/
lib.rs

1//! Deterministic Structural Causal Dynamics (DSCD) layered on DSFB + ADD.
2//!
3//! This crate provides two layers:
4//! - legacy sweep utilities used by existing notebooks/binaries in this repo,
5//! - paper-facing deterministic simulation APIs (`DscdConfig`,
6//!   `run_dscd_simulation`) for threshold scaling, provenance, and figure CSVs.
7//!
8//! All DSCD pipelines are deterministic and reproducible.
9
10pub mod config;
11pub mod graph;
12pub mod integrations;
13pub mod paper;
14pub mod sweep;
15
16pub use config::{
17    create_timestamped_output_dir, create_timestamped_output_dir_in, workspace_root_dir,
18    DscdScalingConfig, DscdSweepConfig, OutputPaths,
19};
20pub use graph::{
21    add_trust_gated_edge, add_trust_gated_edge_with_provenance,
22    expansion_ratio as legacy_expansion_ratio, reachable_from, DscdEdge as LegacyDscdEdge,
23    DscdGraph as LegacyDscdGraph, Event, EventId,
24};
25pub use integrations::{
26    compute_structural_growth_for_dscd, generate_dscd_events_from_dsfb, DscdEventBatch,
27    DscdObserverSample, ResidualState, RewriteRule, StructuralGrowthSummary, TrustProfile,
28};
29pub use paper::{
30    build_graph_for_tau, compute_reachable_component_size, create_dscd_run_dir, effective_trust,
31    expansion_ratio, linspace, run_dscd_simulation, structural_distance, DscdConfig, DscdEdge,
32    DscdError, DscdEvent, DscdGraph, DscdParams,
33};
34pub use sweep::{
35    build_graph_from_samples, export_edge_provenance_by_edge_id,
36    export_edge_provenance_by_endpoints, run_threshold_scaling, run_trust_threshold_sweep,
37    ThresholdRecord,
38};