Flow control: clients ack what they've drawn, so a slow page doesn't queue a flood #52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by: #49
A client that can't draw as fast as a pane prints still takes all of it: the browser's xterm queues everything it was sent. Behind a flood, a throttled page took about 10 s to even read its
resync, and drew output that was already stale by then.resync. The queue only fills when the client stops reading its socket. A browser keeps reading and hands every frame toterm.write, which buffers without limit, so the backlog piles up inside the page instead.web/e2e/flood.spec.ts, CPU throttled 6x,yesfor 8 s): resyncs came about 10 s after the daemon sent them, and the pane kept drawing old flood output for 15–25 s after the flood ended. Since #49 each resync is cheap; the lag is all in the client.ack{pane, offset}from xterm's write callback, about every 64 KB;resync, which since #49 means the screen alone;attach, the tmux front end, old pages) works as today, falling back to the bounded queue.flood.spec.ts,after-6shows within 2 s of the flood ending, not 15–25 s;resyncis read within 1 s of being sent;spikes/s19-tui/bench.sh's numbers stay at least as good as after #49.Done 2026-10-02, merged in
57fa00e.attachtakesacks. The web client acks from xterm's write callback about every 64 KB; the S19 TUI acks after its engines take the bytes.resync(screen only, #49) if that's over 1 MB. A resize while held back resyncs. Clients that don't ack (CLIattach, tmux, the share viewer) are unchanged.Against done-when:
flood.spec.ts, browser throttled 6x:after-6shows 0.22–0.42 s after the flood ends (release daemon, 4 runs; 0.22–0.35 s on the e2e suite's debug daemon), against 15–25 s before. Quiet-pane echo: 41–369 ms.resyncis acted on within 10–20 ms of being sent, against 3–16 s.bench.sh: no resyncs and 36% of a core with four floods, against 155 resyncs and 56% after #49. That also brings the TUI under #49's half-core target.New daemon tests:
The full browser suite passes except
vm-dev-server, which also fails on main (it needs VMs).