Skip to main content

MIN_SAMPLES

Constant MIN_SAMPLES 

Source
pub const MIN_SAMPLES: usize = 180;
Expand description

Frames of history required before the governor will demote at all.

This is the hysteresis, and it is a count rather than a smoothing constant on purpose: it makes “a single spike must not demote” true by arithmetic instead of by tuning. With 180 frames required and 75 % of them needing to miss, no run of fewer than 135 consecutive bad frames can demote — so a window drag, a driver hiccup, or a shader compile cannot, whatever their magnitude. At 60 Hz it is also a 3 s warm-up, which keeps the pathological first frames of a session (pipeline creation, first-use resource builds) out of the verdict.

This number is only satisfiable because of a constant in another module. The only series the renderer ever hands sustained_miss is FrameStats::samples, which yields at most crate::diag::RING items — so a MIN_SAMPLES above the ring’s capacity makes the governor a permanent no-op. See the assertion below.