Add "bytes read" metric to per-prompt statistics - #62
Conversation
The "/stats" command already shows this, but the stats for "waste run" didn't.
|
Independent CPU/synthetic-container audit at
On a tiny synthetic container, callback bytes were 0 versus engine bytes 282624; adding the omitted term in the measurement control closed the difference, and a fixed-seed repeat reproduced it. That is not a general omission percentage: this fixture fits entirely in cache, so it cannot establish the magnitude under decode-time cache pressure. Whole-run accounting also needs explicit before/after boundaries rather than assuming an absolute counter is per-request. Project Would you prefer the deliberately narrower label |
|
Concrete minimal option for the scope question: keep the existing callback sum, make its narrow scope explicit, and correct the unit label (the divisor is Applied locally on this PR's unchanged head diff --git a/cli/main.c b/cli/main.c
index b19d2e7..ae916f6 100644
--- a/cli/main.c
+++ b/cli/main.c
@@ -876,7 +876,7 @@ static int run_segs(waste_ctx *c, const opts *o, const seg *segs, int ns,
if (show_stats && s.n) {
const double sec = s.ms / 1000.0;
fprintf(stderr, "\n[%u tokens, %.2f s, %.2f tok/s | experts %llu hit / "
- "%llu miss = %.0f%% | %.2f GB read\]\n",
+ "%llu miss = %.0f%% | %.2f decode GiB read]\n",
s.n, sec, s.n / sec,
(unsigned long long)s.hit, (unsigned long long)s.miss,
100.0 * (double)s.hit / (double)(s.hit + s.miss ? s.hit + s.miss : 1),
Verification on macOS CPU: fresh default No competing branch/PR was pushed. This is an independently built, tested suggestion for the author to incorporate if callback/decode scope is intended. AI-assisted contribution. |
Add a "bytes read" metric to per-prompt statistics. The "/stats" command in chat already shows this, but the stats for "waste run" didn't.