From 020a7d24103a7c6f788db1091fd921d41d0df9e8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 15:38:35 -0300 Subject: views: a view opened or closed settles in its own input: a unit taped outside a step (a leave's close_view, a join's open_view) ended with effects queued, which a replica's copy asserted on and a joiner's dump dropped A client's leave is the session's closeView, whose sync sizes again a terminal the closed view sized (`sizes`) and queues its pty's resize; the session did it at its next pump, another unit. A replica that replayed the close was left with the effect queued between steps, and its next idle copy (Replica.ready, rollback.Copy.take's assert) aborted it: a client killed when another left (H10). A client joining at that boundary was dumped with the effect still queued, which a core loaded from a dump has none of (Replica.initDump), and diverged at the session's next pump (H6: "the core called poll_frame where the tape has a host (12)"). closeView and openView settle now, inside their own taped input, so every side does the same there; openView's covers what else was queued since the last pump (a 9P request's step). Test (failing before at each of the two asserts): a client leaves, and one joins: what the leave queued is done in its unit, on every side, before the join's dump. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 36ce6bdb..5b37342e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5669,6 +5669,11 @@ pub const Pardes = struct { pub fn openView(p: *Pardes) ?u8 { const taped = tape.enter(p, .open_view); defer tape.leave(p, taped); + // What was queued since the last pump (a leaving client's view + // closed, a 9P request's step) done first, as every client of the + // tape does it here: a join dumps the session next, and a core + // loaded from a dump has no queue (Replica.initDump). + p.settle(); p.needs_frame = true; return views.open(p); } @@ -5680,6 +5685,11 @@ pub const Pardes = struct { defer tape.leave(p, taped); views.close(p, k); p.sync(); + // What its sync queued (a terminal it sized, sized again) done here, + // in its own unit on every side: the session's next pump is another + // unit, and a replica takes a copy only of a core with nothing + // queued (rollback.Copy.take). + p.settle(); } /// Into view `k`, before the input its client sent. -- cgit v1.3