pub struct DsfbDebugEngine<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> { /* private fields */ }Expand description
Main DSFB debugging engine — stateless, deterministic, read-only.
The engine evaluates telemetry residuals through the DSFB pipeline and produces typed, auditable debugging episodes.
§Const Generic Parameters
MAX_SIGNALS: maximum number of monitored signals (span durations, error rates, etc.)MAX_MOTIFS: maximum heuristics bank entries
§Non-Intrusion Contract
All public methods accept only &self and &[T] (shared immutable references).
There is NO mutable write path into any upstream data structure.
The Rust type system enforces this at compile time.
Implementations§
Source§impl<const S: usize, const M: usize> DsfbDebugEngine<S, M>
impl<const S: usize, const M: usize> DsfbDebugEngine<S, M>
Sourcepub fn new(config: EngineConfig) -> Result<Self>
pub fn new(config: EngineConfig) -> Result<Self>
Create a new engine with the given configuration.
Sourcepub fn paper_lock() -> Result<Self>
pub fn paper_lock() -> Result<Self>
Create a new engine with paper-lock configuration.
Sourcepub fn config(&self) -> &EngineConfig
pub fn config(&self) -> &EngineConfig
Get the engine configuration (read-only)
Sourcepub fn heuristics_bank(&self) -> &HeuristicsBank<M>
pub fn heuristics_bank(&self) -> &HeuristicsBank<M>
Get the engine’s heuristics bank (read-only). Exposed for the
fusion harness’s consensus-aware scoring pass; operators
reading this can call bank.match_episode_with_consensus(...)
against any closed DebugEpisode directly.
Sourcepub fn evaluate_signal(
&self,
residual_norms: &[f64],
k: usize,
rho: f64,
signal_index: u16,
window_index: u64,
was_imputed: bool,
recent_raw_states: &[GrammarState],
persistence_count: usize,
) -> SignalEvaluation
pub fn evaluate_signal( &self, residual_norms: &[f64], k: usize, rho: f64, signal_index: u16, window_index: u64, was_imputed: bool, recent_raw_states: &[GrammarState], persistence_count: usize, ) -> SignalEvaluation
Evaluate a single window of telemetry for a single signal.
§Non-Intrusion Contract
All inputs are shared immutable references. Cannot modify upstream data.
§Arguments
residual_norms- historical residual norms for this signal (immutable)k- current window index into the norms arrayrho- envelope radius for this signalsignal_index- index of this signalwindow_index- global window indexwas_imputed- whether this observation was imputed (missing data)recent_raw_states- last n_confirm raw grammar statespersistence_count- consecutive Boundary windows
Sourcepub fn run_evaluation(
&self,
data: &[f64],
num_signals: usize,
num_windows: usize,
fault_labels: &[bool],
healthy_window_end: usize,
eval_out: &mut [SignalEvaluation],
episodes_out: &mut [DebugEpisode],
dataset_name: &'static str,
) -> Result<(usize, BenchmarkMetrics)>
pub fn run_evaluation( &self, data: &[f64], num_signals: usize, num_windows: usize, fault_labels: &[bool], healthy_window_end: usize, eval_out: &mut [SignalEvaluation], episodes_out: &mut [DebugEpisode], dataset_name: &'static str, ) -> Result<(usize, BenchmarkMetrics)>
Run the full DSFB evaluation pipeline over a dataset.
This is the main entry point for benchmark evaluation.
§Non-Intrusion Contract
All input slices are shared immutable references. Outputs are written into caller-owned mutable buffers.
§Arguments
data- row-major observation data [window][signal] (immutable)num_signals- signals per windownum_windows- total windowsfault_labels- per-window fault labels (immutable)healthy_window_end- index of last healthy window for baselineeval_out- output buffer for per-signal evaluations (row-major)episodes_out- output buffer for episodesdataset_name- name for metrics reporting
§Returns
(episode_count, BenchmarkMetrics)
Sourcepub fn run_evaluation_with_graph(
&self,
data: &[f64],
num_signals: usize,
num_windows: usize,
fault_labels: &[bool],
healthy_window_end: usize,
eval_out: &mut [SignalEvaluation],
episodes_out: &mut [DebugEpisode],
dataset_name: &'static str,
service_graph: &[(u16, u16)],
) -> Result<(usize, BenchmarkMetrics)>
pub fn run_evaluation_with_graph( &self, data: &[f64], num_signals: usize, num_windows: usize, fault_labels: &[bool], healthy_window_end: usize, eval_out: &mut [SignalEvaluation], episodes_out: &mut [DebugEpisode], dataset_name: &'static str, service_graph: &[(u16, u16)], ) -> Result<(usize, BenchmarkMetrics)>
run_evaluation plus graph-attribution: same return value, but
each closed episode’s root_cause_signal_index is populated by
walking the supplied service-call graph (see crate::causality).
Backward-compatible with v0.1: callers without a graph use
run_evaluation and get root_cause_signal_index = None on
every episode.
Sourcepub fn verify_deterministic_replay(
&self,
data: &[f64],
num_signals: usize,
num_windows: usize,
fault_labels: &[bool],
healthy_window_end: usize,
) -> Result<bool>
pub fn verify_deterministic_replay( &self, data: &[f64], num_signals: usize, num_windows: usize, fault_labels: &[bool], healthy_window_end: usize, ) -> Result<bool>
Deterministic replay verification (Theorem 9 proof-by-construction).
Runs the evaluation twice on identical inputs and verifies identical outputs.
Source§impl DsfbDebugEngine<256, 64>
impl DsfbDebugEngine<256, 64>
Sourcepub fn default_size() -> Result<Self>
pub fn default_size() -> Result<Self>
Create with default const generics (256 signals, 64 motifs).
The 64-slot heuristics bank holds 29 canonical motifs as of v0.2 (Session 3 expansion); the remaining 35 slots provide v0.3 / v0.4 headroom for additional site-specific findings.