summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-21 02:55:12 -0300
committerGabriel Schneider <[email protected]>2026-11-21 03:01:52 -0300
commitf395894dd27c2d7a78c14f21b3c857d90db13800 (patch)
tree522dbcf3a02bad8cb9188af323defe523c3df60a /runtime
parent63f59cbf3092c8bb7e3eae155969c0249fe2063d (diff)
parent774efcc950662cd20c1b4a41d002ce421067564f (diff)
downloadpardes-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 'runtime')
-rw-r--r--runtime/client.zig26
-rw-r--r--runtime/main.zig4
2 files changed, 29 insertions, 1 deletions
diff --git a/runtime/client.zig b/runtime/client.zig
index 7941889e..c550b0fa 100644
--- a/runtime/client.zig
+++ b/runtime/client.zig
@@ -190,7 +190,9 @@ pub fn Loop(comptime Frontend: type) type {
upgrade.locate();
while (true) {
link.reset(s.r, &s.joined);
- l.fe.start(l);
+ if (s.joined.booted) {
+ if (!l.confirm(s)) return .failed;
+ } else l.fe.start(l);
var done: std.atomic.Value(bool) = .init(false);
const reader = try std.Thread.spawn(.{}, read, .{ l, s, &done });
while (!link.quit) {
@@ -231,6 +233,28 @@ pub fn Loop(comptime Frontend: type) type {
}
}
+ /// A pair's first join, its replica its own boot (replica.ownBoot): its
+ /// start's inputs held and its first pass drawn, then the session's
+ /// welcome read: the same core, what was held is sent; another (the
+ /// dump came), the dump's replica in place of the boot's, started
+ /// again. False, and why in `s.why`: no session to go on with.
+ fn confirm(l: *L, s: *Start) bool {
+ const link = &l.link;
+ link.held = .empty;
+ l.fe.start(l);
+ _ = l.before();
+ const r = replica.confirmBoot(s.gpa, &s.joined, s.r, s.o, &s.why) orelse {
+ link.release(s.gpa, false);
+ return false;
+ };
+ link.release(s.gpa, r == s.r);
+ if (r == s.r) return true;
+ s.r = r;
+ link.reset(r, &s.joined);
+ l.fe.start(l);
+ return true;
+ }
+
/// The session's stream, onto the frontend's queue: its messages,
/// and its end.
fn read(l: *L, s: *Start, done: *std.atomic.Value(bool)) void {
diff --git a/runtime/main.zig b/runtime/main.zig
index 0751f6b0..b0338831 100644
--- a/runtime/main.zig
+++ b/runtime/main.zig
@@ -1812,6 +1812,10 @@ fn pair(init: std.process.Init, opts: *pardes.Options, args: []const [:0]const u
var sock_buf: [ninep_io.sun_path_len:0]u8 = undefined;
var o = opts.*;
o.pair = fds[1];
+ // The client makes its core from its session's options (replica.ownBoot):
+ // a window's session is the terminal binary it execs, whose views are
+ // not windowed until a window says so (its first input).
+ o.windowed = false;
clientOf(init, o, daemon.replicaSocket(&sock_buf) orelse "", name, false) catch |err| die(init.io, "{t}", .{err});
std.process.exit(0);
}