pub struct DsfbRfEngine<const W: usize, const K: usize, const M: usize> { /* private fields */ }Expand description
Main DSFB Structural Semiotics Engine.
A zero-allocation, deterministic observer that combines envelope admissibility, sign-segment grammar, DSA scoring, Lyapunov exponent estimation, heuristics, and policy evaluation into a single state machine operating on IQ residuals.
§Type Parameters
W— sliding window length for sign-segment and DSA statistics.K— grammar state-machine size (number of grammar states).M— heuristics bank capacity.
§Non-Intrusion Contract
The engine is a read-only observer. It never modifies, delays, or discards
samples from the underlying signal chain. See NON_INTRUSIVE_CONTRACT.
§Example
use dsfb_rf::engine::DsfbRfEngine;
use dsfb_rf::platform::PlatformContext;
let mut eng = DsfbRfEngine::<10, 4, 8>::new(0.05, 3.0);
let ctx = PlatformContext::operational();
let _obs = eng.observe(0.1, ctx);Implementations§
Source§impl<const W: usize, const K: usize, const M: usize> DsfbRfEngine<W, K, M>
impl<const W: usize, const K: usize, const M: usize> DsfbRfEngine<W, K, M>
Sourcepub fn new(rho: f32, tau: f32) -> Self
pub fn new(rho: f32, tau: f32) -> Self
Construct engine with given envelope radius ρ and DSA threshold τ.
Sourcepub fn from_calibration(healthy_norms: &[f32], tau: f32) -> Option<Self>
pub fn from_calibration(healthy_norms: &[f32], tau: f32) -> Option<Self>
Construct from a healthy-window norm slice (Stage III calibration).
Computes ρ = μ + 3σ from healthy_norms.
Returns None if slice is empty.
Sourcepub fn with_snr_floor(self, db: f32) -> Self
pub fn with_snr_floor(self, db: f32) -> Self
Set a custom SNR floor (default: −10 dB).
Sourcepub fn with_decimation(self, factor: u32) -> Self
pub fn with_decimation(self, factor: u32) -> Self
Set the semiotic decimation factor (default: 1 — no decimation).
With factor = D, the full semiotic pipeline runs once per D input
samples. The input window accumulates the RMS of D norms before
forwarding to the sign → grammar → syntax → semantics → DSA → policy
chain.
§When to use
At high sample rates (≥ 1 MS/s) where structural changes of interest
(thermal drift, PA aging, mask approach) occur at kHz or Hz rates.
Decimation effectively sets the structural monitoring bandwidth to
sample_rate / D Hz, which is appropriate for the physics timescale.
§Non-intrusion guarantee is preserved
The accumulator is entirely internal. observe_decimated() still takes
only &[f32] immutable slices from the caller. factor=1 (default)
means observe_decimated() === observe() with zero overhead.
§Example
use dsfb_rf::engine::DsfbRfEngine;
// 1 GSPS receiver; monitor at 100 kHz structural rate
let eng = DsfbRfEngine::<10, 4, 8>::new(0.1, 2.0)
.with_decimation(10_000);
assert_eq!(eng.decimation_factor(), 10_000);Sourcepub fn decimation_factor(&self) -> u32
pub fn decimation_factor(&self) -> u32
Current decimation factor.
Sourcepub fn observe(
&mut self,
residual_norm: f32,
ctx: PlatformContext,
) -> ObservationResult
pub fn observe( &mut self, residual_norm: f32, ctx: PlatformContext, ) -> ObservationResult
Process one residual norm observation.
The full pipeline stages run in order. Returns an ObservationResult
containing the complete audit chain for this observation.
§Non-Intrusion
residual_norm and ctx are consumed by value or immutable reference.
No caller-owned data is mutated. The engine advances only its own
internal state.
Sourcepub fn observe_decimated(
&mut self,
residual_norm: f32,
ctx: PlatformContext,
) -> Option<ObservationResult>
pub fn observe_decimated( &mut self, residual_norm: f32, ctx: PlatformContext, ) -> Option<ObservationResult>
Process one residual norm through the decimation accumulator, then (only when a full epoch completes) through the full semiotic pipeline.
Returns None for all intermediate samples within an epoch.
Returns Some(ObservationResult) once per decimation_factor() calls.
With decimation_factor() == 1 (the default), this is identical to
observe() and returns Some on every call.
§Motivation (paper §XIX-A — Semiotic Decimation)
DSFB monitors the envelope of the physics, not the cycle of the carrier. Structural state changes (thermal drift, oscillator aging, mask approach) occur at kHz/Hz rates. Running the full Fisher-Rao, Lyapunov, and grammar machinery at 1 GSPS is unnecessary and violates the sensor physics. Decimation resolves the “Computational Wall” criticism without sacrificing structural detection sensitivity.
§Non-intrusion guarantee preserved
The norm argument is consumed by value; ctx is passed by value.
No caller-owned data is mutated.
§Example
use dsfb_rf::engine::DsfbRfEngine;
use dsfb_rf::platform::PlatformContext;
let mut eng = DsfbRfEngine::<10, 4, 8>::new(0.05, 2.0)
.with_decimation(100);
let ctx = PlatformContext::with_snr(20.0);
for i in 0..99 {
assert!(eng.observe_decimated(0.02, ctx).is_none());
}
let result = eng.observe_decimated(0.02, ctx);
assert!(result.is_some()); // 100th sample triggers epochSourcepub fn episode_count(&self) -> u32
pub fn episode_count(&self) -> u32
Current escalation-episode count.
Sourcepub fn grammar_state(&self) -> GrammarState
pub fn grammar_state(&self) -> GrammarState
Current grammar state.
Sourcepub fn contract(&self) -> NonIntrusiveContract
pub fn contract(&self) -> NonIntrusiveContract
Return the typed non-intrusion contract for this observer.
Use this in operator advisories, SigMF dsfb:contract annotations,
and VITA 49.2 context packets to formally assert the integration
guarantees provided by this implementation.
§Example
use dsfb_rf::engine::DsfbRfEngine;
let eng = DsfbRfEngine::<10, 4, 8>::new(0.1, 2.0);
let c = eng.contract();
assert_eq!(c.integration_mode, "read_only_side_channel");
assert_eq!(c.unsafe_count, 0);