summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 05:26:38 -0300
committerGabriel Schneider <[email protected]>2026-11-21 05:30:39 -0300
commite29ff73bbb2c198afbb894ee98854da2d9a7be7d (patch)
tree17cf56b16272f43fdb789174350681641876e170 /abi
parent63538d28cee238ff53c731f965c22e615d43bec1 (diff)
parentfe0aa07c18a9fd5ca6bdcb78e9354a2745e32298 (diff)
downloadpardes-e29ff73bbb2c198afbb894ee98854da2d9a7be7d.tar.gz
pardes-e29ff73bbb2c198afbb894ee98854da2d9a7be7d.zip
integration: the pair's finished steps on the gathered line: pardes-pair-4 (`rustnvoo`: an attach handed to a session as it upgrades is told so and joins the new process; the fast start, the boot as input zero: the wire at 27; a window client exec'd at an Upgrade comes back the size it was) and pardes-merge47 (`rprvwpnv`: the terminals' line at 26 and the library for a browser reader); three textual conflicts: abi/wire.zig's history says 27 and 26 each in its own words and the version is 27, test/daemon.py's WIRE is 27, core/replica.zig's Link keeps both lines' fields (the lag bound's `behind`, `least`, `fresh`, `lagged`; the pair's `held`); core-test 885/1045 (160 skipped), shell-test 1087/1090; its gate: .scratch/sketch/reorg/merge48, the numbers in PARDES.md (2026-11-21)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'abi')
-rw-r--r--abi/wire.zig19
1 files changed, 16 insertions, 3 deletions
diff --git a/abi/wire.zig b/abi/wire.zig
index 5f8e1f97..88a82e52 100644
--- a/abi/wire.zig
+++ b/abi/wire.zig
@@ -10,6 +10,9 @@ 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: a view kept for its client's rejoin says when it went away
/// (View.away_ns), and is that client's for Views.away_kept_ns;
/// 25: the 9P state a session's requests made (its open records, each
@@ -43,7 +46,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 = 26;
+pub const version: u16 = 27;
/// The terminal's build and the window's step alike (`semantics`).
const family = switch (config.platform) {
@@ -117,6 +120,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,
@@ -313,6 +322,7 @@ pub const ClientMsg = union(enum) {
far: bool,
want: []const u8,
stamp: [2]i64,
+ boot: u64,
event: pardes.Event,
};
@@ -524,7 +534,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)),
@@ -605,6 +615,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
@@ -661,7 +672,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.
@@ -788,6 +799,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.