diff --git a/core/server/dashboard.cpp b/core/server/dashboard.cpp index 5b71bae9..3118b095 100644 --- a/core/server/dashboard.cpp +++ b/core/server/dashboard.cpp @@ -1523,15 +1523,21 @@ function setMetric(key, value, text) { * diluting it. The engine's own figure is already a windowed rate (its help text: "over the * scheduler's recent window"), so this window sits on top of the engine's smoothing -- it * decides how long the page remembers, not how sharply the engine measures. */ -const RECENT = 30; /* 15 s at the 500 ms poll */ +const RECENT = 30; /* 15 s at the 500 ms poll WHILE the quantity keeps updating; a quantity + that skips polls (acceptance, which only samples when it drafts) spans + 30 UPDATES, which under sparse drafting is minutes, not 15 s. */ const RECENT_PREFILL = 10; /* 5 s: shorter than the shortest prefill event (see above) */ const extAt = {}, winAt = {}; let lastActiveC = 0; -function noteSample(key, c, value, cap) { +/* `win` false records the extreme only. Acceptance keeps its own pooled ring (accPool) and + * reads `highest` from extAt, so a window here would be a second, never-read copy of the + * same samples -- dead weight that a reviewer reasonably reads as a second figure. */ +function noteSample(key, c, value, cap, win) { if (value == null || !finite(value)) return; const e = extAt[key] || (extAt[key] = {}); - const w = winAt[key] || (winAt[key] = {}); if (!(c in e) || value > e[c]) e[c] = value; + if (win === false) return; + const w = winAt[key] || (winAt[key] = {}); const s = w[c] || (w[c] = []); s.push(value); if (s.length > (cap || RECENT)) s.shift(); } @@ -1990,7 +1996,7 @@ function update(s, dt) { const aw = accWindow(s); const awR = aw ? aw.ratio : null; const restarted = accRestart; accRestart = false; - if (awR != null) noteSample("accept", s.running > 0 ? s.running : lastActiveC, awR); + if (awR != null) noteSample("accept", s.running > 0 ? s.running : lastActiveC, awR, null, false); /* POOLED ACCEPTANCE WINDOW (2026-10-20, math audit before the production roll). * triple()'s `recent` averages the per-poll RATIOS; polls carry unequal draft counts, so a * quiet poll and a 500-draft poll would weigh the same -- a mean of ratios, not a ratio of diff --git a/core/server/metrics.cpp b/core/server/metrics.cpp index 76c55085..8498b8c4 100644 --- a/core/server/metrics.cpp +++ b/core/server/metrics.cpp @@ -337,11 +337,14 @@ std::string Metrics::render() const { if (g_step_best_.get() > 0) w.gauge("radiance:decode_step_seconds_best", "Fastest single-sequence decode step window this process has run, in seconds " - "per token. A mean over 32 consecutive single-stream steps, not a stopwatch " - "reading. Resets on restart.", L, g_step_best_.get()); + "PER STEP. A mean over 32 consecutive single-stream steps, not a stopwatch " + "reading. Not seconds per token: with speculation a step can emit several " + "tokens, so divide by the accepted-per-step figure to compare against a " + "token rate. Resets on restart.", L, g_step_best_.get()); if (g_step_recent_.get() > 0) w.gauge("radiance:decode_step_seconds_recent", - "Most recent single-sequence decode step window, in seconds per token. The gap " + "Most recent single-sequence decode step window, in seconds PER STEP (see " + "_best: not a token rate). The gap " "to _best tracks what else the machine is doing, not wear; see docs/GUIDE.md. " "Freezes while the lane is idle, because no window is completing.", L, g_step_recent_.get());