diff --git a/desktop/src-tauri/crates/buzz-terminal/src/lib.rs b/desktop/src-tauri/crates/buzz-terminal/src/lib.rs index 72edac1af..58fe89982 100644 --- a/desktop/src-tauri/crates/buzz-terminal/src/lib.rs +++ b/desktop/src-tauri/crates/buzz-terminal/src/lib.rs @@ -161,6 +161,8 @@ impl Terminal { } /// Whether the tail is at its cap and the reader must stop reading. + /// See [`reader::Feeder::tail_full`] for why production deliberately has + /// no consumer yet. /// /// There is no production consumer today, deliberately: the desktop /// runtime pumps `drain()` to completion after every read, so the tail is diff --git a/desktop/src-tauri/crates/buzz-terminal/src/reader.rs b/desktop/src-tauri/crates/buzz-terminal/src/reader.rs index 0a09bc160..4dc4aa46c 100644 --- a/desktop/src-tauri/crates/buzz-terminal/src/reader.rs +++ b/desktop/src-tauri/crates/buzz-terminal/src/reader.rs @@ -111,6 +111,15 @@ impl Feeder { /// latch is a state the fence owns and could fail to clear, which is /// exactly how a paused reader strands a child mid-teardown; a reader that /// simply stops asking resumes by default. + /// + /// **Not yet consumed in production.** The runtime reader pumps + /// [`Feeder::drain`] to completion after every read, so the tail cannot + /// currently grow to the cap and nothing needs to ask. This signal exists + /// for the reader that stops pumping -- it is the queue bound, and the + /// pump loop is the only reason the queue bound is not load-bearing + /// today. Stated rather than left to be inferred from an empty + /// call-graph: an unused signal that looks wired is worse than one that + /// says it isn't. pub fn tail_full(&self) -> bool { self.pending_bytes() >= TAIL_CAP } @@ -172,9 +181,8 @@ impl Feeder { /// per count when it finds no stop. /// /// What *is* bounded is the number of atoms per slice, and that bound - /// holds from the first byte of a cold feeder: - /// [`slice_bytes_remaining`] is derived from the densest work-per-byte - /// upstream can produce on this grid, so + /// holds from the first byte of a cold feeder: [`slice_bytes_remaining`] is derived + /// from the densest work-per-byte upstream can produce on this grid, so /// no slice can contain more than one budget's worth of callbacks no /// matter what the payload is or what the feeder has seen before. /// diff --git a/desktop/src-tauri/crates/buzz-terminal/tests/slicing.rs b/desktop/src-tauri/crates/buzz-terminal/tests/slicing.rs index f4b87a0d8..26097430a 100644 --- a/desktop/src-tauri/crates/buzz-terminal/tests/slicing.rs +++ b/desktop/src-tauri/crates/buzz-terminal/tests/slicing.rs @@ -333,7 +333,7 @@ fn a_resize_mid_tail_reprices_the_remainder() { /// byte count cannot bound a lock hold: `ESC c` is two bytes and resets both /// grids plus scrollback. /// -/// Kills: replacing `slice_bytes` with a constant, or deriving it from +/// Kills: replacing `slice_bytes_remaining` with a constant, or deriving it from /// `cells` while the worst atom is larger than `cells`. Measured: 256 bytes /// of DECALN is 1.6 ms at 200x50 and ~14 ms at 1600x50, so no one constant /// serves both. @@ -1152,7 +1152,7 @@ fn extreme_dimensions_saturate_instead_of_wrapping() { // The *direction* is the assertion, not merely the absence of a panic. // A wrapping build does not produce a slightly-wrong bound, it produces a - // tiny one -- and `slice_bytes` divides the budget by it, so an + // tiny one -- and `slice_bytes_remaining` divides the budget by it, so an // undercharged atom yields an *oversized* slice exactly when the atom is // most expensive. Wrapping inverts the fence. So: the widest possible // atom must give the narrowest possible slice.