From 77f91a0240587abc794b205395fdc08e87cf8ff9 Mon Sep 17 00:00:00 2001 From: "Memoria (Noblistic)" Date: Tue, 20 Oct 2026 02:11:37 +0000 Subject: [PATCH] dashboard: fix the pooled ring's property names -- recent/now were NaN, never rendered Two judge slices (Tasmania 27B, :8101) independently found what the auditor's pass at 1505ef2 missed: accWindow pushes {ratio, dr, da} but acceptTriple read d.r/d.a/last.r/last.a -- accPrev's names, a different object. Every pooled sum was undefined, so the acceptance detail line was frozen at 'highest X% - recent -' in the PRODUCTION page since 1505ef2. The headline was unaffected, which is why it looked alive. Fixed to d.dr/d.da/last.dr/last.da. Also from the judges: the Speculation 'Average' bullet printed 0% for an undefined lifetime marginal (no drafts yet), breaking the panel's own rule that 0 reads as failure -- now a dash. The comment above it cited a 'GUIDE' that does not exist; it now cites the README section, which is re-landed here (dropped in the rebase onto v1.9.0) with the worked example corrected: 56/75/77 implies 43.4% marginal, not the 44% previously claimed. New test the_pooled_acceptance_ring_reads_the_names_accWindow_writes holds both sides of the ring contract to the same names -- it fails on the exact bug above, which no C++ test could see because the page JS is never executed here. Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (level not visible) via Open WebUI --- README.md | 21 +++++++++++++++++++++ core/server/dashboard.cpp | 12 +++++++----- tests/dashboard_test.cpp | 31 +++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5e99c450..9ca9d2e1 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,27 @@ ctest --test-dir build -L oot # rebuilds every bundled plugin out o `CMakePresets.json` names the same runs (`ctest --preset fast`, `host`, `gpu`, `full`, `asan`), and [`docs/GUIDE.md`](docs/GUIDE.md) ยง1.3 describes the tiers and the test binaries' options. +## Draft acceptance + +Speculative decoding drafts up to `--num-speculative-tokens` tokens a step; the target model +verifies them in one pass, and a draft survives only if it matches what the target would have +produced. A position is verified only when every earlier position survived, so the same events +admit two ratios, and they differ only in the denominator: + +- **Conditional** -- accepted / *reached*: of the drafts actually verified at a position, how + many passed. The dashboard's live "accepted now" figure and the per-position bars are + conditional. Always the higher number, and it moves with the workload. +- **Marginal** -- accepted / *drafted*: of everything the drafter proposed, how much survived. + The engine's `draft_accept` (/stats, and `radiance:draft_acceptance_ratio` on /metrics) is + marginal, cumulative over the life of the process. Lower by construction, and slow to move. + +They cannot agree, and neither is the other one broken. At depth 3 a step drafts three tokens +but reaches position 3 only when 1 and 2 both passed, so marginal is roughly the product of the +conditionals: bars reading 56/75/77% give (0.56 + 0.56x0.75 + 0.56x0.75x0.77) / 3 = 43%. A live +63% beside a lifetime 43% is one lane, two questions. Quote the conditional when asking "how +good is the drafter right now"; quote the marginal when asking "what fraction of draft work +became text." Never compare the two across that boundary. + ## Documentation | | | diff --git a/core/server/dashboard.cpp b/core/server/dashboard.cpp index cd0f2a0f..5b71bae9 100644 --- a/core/server/dashboard.cpp +++ b/core/server/dashboard.cpp @@ -1562,13 +1562,13 @@ function acceptTriple(c, showNow) { const ring = accPool[c]; if (!e || !(c in e) || !ring || !ring.length) return ""; let R = 0, A = 0; - for (const d of ring) { R += d.r; A += d.a; } + for (const d of ring) { R += d.dr; A += d.da; } if (R <= 0) return ""; const last = ring[ring.length - 1]; const tag = typeof c === "number" && c > 1 ? "@c" + c : ""; let out = "highest " + pct(e[c], 0) + " \u00b7 recent " + pct(A / R, 0); - if (showNow !== false && e[c] > 0 && last.r > 0) - out += " \u00b7 now " + Math.round(100 * (last.a / last.r) / e[c]) + "% of highest" + tag; + if (showNow !== false && e[c] > 0 && last.dr > 0) + out += " \u00b7 now " + Math.round(100 * (last.da / last.dr) / e[c]) + "% of highest" + tag; return out; } @@ -1656,7 +1656,7 @@ const totals = kvPanel($("totals"), ["Requests", "Steps"]); * panel used to carry as its headline. A bullet now rather than the big number: see the note at * the accept tile. It divides by every token DRAFTED, so it is not comparable with the live * figure above it, which divides by the positions actually REACHED -- the two bases are worked - * through in the GUIDE, and both are derivable from the log. Deliberately not spelled out on the + * through in README.md, section "Draft acceptance", and both are derivable from the log. Deliberately not spelled out on the * face of the panel: the distinction is an analysis-time concern, and a tooltip is invisible on * the phone anyway. */ const spec = kvPanel($("spec"), ["Drafter", "Depth", "Average"]); @@ -2119,7 +2119,9 @@ function update(s, dt) { $("specaside").textContent = "depth " + dp.length; spec["Drafter"].textContent = drafterName; spec["Depth"].textContent = dp.length; - spec["Average"].textContent = pctn(s.draft_accept, 0) + "%"; + /* Undefined when nothing has been drafted yet -- dash, not 0%. The panel's own rule is + * that 0 reads as failure, and this bullet was the one writer breaking it. */ + spec["Average"].textContent = s.draft_accept > 0 ? pct(s.draft_accept, 0) : DASH; } /* ---- devices, in the same panel as the cache meter: they are one question. */ diff --git a/tests/dashboard_test.cpp b/tests/dashboard_test.cpp index 8c4a1564..86c41002 100644 --- a/tests/dashboard_test.cpp +++ b/tests/dashboard_test.cpp @@ -271,6 +271,37 @@ TEST(stats_reports_how_long_bringup_took_once_the_server_listens) { CHECK_EQ(d.get("/stats").value("startup_s", (int64_t)-1), (int64_t)47); } +/* The pooled ring's element shape is a contract between two functions in the page, and no + * browser runs here to notice when they disagree. accWindow pushes {ratio, dr, da}; acceptTriple + * iterates the ring as `d` and reads `last`. When a rename left acceptTriple reading accPrev's + * {r, a} instead, the pooled figures became NaN and the detail line froze at "recent -" while + * every C++ test stayed green (Turnstone judge slices 08 and 11, 2026-10-20). So: scan the page + * text and hold the two sides to the same names. */ +TEST(the_pooled_acceptance_ring_reads_the_names_accWindow_writes) { + Dash d(false); + const std::string p = d.srv->router().call("GET", "/").body; + const std::string aw = function_body(p, "function accWindow("); + const std::string at = function_body(p, "function acceptTriple("); + REQUIRE(!aw.empty() && !at.empty()); + /* what goes INTO the ring */ + CHECK(aw.find("dr: dr") != std::string::npos); + CHECK(aw.find("da: da") != std::string::npos); + /* what comes OUT of it: every `d.` and `last.` must be a ring name */ + const std::set ring = {"dr", "da"}; + for (const std::string& n : fields(at, "d")) { + CHECK(ring.count(n) == 1); + if (!ring.count(n)) + fprintf(stderr, " acceptTriple reads d.%s, which the ring does not carry\n", n.c_str()); + } + for (const std::string& n : fields(at, "last")) { + CHECK(ring.count(n) == 1); + if (!ring.count(n)) + fprintf(stderr, " acceptTriple reads last.%s, which the ring does not carry\n", n.c_str()); + } + /* and the ring must not be empty by construction: the push is gated on dr > 0 */ + CHECK(aw.find("dr <= 0") != std::string::npos); +} + TEST(every_field_the_page_reads_is_one_the_routes_emit) { Dash d(false); HttpResponse page = d.srv->router().call("GET", "/");