From ba79279154f4fd3bb9fe075620b11a821dcf2310 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 7 May 2026 13:14:25 +0000 Subject: [PATCH] diag(quic-interop): inspect surfaces [writer.* traces + histograms After 'make build DEBUG=1 && run-matrix.sh' the writer emits per-drain stats. inspect-multiplexing.sh now grep's them out of output.txt and reports a stream_frames histogram + active-stream-count histogram, so we can see at a glance whether the writer is iterating 64 active streams but only emitting 1 (early-exit bug) or whether 'active=1' because most streams were filtered out as isClosed (different bug). If output.txt has no writer lines, the helper hints at how to enable them. --- quic/interop/inspect-multiplexing.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/quic/interop/inspect-multiplexing.sh b/quic/interop/inspect-multiplexing.sh index 5e006917c..81c948919 100755 --- a/quic/interop/inspect-multiplexing.sh +++ b/quic/interop/inspect-multiplexing.sh @@ -39,6 +39,24 @@ echo "=============== output.txt (runner stdout — last 200 lines) ============ tail -n 200 "$CASE_DIR/output.txt" 2>/dev/null \ || echo "(no output.txt)" +echo +echo "=============== writer-side debug traces (DEBUG=1 build only) ===============" +# Per-drain frame/budget stats from buildApplicationPacket. Empty +# unless the image was built with `make build DEBUG=1`. +WRITER_LINES=$(grep -c '\[writer' "$CASE_DIR/output.txt" 2>/dev/null || echo 0) +if [[ "$WRITER_LINES" -gt 0 ]]; then + echo "($WRITER_LINES writer trace lines; first 30:)" + grep '\[writer' "$CASE_DIR/output.txt" | head -n 30 + echo + echo "stream_frames histogram (writer-reported):" + grep -oE 'stream_frames=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn + echo + echo "active histogram (active stream count at drain time):" + grep -oE 'active=[0-9]+' "$CASE_DIR/output.txt" | sort | uniq -c | sort -rn +else + echo "(no [writer.* lines — run with DEBUG=1 image: cd quic/interop && make build DEBUG=1)" +fi + echo echo "=============== server stderr (last 100 lines) ===============" tail -n 100 "$CASE_DIR/server/stderr.log" 2>/dev/null \