From 1dd979f95528085a0f59a29250840eb7d73ee9d7 Mon Sep 17 00:00:00 2001 From: "Antonio S. Musumeci" Date: Fri, 10 Apr 2026 13:25:33 -0400 Subject: [PATCH] Reset hill-climb warmup after idle period to re-seed EMA When throughput dropped to zero, the monitor reset direction and decline_streak but not warmup_samples. On resumption, the first meaningful throughput sample was compared against a stale pre-idle EMA value, which could cause the hill-climber to make a scaling decision based on a meaningless delta (new throughput vs. zero-decayed EMA from potentially minutes ago). Reset warmup_samples to 0 in the idle branch so the EMA is re-seeded from two fresh samples before the hill-climber acts. This ensures the first scaling decision after an idle period is based on current throughput trends rather than stale history. Co-Authored-By: Claude Opus 4.6 (1M context) --- vendored/libfuse/include/thread_pool.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vendored/libfuse/include/thread_pool.hpp b/vendored/libfuse/include/thread_pool.hpp index ff4aad14..292f7f5b 100644 --- a/vendored/libfuse/include/thread_pool.hpp +++ b/vendored/libfuse/include/thread_pool.hpp @@ -584,11 +584,14 @@ ThreadPool::monitor_routine(void *arg_) // Only adjust if there's meaningful work happening. // Reset direction to +1 (bias toward growth) so a stale // shrink direction from before the idle period doesn't - // penalize the pool when work resumes. + // penalize the pool when work resumes. Also reset warmup + // so the EMA re-seeds from fresh samples rather than + // comparing against a stale pre-idle value. if(ema_throughput < 0.5 && prev_ema < 0.5) { decline_streak = 0; direction = 1; + warmup_samples = 0; continue; }