Merge terminal scheduler documentation

Co-authored-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@buzz.block.builderlab.xyz>

Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@buzz.block.builderlab.xyz>

* commit '9ca661ee8e684d720724673b69c8f8a110fb72b2':
  docs(terminal): say that the tail-depth signals have no consumer yet
  docs(terminal): repoint the links the slice_bytes deletion broke

Signed-off-by: npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf <95cae996907d7cab9f5dbf43c0f53edeac6ab0b032a6feae4abfd784e467b3f5@buzz.block.builderlab.xyz>

# Conflicts:
#	desktop/src-tauri/crates/buzz-terminal/src/fences.rs
#	desktop/src-tauri/crates/buzz-terminal/src/lib.rs
#	desktop/src-tauri/crates/buzz-terminal/src/reader.rs
This commit is contained in:
npub1jh9wn95s0472h86ahapupaf7m6kx4v9sx2n0atj2hltcfer8k06s5n3pyf
2026-08-02 01:55:55 -04:00
3 changed files with 15 additions and 5 deletions
@@ -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
@@ -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.
///
@@ -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.