From 1cf31320a9de3fb960dea94722fb95c3cede5709 Mon Sep 17 00:00:00 2001 From: "Memoria (Noblistic)" Date: Tue, 20 Oct 2026 02:25:55 +0000 Subject: [PATCH] metrics+dashboard: judge-slice cleanups -- HELP text, dead window, window comment Non-gating findings from the Tasmania judge fan-out (reviews/judge/): - HELP text on radiance:decode_step_seconds_best/_recent said 'seconds per token'. It is a window mean of STEP times, and with speculation a step emits several tokens, so the two differ by the accepted-per-step factor -- the wording invited a comparison that is wrong by exactly that factor. Now says PER STEP and names the conversion. No test asserts on HELP text (server_test parses it into d.help and never reads it), so this is a documentation-only change to the exposition, not to the value. - noteSample gains a argument; acceptance passes win=false. Its winAt["accept"] ring was written every poll and read by nobody -- acceptTriple takes highest from extAt and recent/now from accPool -- so it was a second copy of the same samples that a reviewer reasonably mistook for a second figure. - RECENT's '15 s at the 500 ms poll' is true only while the quantity keeps updating; acceptance samples only when it drafts, so its 30-sample span is 30 UPDATES, minutes under sparse drafting (slice 01). Comment corrected. Diff is 16 insertions / 7 deletions across two files, read line by line (scripted sweep -- no test would have caught a wrong anchor). Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI --- core/server/dashboard.cpp | 14 ++++++++++---- core/server/metrics.cpp | 9 ++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) 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());