From 2c69cbdab9f2d0260a6996a7eb95eb447b483a74 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Mon, 27 Jul 2026 08:41:37 +0200 Subject: [PATCH] =?UTF-8?q?docs(host/stats):=20say=20what=20the=20stats=20?= =?UTF-8?q?actually=20measure=20=E2=80=94=20three=20field-triage=20traps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three lines that each sent the 2026-07 PyroWave field triage down a wrong path, made honest: - The 'client accepts streamed AUs … will stream per-slice' log fires before the encoder exists and regardless of backend support (only Linux direct-NVENC implements chunked polling) — it now states the client capability only. - StatsSample::mbps was documented as 'transmit goodput'; it is attempted sealed wire bytes at seal time — AU bytes + shard framing + FEC parity (+ PyroWave window padding), not reduced by socket send drops. - The per-stage split's 'encode' stage is the poll() duration, which is ~0 by construction for synchronous backends (PyroWave encodes inside submit → its time shows as 'submit') — documented at the split's definition so 'encode 0.00' stops reading as an instrumentation hole. Co-Authored-By: Claude Fable 5 --- crates/punktfunk-host/src/native/stream.rs | 13 +++++++++++-- crates/punktfunk-host/src/stats_recorder.rs | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/punktfunk-host/src/native/stream.rs b/crates/punktfunk-host/src/native/stream.rs index 0be9248a..1d353eb6 100644 --- a/crates/punktfunk-host/src/native/stream.rs +++ b/crates/punktfunk-host/src/native/stream.rs @@ -335,6 +335,11 @@ struct FrameMsg { /// nor a stats capture is armed). The send thread accumulates them for the web-console sample: /// `cap_us` = `try_latest` (ring read + colour convert), `submit_us` = NVENC `encode_picture` /// launch, `wait_us` = `lock_bitstream` (the scheduling wait + ASIC encode = the "encode" stage). + /// SYNCHRONOUS backends (PyroWave: the whole GPU encode + fence wait runs inside `submit`) + /// carry their real encode time in `submit_us`, and the "encode" stage reads ~0 by + /// construction — read the pair together (the 2026-07 field triage read "encode 0.00" as an + /// instrumentation hole; it's the stage split's shape). The client-facing 0xCF `encode_us` + /// is unaffected: its anchor is stamped before `submit`, so it spans both. cap_us: u32, submit_us: u32, wait_us: u32, @@ -1118,9 +1123,13 @@ pub(super) fn virtual_stream(ctx: SessionContext, prepared: Option