| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
| |
keeps over it taped, the history a step reads sent before its unit, rows sent a blob once a message, and the rows cache out of the rollback copy
terminal.zig, tape.zig: ingestWithPositions tracks its rows only where an ingest happens; what the ingest told them (each tracked row's row after it and whether it was erased, a clear, whether the pages lived, a pin not made) is a taped value (Site.positions), which a screen-state replica, ingesting nothing, takes; the logic after it runs alike on both. On the stack, so the local path allocates nothing new. buildRows marks a terminal read (State.read) outside the render (terminal.drawing).
screen_state.zig, replica.zig: the authority keeps each peer's holes as its replica does (Peer.holes, from the deltas it sent), and Screens.fill sends a peer the rows it lacks of every terminal a step read, after the step and before its unit, so a replay reads what the step read (a text-mode cursor moved into history the flood scrolled past diverged). encodeRows sends each distinct blob once a message and the rows as addresses (a fill after yes is a third). The rows cache is dropped when a copy is taken and emptied when it is put back, not saved.
test/replicas.zig: Ctrl-b in the mix (a shell out of tty mode: text, cursors and selections over it), and a shell's session (prompts, titles, directories, clears) between the TUI and the flood. 4 seeds x 120 inputs x 3 clients at 30, 80, 207 ms: no divergence, every replica and terminal the authority's, 4,653 deltas checked.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
trimmed by the thousand (a yes delta applies in 97 us, was 2.4 ms), holes blanked when they come into view, and input into a terminal left to the authority
screen_state.zig: when a delta's scroll is more than the replica's screen and history hold, nothing it holds is in the new state; its rows stay where they are, renumbered, the active ones and the tail written from the delta, the rest holes, and only as many more rows grown as the authority's history is longer. A hole has whatever that row held before, so `blank` clears the holes in view before they are asked for. The bench's floods run under the C allocator, as a replica does.
replica.zig: a replica's input whose live pane is a terminal is not speculated (its step reads the emulator, the last delta's here and the pty's newer one there): it waits for the authority, as a key in tty mode already did at its pty write. ReleaseFast, 200x60 yes at 16 MB/s: apply p50 97 us, p99 284 us; encode a frame 41 us at one peer and at three; 64 KB/s a peer.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
several in flight against the version last sent, its history the authority's to the row, and the authority's own steps batched into a unit a frame
screen_state.zig: each state the authority sends is a version of its terminal (Track), made once for every peer; a peer's delta is against the version it was last sent (the stream is ordered and loses nothing), up to 32 in flight, a peer at the bound waiting for an acknowledgement and then getting the newest; peers at one base are sent the same bytes. A replica refuses a delta against another base and is started afresh. It keeps the authority's history extent to the row (no byte limit of its own, trimmed to the authority's count), takes its viewport and its cursor's semantic content, and grows a flood's rows in bulk. The soak now keeps several in flight, lands them late in order, loses one now and then, and checks the history extent and the viewport too.
replica.zig: Screens (the authority's tracks and peers) and Replica.screen/screenRequest, messages of u8 pane, u32 serial, u8 kind (a delta, rows; an ack, a row request, a reset). Deltas are applied with the replica's epoch paused, so an emulator outlives a rollback. Authority.output/pending: its own steps (a pty's output) go into one unit, sent before any other input it steps and at a frame, with one digest; under screen state a digest is one word.
tape.zig, terminal.zig: under screen state an output is recorded without its bytes, pty writes are off the tape on both sides, no digest covers an emulator, and a replica's core never ingests or resizes one (a resize's own core work, the pointer selections cleared, still runs). A terminal counts its writes (State.changes); its MarkedHandler cycle rides in each delta.
test/replicas.zig: the session's shell runs a TUI, then 8 MB of yes read 4 KB at a time, while three clients type; deltas go out before each input the authority steps and once a frame, acknowledgements and row requests come back over the links, every applied delta is checked against the authority's screen at that version and every terminal at quiescence.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
|
ghostty's own records by content address, a delta a screen of row hashes and the blobs the peer lacks, history fetched by absolute row
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|