pub struct EProcessConfig {
pub lambda: f64,
pub alpha: f64,
pub beta: f64,
pub sigma_ema_decay: f64,
pub sigma_floor_ms: f64,
pub warmup_frames: u32,
}Expand description
E-process-style evidence accumulator for gating degradation decisions.
§Mathematical Model
Inspired by anytime-valid e-processes; the accumulator is
E_t = Π_{j=1..t} exp(λ * r_j − λ² / 2)where:
r_jis the standardized residual at frame j:(frame_time − target) / σ̂σ̂is an EMA of absolute deviation (≈ 0.8σ for Gaussian noise), measured against the already-updated EMA mean of frame timesλis a tuning parameter controlling sensitivity (default: 0.5)
§Decision Rule
- Degrade only when
E_t > 1/α(evidence exceeds threshold). Default α = 0.05, so we needE_t > 20. - Upgrade only when
E_t < β(evidence that overload has passed). Default β = 0.5.
§Properties
- Check-every-frame: The gate can be evaluated after every frame; thresholds are tuned empirically rather than by fixed-sample theory.
- Heuristic threshold, not a formal α-bound: because σ̂ is a
mean-absolute-deviation EMA (biased low vs. true σ), residuals are
inflated and
E_tdrifts upward slightly even under healthy jitter, so Ville’s inequalityP(E_t > 1/α | H₀) ≤ αdoes NOT formally hold. In practice this makes the gate a little more eager to degrade than the α suggests, which errs on the fail-safe side. Treatalphaas a tuning knob, not a guaranteed false-positive rate. - Self-correcting: After a burst passes, E_t decays back toward 1.0, naturally enabling recovery.
§Failure Modes
- Sustained overload: E_t grows exponentially → rapid degradation.
- Transient spike: E_t grows briefly → may not cross threshold → PID handles short-term. Only persistent overload triggers e-process gate.
- σ estimation drift: We use an exponential moving average for σ with a warmup period of 10 frames to avoid unstable early estimates.
Fields§
§lambda: f64Sensitivity parameter λ. Higher values detect overload faster but increase false positive risk near the boundary.
alpha: f64Significance level α. Degrade when E_t > 1/α. Default: 0.05 (need E_t > 20 to degrade).
beta: f64Recovery threshold β. Upgrade allowed when E_t < β. Default: 0.5.
sigma_ema_decay: f64EMA decay for σ estimation. Closer to 1.0 = slower adaptation. Default: 0.9 (adapts over ~10 frames).
sigma_floor_ms: f64Minimum σ floor to prevent division by zero. Default: 1.0 ms.
warmup_frames: u32Warmup frames before e-process activates. During warmup, fall back to PID-only decisions.
Trait Implementations§
Source§impl Clone for EProcessConfig
impl Clone for EProcessConfig
Source§fn clone(&self) -> EProcessConfig
fn clone(&self) -> EProcessConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EProcessConfig
impl Debug for EProcessConfig
Source§impl Default for EProcessConfig
impl Default for EProcessConfig
Source§impl PartialEq for EProcessConfig
impl PartialEq for EProcessConfig
impl StructuralPartialEq for EProcessConfig
Auto Trait Implementations§
impl Freeze for EProcessConfig
impl RefUnwindSafe for EProcessConfig
impl Send for EProcessConfig
impl Sync for EProcessConfig
impl Unpin for EProcessConfig
impl UnsafeUnpin for EProcessConfig
impl UnwindSafe for EProcessConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more