summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 03:03:25 -0300
committerGabriel Schneider <[email protected]>2026-11-22 03:03:55 -0300
commit70c9e3fbf9cdc7139b4da0142f3a44741a7e1491 (patch)
tree966bee71386ad820cb8b23a96ac0c09e5a0f0c1d /abi
parentd56973aa92d0de6d84446dff73eba9d5654fe6f4 (diff)
downloadpardes-70c9e3fbf9cdc7139b4da0142f3a44741a7e1491.tar.gz
pardes-70c9e3fbf9cdc7139b4da0142f3a44741a7e1491.zip
replica: no road to choose, and the wire at 30 (the old road's deletion, piece 4 of 8; the coordinator's decision: the welcome's road byte goes, no dead field stays on the wire): `Peers.bytes` (set by runtime/session.zig unless PARDES_TERM_SCREEN), the welcome's `bytes` byte (abi/wire.zig: its encode, its decode, the round-trip test's byte), `Joined.bytes` and `joinOn`'s copy of it, `road` (fromDump's, ownBoot's, confirmBoot's, a test's: a replica's `made` arms its echo already, and no replica starts on screen state since piece 3), and ownBoot's read of PARDES_TERM_SCREEN; so PARDES_TERM_SCREEN and PARDES_TERM_BYTES name nothing in the tree; abi/wire.zig's version is 30, its history line saying both of this line's wire changes (the screen messages retired as gaps in piece 3, the welcome's byte here); test/daemon.py's `WIRE` 30; firstOnPair's argument is now what it chose, `by_dump` (a client joined by the session's dump, or one that makes its own core); core/root.zig `machine_lines` for replica.zig 74 -> 73; core-test 911/1068 (157 skipped), shell-test 1110/1113
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'abi')
-rw-r--r--abi/wire.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/abi/wire.zig b/abi/wire.zig
index ab974e35..48b3ae51 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");
+/// 30: the terminals' one road: the screen-state messages are retired (a
+/// replica's `screen_ack`, 0x04, and the session's `screen`, 0x06: gaps)
+/// and a welcome says no road (its `bytes` byte gone);
/// 29: a session's terminals reach its clients as the pty's bytes in its
/// units, each client's emulator its own; a welcome says the road (`bytes`;
/// screen state under PARDES_TERM_SCREEN), which the client loads its dump
@@ -54,7 +57,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 = 29;
+pub const version: u16 = 30;
/// The terminal's build and the window's step alike (`semantics`).
const family = switch (config.platform) {
@@ -221,7 +224,7 @@ pub const ServerMsg = union(ServerTag) {
/// dump that follows is, and the session's offset from UTC (a replica
/// guesses the session's time of day). A far client is told how many
/// blobs the dump holds (`blobs`).
- welcome: struct { pid: u32, session: []const u8, client: u16 = 0, view: pardes.Pardes.View.Id = .at(0), dump_len: u64 = 0, gmtoff: i32 = 0, digest: u64 = 0, semantics: u64 = 0, bytes: bool = false, blobs: u32 = 0 },
+ welcome: struct { pid: u32, session: []const u8, client: u16 = 0, view: pardes.Pardes.View.Id = .at(0), dump_len: u64 = 0, gmtoff: i32 = 0, digest: u64 = 0, semantics: u64 = 0, blobs: u32 = 0 },
refused: []const u8,
pong: u64,
dump: []const u8,
@@ -256,7 +259,6 @@ pub fn decodeServer(tag: u8, payload: []const u8) Error!ServerMsg {
.gmtoff = try r.takeInt(i32, .little),
.digest = try r.takeInt(u64, .little),
.semantics = try r.takeInt(u64, .little),
- .bytes = try r.takeByte() != 0,
.blobs = try r.takeInt(u32, .little),
} },
.refused => .{ .refused = try r.take(try r.takeInt(u16, .little)) },
@@ -287,7 +289,6 @@ pub fn encodeServer(out: []u8, msg: ServerMsg) Error![]const u8 {
try w.writeInt(i32, h.gmtoff, .little);
try w.writeInt(u64, h.digest, .little);
try w.writeInt(u64, h.semantics, .little);
- try w.writeByte(@intFromBool(h.bytes));
try w.writeInt(u32, h.blobs, .little);
},
.refused => |words| try putSlice16(&w, words),
@@ -729,14 +730,13 @@ test "detached wire: every Event variant round-trips" {
try testing.expectEqual(@as(u64, 0xfeed_beef_0000_0001), (try roundClient(&buf, .{ .ping = 0xfeed_beef_0000_0001 })).ping);
{
// The other way: framed the same, its tag the ServerTag's number.
- const bytes = try encodeServer(&buf, .{ .welcome = .{ .pid = 42, .session = "work", .bytes = true } });
+ const bytes = try encodeServer(&buf, .{ .welcome = .{ .pid = 42, .session = "work" } });
const f = (try framed(bytes)).?;
try testing.expectEqual(@as(u8, 0x01), f.tag);
- try testing.expectEqualSlices(u8, &.{ 42, 0, 0, 0, 4, 0, 'w', 'o', 'r', 'k', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, f.payload);
+ try testing.expectEqualSlices(u8, &.{ 42, 0, 0, 0, 4, 0, 'w', 'o', 'r', 'k', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, f.payload);
const back = (try decodeServer(f.tag, f.payload)).welcome;
try testing.expectEqualStrings("work", back.session);
try testing.expectEqual(@as(u32, 42), back.pid);
- try testing.expect(back.bytes);
try testing.expectEqual(@as(u8, 0x03), (try framed(try encodeServer(&buf, .{ .pong = 7 }))).?.tag);
}