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 /test | |
| 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 'test')
| -rw-r--r-- | test/daemon.py | 6 | ||||
| -rw-r--r-- | test/panes.zig | 30 | ||||
| -rw-r--r-- | test/perf.zig | 4 | ||||
| -rw-r--r-- | test/replicas.zig | 20 | ||||
| -rw-r--r-- | test/rollback_bench.zig | 2 |
5 files changed, 31 insertions, 31 deletions
diff --git a/test/daemon.py b/test/daemon.py index e10b3c1f..3a481c00 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -313,13 +313,13 @@ class Replica: return 'refused', why def ping(self, value): - """One round trip, in ms (the session's units and terminal - messages on the way are passed over).""" + """One round trip, in ms (the session's units on the way are + passed over).""" t = time.monotonic() self.send(0x03, struct.pack('<Q', value)) while True: tag, body = self.read() - if tag not in (0x05, 0x06): + if tag != 0x05: break assert (tag, body) == (0x03, struct.pack('<Q', value)), (tag, body) return (time.monotonic() - t) * 1000 diff --git a/test/panes.zig b/test/panes.zig index 38eb0a71..32cfd530 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -3775,9 +3775,9 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); - const r = try R.Replica.init(gpa, 1, try a.unit(0, 0), false); + const r = try R.Replica.init(gpa, 1, try a.unit(0, 0)); defer r.deinit(); const Land = struct { a: *R.Authority, @@ -3839,7 +3839,7 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); const Land = struct { a: *R.Authority, @@ -3875,7 +3875,7 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); const Land = struct { a: *R.Authority, @@ -3937,9 +3937,9 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); - const r = try R.Replica.init(gpa, 1, try a.unit(0, 0), false); + const r = try R.Replica.init(gpa, 1, try a.unit(0, 0)); defer r.deinit(); const Land = struct { a: *R.Authority, @@ -3974,7 +3974,7 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); const Land = struct { a: *R.Authority, @@ -3998,10 +3998,10 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); // A terminal's client on the session's view, a window's on its own. - const tty = try R.Replica.init(gpa, 1, try a.unit(0, 0), false); + const tty = try R.Replica.init(gpa, 1, try a.unit(0, 0)); defer tty.deinit(); const Land = struct { a: *R.Authority, @@ -4175,9 +4175,9 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); - const win = try R.Replica.init(gpa, 2, try a.unit(0, 0), false); + const win = try R.Replica.init(gpa, 2, try a.unit(0, 0)); defer win.deinit(); const land = struct { a: *R.Authority, @@ -4262,9 +4262,9 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); - const win = try R.Replica.init(gpa, 2, try a.unit(0, 0), false); + const win = try R.Replica.init(gpa, 2, try a.unit(0, 0)); defer win.deinit(); const c = try clientOf(a, win, .{ .frontend = .{ .windowed = false, .native_images = false } }); try (Confirmed{ .a = a, .r = win }).step(.tick); @@ -4298,9 +4298,9 @@ const PdfAddon = struct { if (!addons.has_pdf) return error.SkipZigTest; const R = pardes.replica; const gpa = std.testing.allocator; - const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }, false); + const a = try R.Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, .{ .vtable = &host_vtable }); defer a.deinit(); - const win = try R.Replica.init(gpa, 2, try a.unit(0, 0), false); + const win = try R.Replica.init(gpa, 2, try a.unit(0, 0)); defer win.deinit(); const c = try clientOf(a, win, .{ .frontend = .{ .windowed = true, .native_images = true } }); // The client's click in the PDF: its pane the client's own view's. diff --git a/test/perf.zig b/test/perf.zig index 8c88ef01..e9ee43d7 100644 --- a/test/perf.zig +++ b/test/perf.zig @@ -702,9 +702,9 @@ fn measureClient(op: Op, path: []const u8, reps: usize) !Cell { const warmup = 3; const samples = try gpa.alloc(u64, reps); defer gpa.free(samples); - const a = try pardes.replica.Authority.init(gpa, .{ .tty_only = true, .file = path, .cols = screen_cols, .rows = screen_rows }, .{ .vtable = &client_host_vtable }, false); + const a = try pardes.replica.Authority.init(gpa, .{ .tty_only = true, .file = path, .cols = screen_cols, .rows = screen_rows }, .{ .vtable = &client_host_vtable }); defer a.deinit(); - const r = try pardes.replica.Replica.init(gpa, 1, try a.unit(0, 0), false); + const r = try pardes.replica.Replica.init(gpa, 1, try a.unit(0, 0)); defer r.deinit(); // Idle first, as a client is: its copy taken ahead and a pump's unit of // the session's kept over it. Two units kept a key after that put the diff --git a/test/replicas.zig b/test/replicas.zig index f1d5c478..46eff641 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -2325,11 +2325,11 @@ fn diffCase(dir: []const u8) !bool { const look = try std.fmt.bufPrint(&lbuf, "Look {s}", .{patch}); var ok = true; for ([_]bool{ false, true }) |own| { - const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host(), false); + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host()); defer a.deinit(); const first = try gpa.dupe(u8, try a.unit(0, 0)); defer gpa.free(first); - const rp = try replica.Replica.init(gpa, 1, first, false); + const rp = try replica.Replica.init(gpa, 1, first); defer rp.deinit(); if (own) { const msg = try gpa.dupe(u8, try rp.input(.{ .command = look })); @@ -2390,11 +2390,11 @@ fn plumbCase(dir: []const u8) !bool { const open = try std.fmt.bufPrint(&obuf, "Look {s}", .{notes}); var ok = true; for ([_][]const u8{ "Look https://ziglang.org", "Look 3f2a9c1" }) |look| for ([_]bool{ false, true }) |own| { - const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host(), false); + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty }, host.host()); defer a.deinit(); const first = try gpa.dupe(u8, try a.unit(0, 0)); defer gpa.free(first); - const rp = try replica.Replica.init(gpa, 1, first, false); + const rp = try replica.Replica.init(gpa, 1, first); defer rp.deinit(); rp.confirm(try a.local(.{ .command = open })); rp.settle(); @@ -2442,11 +2442,11 @@ fn plumbCase(dir: []const u8) !bool { // The rule from the session's plumbing file, read at boot. var pbuf: [256]u8 = undefined; try writeText(try std.fmt.bufPrintSentinel(&pbuf, "{s}/plumbing", .{dir}, 0), "type is text\ndata matches 'https://letters/.*'\nplumb to seemail\n\ninclude basic\n"); - const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty, .config_dir = dir }, host.host(), false); + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty, .config_dir = dir }, host.host()); defer a.deinit(); const first = try gpa.dupe(u8, try a.unit(0, 0)); defer gpa.free(first); - const rp = try replica.Replica.init(gpa, 1, first, false); + const rp = try replica.Replica.init(gpa, 1, first); defer rp.deinit(); rp.confirm(try a.local(.{ .command = open })); rp.settle(); @@ -2901,9 +2901,9 @@ fn runEcho(seed: u64, rtt_ms: u64, on: bool, et: *EchoTotals) !void { } var sh: FakeShell = .{}; defer sh.out.deinit(gpa); - const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty_shell }, host.host(), false); + const a = try replica.Authority.init(gpa, .{ .cols = 100, .rows = 30, .boot = .tty_shell }, host.host()); defer a.deinit(); - const rp = try replica.Replica.init(gpa, 1, try a.unit(0, 0), false); + const rp = try replica.Replica.init(gpa, 1, try a.unit(0, 0)); defer rp.deinit(); rp.core().echo = &rp.echo; rp.echo.on = on; @@ -3474,9 +3474,9 @@ fn corpusCase(dir: []const u8) !bool { defer own_host.shown.deinit(); var noop: Host = .{}; const options: pardes.Options = .{ .cols = 100, .rows = 22, .file = shapes }; - const a = try replica.Authority.init(gpa, options, own_host.host(), false); + const a = try replica.Authority.init(gpa, options, own_host.host()); defer a.deinit(); - const b = try replica.Authority.init(gpa, options, noop.host(), false); + const b = try replica.Authority.init(gpa, options, noop.host()); defer b.deinit(); noop.core = b.core; _ = try b.unit(0, 0); diff --git a/test/rollback_bench.zig b/test/rollback_bench.zig index 24203308..0d269327 100644 --- a/test/rollback_bench.zig +++ b/test/rollback_bench.zig @@ -140,7 +140,7 @@ fn digestBench(dir: []const u8, mb: usize) !void { } const vtable: pardes.Host.VTable = .{ .watched = watched }; }; - const a = try pardes.replica.Authority.init(gpa, .{ .cols = 120, .rows = 40, .file = path }, .{ .vtable = &NoHost.vtable }, true); + const a = try pardes.replica.Authority.init(gpa, .{ .cols = 120, .rows = 40, .file = path }, .{ .vtable = &NoHost.vtable }); defer a.deinit(); _ = try a.unit(0, 0); var unit_ns: [40]u64 = undefined; |
