Skip to main content

DsfbDebugEngine

Struct DsfbDebugEngine 

Source
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>

Source

pub fn new(config: EngineConfig) -> Result<Self>

Create a new engine with the given configuration.

Source

pub fn paper_lock() -> Result<Self>

Create a new engine with paper-lock configuration.

Source

pub fn config(&self) -> &EngineConfig

Get the engine configuration (read-only)

Source

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.

Source

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 array
  • rho - envelope radius for this signal
  • signal_index - index of this signal
  • window_index - global window index
  • was_imputed - whether this observation was imputed (missing data)
  • recent_raw_states - last n_confirm raw grammar states
  • persistence_count - consecutive Boundary windows
Source

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 window
  • num_windows - total windows
  • fault_labels - per-window fault labels (immutable)
  • healthy_window_end - index of last healthy window for baseline
  • eval_out - output buffer for per-signal evaluations (row-major)
  • episodes_out - output buffer for episodes
  • dataset_name - name for metrics reporting
§Returns

(episode_count, BenchmarkMetrics)

Source

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.

Source

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>

Source

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.

Auto Trait Implementations§

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> Freeze for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> RefUnwindSafe for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> Send for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> Sync for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> Unpin for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> UnsafeUnpin for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

§

impl<const MAX_SIGNALS: usize, const MAX_MOTIFS: usize> UnwindSafe for DsfbDebugEngine<MAX_SIGNALS, MAX_MOTIFS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.