From 651ef710b43bb78707d9194eb7f2304012e1bf44 Mon Sep 17 00:00:00 2001 From: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 Date: Sun, 2 Aug 2026 01:48:49 -0400 Subject: [PATCH 1/2] docs(terminal): repoint the links the slice_bytes deletion broke Two intra-doc links still resolved to the deleted function, so `cargo doc` emitted unresolved-link warnings. Neither `cargo test` nor clippy sees those, which is why they survived a green gate -- the deletion was verified by the checks that run in CI and not by the one that reads the docs. The single remaining mention is deliberate: the paragraph in `fences.rs` explaining why the old function existed and why it is gone. Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> --- desktop/src-tauri/crates/buzz-terminal/src/fences.rs | 2 +- desktop/src-tauri/crates/buzz-terminal/src/reader.rs | 2 +- desktop/src-tauri/crates/buzz-terminal/tests/slicing.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/src-tauri/crates/buzz-terminal/src/fences.rs b/desktop/src-tauri/crates/buzz-terminal/src/fences.rs index ab5d3234d..17a67f490 100644 --- a/desktop/src-tauri/crates/buzz-terminal/src/fences.rs +++ b/desktop/src-tauri/crates/buzz-terminal/src/fences.rs @@ -130,7 +130,7 @@ pub fn max_atom_work(columns: usize, lines: usize, scrollback: usize) -> u64 { /// fixtures caught it: /// /// * The budget is checked *between* slices, so a drain overshoots by up to -/// one whole slice -- not one atom. [`slice_bytes`] keeps that under one +/// one whole slice -- not one atom. [`slice_bytes_remaining`] keeps that under one /// budget wherever its derivation is unclamped. /// * A callback already running cannot be preempted. RIS at the default 10k /// scrollback is worth 16x the whole budget on its own, so on such a grid diff --git a/desktop/src-tauri/crates/buzz-terminal/src/reader.rs b/desktop/src-tauri/crates/buzz-terminal/src/reader.rs index 82324f460..18ce98d41 100644 --- a/desktop/src-tauri/crates/buzz-terminal/src/reader.rs +++ b/desktop/src-tauri/crates/buzz-terminal/src/reader.rs @@ -172,7 +172,7 @@ 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`] is derived + /// 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. From 9ca661ee8e684d720724673b69c8f8a110fb72b2 Mon Sep 17 00:00:00 2001 From: npub1cc3ha7z055mu0rwwu7806t2wt8mj3pvu0uv5mfp2c50dahaqhczshdalg6 Date: Sun, 2 Aug 2026 01:52:08 -0400 Subject: [PATCH 2/2] docs(terminal): say that the tail-depth signals have no consumer yet `tail_full` and `tail_drained` are the queue bound, and nothing outside the tests calls them: the runtime reader pumps `drain` to completion after every read, so the tail cannot reach the cap and nobody needs to ask. That is fine and it is the design -- the signal was built for the reader that stops pumping -- but an exported, documented predicate with an empty call graph reads as wired to anyone who doesn't go looking. Stated in the doc comment instead, because an unused signal that looks connected is worse than one that says it isn't. Co-authored-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com> --- desktop/src-tauri/crates/buzz-terminal/src/lib.rs | 1 + desktop/src-tauri/crates/buzz-terminal/src/reader.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/desktop/src-tauri/crates/buzz-terminal/src/lib.rs b/desktop/src-tauri/crates/buzz-terminal/src/lib.rs index 5959d79d9..9665ed07d 100644 --- a/desktop/src-tauri/crates/buzz-terminal/src/lib.rs +++ b/desktop/src-tauri/crates/buzz-terminal/src/lib.rs @@ -158,6 +158,7 @@ impl Terminal { } /// Whether the tail is at its cap and the reader must stop reading. + /// Not yet consumed in production -- see [`reader::Feeder::tail_full`]. pub fn tail_full(&self) -> bool { self.feeder.tail_full() } diff --git a/desktop/src-tauri/crates/buzz-terminal/src/reader.rs b/desktop/src-tauri/crates/buzz-terminal/src/reader.rs index 18ce98d41..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 }