Expand description
When each delivery of a broadcast starts (fleet::fleet_broadcast_impl).
A broadcast used to start a turn on every target in the same second. Each turn that starts in a pane on screen costs that windowโs page a burst of work on its one thread, and sixteen of them in four seconds left the page drawing four or five frames a second (docs/reports/REPORT_UI_CHOP_ON_FLEET_BROADCAST_AND_UI_BUSY_METER_2026_11_19.md).
The starts are spread by what each one costs this AgentMux, as a token bucket: a small burst goes at once, the rest follow at a steady rate with a little jitter, and the whole spread has a ceiling. A broadcast to two agents is as fast as before; one to thirty takes a few seconds. A target that costs this AgentMux nothing (another machine, another channel) is never delayed, and a delivery that is slow or fails holds up no other: each starts at its own time.
Structsยง
- Pace ๐
- One broadcastโs pace: when each target starts, and who hears as each delivery ends.
Constantsยง
- BURST ๐
- Cost that goes at once, before pacing begins: two panes on screen.
- CEILING ๐
- The last delivery starts no later than this after the send: past it the gap shrinks instead.
- COST_
NONE ๐ - A target this AgentMux only hands on (another machine or channel), or one that has no route and fails at once.
- COST_
OFF_ ๐SCREEN - A turn that starts on this AgentMux in a pane no window is showing: the machine starts the work and the page gets its messages, but draws nothing.
- COST_
ON_ ๐SCREEN - A turn that starts in a pane a window of this AgentMux is showing: its page draws it.
- GAP ๐
- The time one unit of cost takes after the burst: two and a half turn starts a second on screen, against the four a second that was too many.
- JITTER ๐
- Each paced start moves by up to this share of its gap, either way, so the starts do not land on a fixed beat.
- PROGRESS_
ID_ ๐MAX - The longest
progress_ida sender may give (a UUID is 36).
Functionsยง
- blocks_
on_ ๐screen - Those of
block_idsa window of this AgentMux is showing: in the active tab of a workspace that a window has open. - costs_
of ๐ - What each of
targetscosts this AgentMux:localholds the ones that start a turn here,on_screenthose of them a window is showing. - noise_
from ๐ - A repeatable stream of values in
0..1fromseed(splitmix64), for the jitter: a broadcastโs own id seeds it, so no random source is needed. - pace_
for ๐ - The pace for one broadcast to
targets, of whichlocalstart a turn on this AgentMux. With aprogress_id, each delivery that ends is published asfleetbroadcastprogress. - start_
offsets ๐ - How long after the send each targetโs delivery starts, in the order of
costs(one per target, aCOST_*).noisegives a value in0..1for each paced start; 0.5 is no jitter.
Type Aliasesยง
- Progress ๐
- Told as each delivery ends: how many have ended, of how many.