diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-22 03:00:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-22 03:00:49 -0300 |
| commit | d56973aa92d0de6d84446dff73eba9d5654fe6f4 (patch) | |
| tree | 3dfda432d095b480c26b0bf2701add7ff172803f /abi/wire.zig | |
| parent | 02099b716e5320cbee7f829d93fd53717fd2a57d (diff) | |
| download | pardes-d56973aa92d0de6d84446dff73eba9d5654fe6f4.tar.gz pardes-d56973aa92d0de6d84446dff73eba9d5654fe6f4.zip | |
replica: the delta protocol deleted, with the wire's screen messages (the old road's deletion, piece 3 of 8): core/replica.zig loses the screen-state section (the screen message's head, `Screens`: tracks, peers, flush, fill, filled, take), `Peers.screens`/`msgs`/`flushed`/`screensOut`/`screensTo`, the `.screen` note and its arm in `boundary`, `Peers.input`'s flushes and fills, a joiner's `addPeer` and a leaver's `dropPeer`, `Peer.sid` and its `screen_ack` arm, `Replica.screen`/`screenRequest`/`screenMessage`/`overTerminals`, `Replica.screens`/`screen_out`/`ScreenOf`, `Stats.apply_ns`, `Said.screen` (and its arms in dev/tui/tui.zig and dev/gui/gui.zig: a delta no longer counts as an echo there, nor is its latency noted), the Link's `.screen` arm and `drawn`'s row requests, `sendScreen`, and the `screens` argument of `Authority.init` and `Replica.init` (every caller: core/jj.zig 10, core/tape.zig 2, core/echo.zig 2, test/panes.zig 15, test/perf.zig 2, runtime/client.zig 1, test/rollback_bench.zig 1, test/replicas.zig 10, core/replica.zig 98); a replica's own `made` no longer starts on screen state, and `confirm` and `applyPending` keep only their one-road branches; abi/wire.zig retires the replica's `screen_ack` (0x04) and the session's `screen` (0x06) as gaps (the version moves once, in piece 4); test/daemon.py's round trip passes over units alone; the tests that were the old road's alone go: a delta under a speculation, a terminal sized again by a client's key (screen state's deferred size), pardes's own keys over a terminal's history and a delta while they wait, a unit kept over a copy and a delta after it, a step's rows sent as a new client's holes, the screen-state twin of the 9P pty/run test, and the 9P open over a copy taken ahead (on the one road a unit that feeds a terminal lets the copy go: `Term.writes`, so no copy is held across the run's output: its premise was the old road's); the others that ran on screen state now run on the bytes road (a kitty image: the client's emulator has it as the session's does; prompt marks and Kill; the far client's may_wait walk, its click into a focus-reporting shell, its backed-up queue; a view that sized a terminal closing; a closed terminal brought back; a leave's queued resize before a join); FOUND AND FIXED on the way (those tests on the one road failed: the far click `expected 0, found 1` stopped, and may_wait named `Del`, `DelAbove`, `Up`, `C-w a`, `click shell`, `Look` stopped at `pty_write`): a client's own step that moved the focus in a session whose shell asked for focus events wrote the report (CSI I/O) through pty_write, which a speculation stops at (`keeps_stopping`), so the key or click waited a round trip, and the session's write was on the tape; on screen state both were skipped (core/Core.zig `reportFocus` skipped the write only `speculating and screen_state`, core/tape.zig `hostCall` kept pty_write off the tape only under screen state): both now on every road (a user on the flip's build could hit it: a far client's click, pane switch or Del beside vim or tmux waited a round trip); core/root.zig `machine_lines` for replica.zig 76 -> 74 (Authority.init's getenv and a joiner's `addPeer` failure's shutdown gone); core-test 911/1068 (157 skipped: 7 tests gone, each one skipped there for want of a shell), shell-test 1110/1113 (the 7 gone)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'abi/wire.zig')
| -rw-r--r-- | abi/wire.zig | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/abi/wire.zig b/abi/wire.zig index f87131bf..ab974e35 100644 --- a/abi/wire.zig +++ b/abi/wire.zig @@ -113,9 +113,6 @@ pub const ClientTag = enum(u8) { hello = 0x01, bye = 0x02, ping = 0x03, - /// A replica's word about a terminal's state (core/term/screen_state.zig): the - /// delta it holds, or rows it asks for. Opaque here. - screen_ack = 0x04, /// What is the session's digest, in stream order (a replica checks /// itself against it once quiet). check = 0x05, @@ -201,9 +198,6 @@ pub const ServerTag = enum(u8) { /// A unit of the authority's stream (core/replica.zig): its origin, seq, /// clocks and tape. unit = 0x05, - /// A terminal's delta, or rows asked for (core/term/screen_state.zig), applied - /// before the next unit. Opaque here. - screen = 0x06, /// The session's digest (u64le), after every unit before it. check = 0x07, /// Part of the join's list of blobs, to a far client: each one's place @@ -232,7 +226,6 @@ pub const ServerMsg = union(ServerTag) { pong: u64, dump: []const u8, unit: []const u8, - screen: []const u8, check: u64, blobs: []const u8, zstd: []const u8, @@ -270,7 +263,6 @@ pub fn decodeServer(tag: u8, payload: []const u8) Error!ServerMsg { .pong => .{ .pong = try r.takeInt(u64, .little) }, .dump => return .{ .dump = payload }, .unit => return .{ .unit = payload }, - .screen => return .{ .screen = payload }, .check => .{ .check = try r.takeInt(u64, .little) }, .blobs => return .{ .blobs = payload }, .zstd => return .{ .zstd = payload }, @@ -300,7 +292,7 @@ pub fn encodeServer(out: []u8, msg: ServerMsg) Error![]const u8 { }, .refused => |words| try putSlice16(&w, words), .pong => |v| try w.writeInt(u64, v, .little), - .dump, .unit, .screen, .blobs, .zstd, .blob => |bytes| try w.writeAll(bytes), + .dump, .unit, .blobs, .zstd, .blob => |bytes| try w.writeAll(bytes), .check => |v| try w.writeInt(u64, v, .little), .ended => |code| try w.writeByte(code), .left => |name| try putSlice16(&w, name), @@ -327,7 +319,6 @@ pub const ClientMsg = union(enum) { bye: struct { again: bool = false, close: bool = false }, /// A round trip's probe, answered `pong` with the same value. ping: u64, - screen_ack: []const u8, check, far: bool, want: []const u8, @@ -545,7 +536,7 @@ pub fn encodeClient(out: []u8, msg: ClientMsg) Error![]const u8 { // 0 it leaves, 1 it joins again, 2 its window was closed. .bye => |b| try w.writeByte(if (b.close) 2 else @intFromBool(b.again)), .ping, .boot => |v| try w.writeInt(u64, v, .little), - .screen_ack, .want => |bytes| try w.writeAll(bytes), + .want => |bytes| try w.writeAll(bytes), .check => {}, .far => |far| try w.writeByte(@intFromBool(far)), .stamp => |s| for (s) |v| try w.writeInt(i64, v, .little), @@ -620,7 +611,6 @@ pub fn decodeClient(tag: u8, payload: []const u8) Error!ClientMsg { else => return error.BadValue, } }, .ping => .{ .ping = try r.takeInt(u64, .little) }, - .screen_ack => return .{ .screen_ack = payload }, .check => .check, .far => .{ .far = try getBool(&r) }, .want => return .{ .want = payload }, @@ -683,7 +673,7 @@ pub fn clientBound(msg: ClientMsg) usize { return msg_slack + switch (msg) { .hello => |h| h.session.len, .bye, .ping, .check, .far, .stamp, .boot => 0, - .screen_ack, .want => |bytes| bytes.len, + .want => |bytes| bytes.len, .event => |ev| switch (ev) { // Its hits' places (14 bytes each) past the slack. .mouse => 32, @@ -804,10 +794,8 @@ test "detached wire: a session is never told to do a frontend's remembering" { // them, and the machine that reports them is the one already holding the // core. const allowed = [_][]const u8{ - // Who this connection is, its round trip, and that it is finished, - // and which terminal state its replica holds (a protocol's word, - // as a ping is). - "hello", "bye", "ping", "screen_ack", "check", + // Who this connection is, its round trip, and that it is finished. + "hello", "bye", "ping", "check", // ...and how far it is, and which of the join's blobs it lacks. "far", "want", // ...and the digest of the core it made itself (a pair's). |
