From 14c5c8a68b28673a2ddffe2f8b58563b9eb34bf6 Mon Sep 17 00:00:00 2001 From: "Memoria (Noblistic)" Date: Mon, 19 Oct 2026 01:07:09 +0000 Subject: [PATCH] review: fix the stale note_ready comment, drop a tautological check The note_ready comment claimed "the page divides by this figure", but the submitted dashboard does not divide by startup_s (the payback formula that did was removed). Reworded to describe the actual risk: a zero cost would price every restart as free in any payback formula that divides by it. Dropped CHECK(gap_pct >= 0) in the decode-floor drift test: recent >= floor holds by construction (floor is the min of the window means, recent is one of them), so the check can never fail. The load-bearing assertion is the adjacent CHECK(gap_pct < 3). Authored at: Tasmania Qwen 3.8 27B Dense XHigh (level not visible) via Open WebUI (cherry picked from commit 98429a9b15d7da1aa0e644cbd7e519d1bf33d797) --- core/server/server.cpp | 4 ++-- tests/sched_test.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/server/server.cpp b/core/server/server.cpp index 5f0a5530..d7719961 100644 --- a/core/server/server.cpp +++ b/core/server/server.cpp @@ -211,8 +211,8 @@ void Server::note_ready(uint64_t begin_ns) { if (begin_ns == 0) return; const uint64_t now = rad_mono_ns(); /* Only a start in the past is a duration. A stamp that arrives out of order is ignored rather - * than written as zero: the page divides by this figure, and a zero cost would price every - * restart as free. */ + * than written as zero: a zero cost would price every restart as free in any payback formula + * that divides by it. */ if (now <= begin_ns) return; startup_s_ = (int64_t)((now - begin_ns) / 1000000000ull); } diff --git a/tests/sched_test.cpp b/tests/sched_test.cpp index a5f229d3..fe015b94 100644 --- a/tests/sched_test.cpp +++ b/tests/sched_test.cpp @@ -2684,7 +2684,6 @@ TEST(the_decode_floor_reports_a_recent_window_for_like_for_like_drift) { CHECK(recent > 0); /* The phantom gap must be small: this is the number the deadband is sized against. */ const int64_t gap_pct = 100 * (recent - floor) / floor; - CHECK(gap_pct >= 0); CHECK(gap_pct < 3); }