diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 02:55:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 03:01:52 -0300 |
| commit | f395894dd27c2d7a78c14f21b3c857d90db13800 (patch) | |
| tree | 522dbcf3a02bad8cb9188af323defe523c3df60a /abi/wire.zig | |
| parent | 63f59cbf3092c8bb7e3eae155969c0249fe2063d (diff) | |
| parent | 774efcc950662cd20c1b4a41d002ce421067564f (diff) | |
| download | pardes-f395894dd27c2d7a78c14f21b3c857d90db13800.tar.gz pardes-f395894dd27c2d7a78c14f21b3c857d90db13800.zip | |
integration: the pair's fast start on the landed main: pardes-pair-start (`xrkvvkkk`, the boot as input zero: the client makes its own core and says its digest, `boot`; the session's dump only when they differ) merged over main (merges 40 to 44: the typed slot fields, the 9P state in the join's dump and digest) and step 1 of pardes-pair-4; three conflicts, none by the compiler: abi/wire.zig's history and version (main 25, the boot 26: now 27, as 26 is the terminals' line's, merging now), Peers.join's welcome (main's typed `peer.view` with the boot's `peer.digest = digest` before it), `replica.join`'s first dial (the boot took the pair's arm out, step 1 put the upgrading redial in: both kept), test/daemon.py WIRE 27; tui core-test 878/1036 (158 skipped), shell-test 1078/1081
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 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/abi/wire.zig b/abi/wire.zig index 658cff23..cde9413e 100644 --- a/abi/wire.zig +++ b/abi/wire.zig @@ -10,6 +10,10 @@ const pardes = @import("core"); const config = @import("pardes_options"); const build_info = @import("build_info"); +/// 27: a pair's first client makes its own core from the session's +/// options and says its digest (`boot`) before its `far`: the session sends +/// no dump when its own at the join has the same (26 is the terminals' +/// line's); /// 25: the 9P state a session's requests made (its open records, each /// pane's, the panes the last look or exec touched, a header's /// truncation) is in its join's dump and its digest (core/fs.zig Namespace); @@ -41,7 +45,7 @@ const build_info = @import("build_info"); /// part B); 14: the hello names a session and /// carries the semantics hash, and a ping is answered (phase 5's /// groundwork); 13: the frames went (phase 3). -pub const version: u16 = 25; +pub const version: u16 = 27; /// The terminal's build and the window's step alike (`semantics`). const family = switch (config.platform) { @@ -115,6 +119,12 @@ pub const ClientTag = enum(u8) { /// guessed them for the input that follows: its time, which the step /// reads (core/replica.zig). stamp = 0x08, + /// A pair's first client's word before its `far`: the digest of the + /// core it made itself, from the session's options (Options.pair): + /// the session's at the join the same, no dump is sent. Not 0x09: a + /// stream's reader (replica.zig `Framer`) unpacks that tag as zstd + /// whichever way the stream runs. + boot = 0x0a, key = 0x10, mouse = 0x11, @@ -311,6 +321,7 @@ pub const ClientMsg = union(enum) { far: bool, want: []const u8, stamp: [2]i64, + boot: u64, event: pardes.Event, }; @@ -522,7 +533,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 => |v| try w.writeInt(u64, v, .little), + .ping, .boot => |v| try w.writeInt(u64, v, .little), .screen_ack, .want => |bytes| try w.writeAll(bytes), .check => {}, .far => |far| try w.writeByte(@intFromBool(far)), @@ -603,6 +614,7 @@ pub fn decodeClient(tag: u8, payload: []const u8) Error!ClientMsg { .far => .{ .far = try getBool(&r) }, .want => return .{ .want = payload }, .stamp => .{ .stamp = .{ try r.takeInt(i64, .little), try r.takeInt(i64, .little) } }, + .boot => .{ .boot = try r.takeInt(u64, .little) }, .key => blk: { const cp = try r.takeInt(u32, .little); // `Key.cp` is a u21, and the specials live in the private-use @@ -659,7 +671,7 @@ const msg_slack = header_len + 64; pub fn clientBound(msg: ClientMsg) usize { return msg_slack + switch (msg) { .hello => |h| h.session.len, - .bye, .ping, .check, .far, .stamp => 0, + .bye, .ping, .check, .far, .stamp, .boot => 0, .screen_ack, .want => |bytes| bytes.len, .event => |ev| switch (ev) { // Its hits' places (14 bytes each) past the slack. @@ -786,6 +798,8 @@ test "detached wire: a session is never told to do a frontend's remembering" { "hello", "bye", "ping", "screen_ack", "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). + "boot", // ...and when its next input was, by the session's clocks. "stamp", // ...and everything a person can do to a window. |
