pub struct AdaptiveRung { /* private fields */ }Expand description
2026-09-25: The controller. Each scheduler context owns one
(SchedCtx::rung), so accept history is not shared between contexts.
Implementations§
Source§impl AdaptiveRung
impl AdaptiveRung
pub const fn new(params: RungParams) -> Self
pub fn from_env() -> Self
pub fn params(&self) -> &RungParams
pub fn width_engaged(&self) -> bool
pub fn width_flips(&self) -> u64
Sourcepub fn observe(&self, n: usize, k_drafts: usize, p1: f64, mean_na: f64)
pub fn observe(&self, n: usize, k_drafts: usize, p1: f64, mean_na: f64)
2026-09-25: Feeds one accept-statistics flush at batch width n:
k_drafts is the flush’s largest draft depth, p1 its first-draft
accept rate, mean_na its mean accepted drafts per verify. The
scheduler’s AcceptBuckets::record is the caller; this type keeps no
accept counters of its own.
Sourcepub fn drafts_for(&self, n_active: usize, num_drafts: usize) -> usize
pub fn drafts_for(&self, n_active: usize, num_drafts: usize) -> usize
2026-09-25: The draft count for a batch of n_active: the static
ladder’s count, raised to min(2, num_drafts) inside the adapted band
while the state is two drafts or a probe is due.
Sourcepub fn note_width_regime(&self, n_active: usize, engaged: bool, cap: usize)
pub fn note_width_regime(&self, n_active: usize, engaged: bool, cap: usize)
2026-09-25: Records the width decision the scheduler already took:
engaged is n_active <= cap, where cap is the run’s
mtp_max_seqs lever (32 unless overridden). It logs one INFO line per
change and counts changes in width_flips; it decides nothing.