From f2ede98aee0265e3506f5afd6039c70be7812767 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 15:19:25 -0300 Subject: remote clients: a pointer's hit carries the place it was made on (Layer.Place, on the wire, version 17) and a step resolves it from that, never from this process's frame (`surface`, `.local`), which a session never draws for a client: a window's pointer over a tag diverged it at once (the user's `tape byte 119`, 15 rejoins in 25 s) and a click there aborted it; a replay that meets a site its tape lacks, or makes a syscall that is none, is a divergence that goes on harmless (poisonOf), not a panic, and a speculation that makes one waits (Tty's shell lookup, untaped, is a value site now, as Shell's was); a copy over a queue is refused, not asserted; a session's last client, while no one else watches it, leaves it its layout (leaveView, settled as closeView is), which its rejoin copies; a redial waits only after an Upgrade's `refused` (a divergence's redialled a gone session 20 s); a dying session shuts its clients' links before its trace, and an --attach client ends its ssh and socket whatever way it exits; a far join's hashing stops at a blob once its client is let go (its leave waits for it in the step); a confirmed speculation's state is checked against its unit's digest, and the trace gives a key's and a pointer's words; test/daemon.py: 200 far joins level, a window's pointer swept over tags and body, ssh stand-in clients refused and detached, a client of a killed session ending in 2 s; in-process tests for each Co-Authored-By: Claude Opus 5.5 --- src/rollback.zig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/rollback.zig') diff --git a/src/rollback.zig b/src/rollback.zig index 9c4f6c05..cc10d2cc 100644 --- a/src/rollback.zig +++ b/src/rollback.zig @@ -221,7 +221,9 @@ pub const Copy = struct { return a.addr == b.addr and a.ty == b.ty; } }; - pub const Error = Allocator.Error; + /// Queued: the core holds effects or inputs not drained yet, which no + /// copy is taken over (the replica's input waits for the authority). + pub const Error = Allocator.Error || error{Queued}; pub fn deinit(c: *Copy) void { c.regions.deinit(c.meta); @@ -244,14 +246,15 @@ pub const Copy = struct { /// it held stays where it is until the copy is put back or let go. pub fn take(c: *Copy, e: *Epoch, p: *const Pardes) Error!void { std.debug.assert(!c.held); + // A step drains these before it ends, and a copy is taken between + // steps; an input of a host's without one (a view closed) may leave + // some until it is drained. + if (p.effects_len != 0 or p.in_len != 0) return error.Queued; c.regions.clearRetainingCapacity(); c.bytes.clearRetainingCapacity(); c.seen.clearRetainingCapacity(); c.pins.clearRetainingCapacity(); c.epoch = e; - // A step drains these before it ends: between steps they hold - // nothing, and a copy is taken between steps. - std.debug.assert(p.effects_len == 0 and p.in_len == 0); if (c.epoch.?.owns(@intFromPtr(p)) == null) @panic("rollback: the core is not its epoch's"); try c.object(Pardes, p); e.begin(); -- cgit v1.3