From 4d3fd3ac6d8cafde9d086972d2d822a226aaf846 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:04:40 +0800 Subject: [PATCH] diag(shell): report input and session counters on failure refs #36 The failure dump now carries input high-water, rejected bytes, output bytes and the read error, so a stalled flood shows whether the keystroke reached the queue. --- experiments/shell/shell.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/experiments/shell/shell.cpp b/experiments/shell/shell.cpp index 6941aa2a..94d14d7d 100644 --- a/experiments/shell/shell.cpp +++ b/experiments/shell/shell.cpp @@ -1436,7 +1436,14 @@ class ShellWindow { trace.close(); require(bool(trace), "candidate output evidence write failed"); } if (!failure_.empty() && !mode_.empty()) { - std::cerr << "stage=" << stage_ << " bytes=" << result_.consumed << " screen="; + // The dump answers "did our side do its part" before the screen: + // input high-water/rejected tell whether the keystroke reached the + // bounded queue, and the session counters tell whether reads stalled. + std::cerr << "stage=" << stage_ << " bytes=" << result_.consumed + << " input_high_water=" << input_.high_water + << " input_rejected=" << input_.rejected + << " output_bytes=" << session_.output_bytes + << " read_error=" << session_.read_error << " screen="; parser_.screen.json(std::cerr); std::cerr << '\n'; } require(failure_.empty(), failure_.c_str()); require(close_failure_.empty(), close_failure_.c_str());