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
Anytime-valid e-process for gating degradation decisions.
§Mathematical Model
The e-process is a nonnegative supermartingale under H₀ (system is healthy):
E_t = Π_{j=1..t} exp(λ * r_j − λ² * σ² / 2)where:
r_jis the standardized residual at frame j:(frame_time − target) / σσis the estimated standard deviation 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
- Anytime-valid: The test is valid at any stopping time, unlike fixed-sample tests. We can check after every frame without p-hacking.
- Bounded false positive rate: P(E_t ever exceeds 1/α | H₀) ≤ α (Ville’s inequality).
- 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 · 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