From 3ad8138b483031aeb9a406f1928891631e7e7833 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 15:26:56 -0300 Subject: replicas: a step reads a notice band's rows as its state stands, never as the last frame left them, and the soak's session draws after every pump as a terminal's does (the user's rule: replica bugs caught by a soak that does what real use does): drawn so, `replicas --seeds 2 --rtt 30 --clients 5` diverged client 5 on seed 1 (`the tape's answer to addon is short (tape byte 145, in mouse)`, then every key of it stopped at `a key into a kind's pane`): another client's wheel_up over the PDF's pane in view 3 was `inside` on client 5 (top 23, no band) and not on the session (top 24, one message band), so the session called no addon (kindLeave and the rest) where the client called mouse; the read is `kindMouse`'s `pane.notices.span()` (core/mouse.zig, the same read as `edit.pointerTextSelection`'s chip test), and `notices` is derived (core/panes.zig's replica `.derived`, views.zig's PaneView: in no digest and no dump, which says "recomputed from the rest whenever it is wanted") yet was written outside every step, by a frame (`draw.place` -> `Messages.collectNotices`, at the frame's time and in the drawn view), and inside a step only for the live view at its end (`sync`), so what a step found there was the last frame this process drew, the band of a view as it stood when that view was last live, or nothing in a client joined from a dump since (client 5's case: the session's view-3 band was made by view 3's last step, client 5 joined after it); now `updateInner` (and `presentedInner`, whose look-hover reads the same chip test) makes every pane's bands again from the step's state before it reads them (core/Core.zig, a line each), so a step's calls no longer depend on whether a frame was drawn, and the soak's `watchedHost` is true (the `at_frame` field gone); a test, `a press on a notice's chip is the same state whichever frame this process drew last` (core/mouse.zig: a session that drew its frame once Del's question was due, a replica joined from its dump that drew none, a B1 press on the chip): before the fix the session swallowed it (drag .none) and the replica began a sweep (.select), after it both alike; the soak drawing after every pump: diverged 0/0/0, unequal 0/0/0, deltas checked/wrong 2078/0, 1773/0, 1775/0, quiet checks 932/0, 794/0, 893/0, stops not on may_wait 0/0/0 (rtt 30/80/207), corpus through a client 22/22; tui core-test 839/982 (143 skipped), shell-test 1018/1021, term 15/15, pane 183/184, kitty 45/45, behaviour-test 275/275 and --replay 275/275, process-test the base's two (lspcomplete, lspcompletemoved), gui unit-test 1616/1620 + BaselineHarnessMismatch (the base's); daemon.py plain, --far, --window-clients pass, --games fails as on the base (item 2, load 6-7), cross_replay 27 digests agree each; the frame and perf gate against tree1 (dd-i1b): PASS, frames 77/77 byte-identical, corpus2x +0.264% (bar 0.4%, noise 0.094%), the 97 per-operation counts within 0.1% (largest +0.038%) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/Core.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/Core.zig') diff --git a/core/Core.zig b/core/Core.zig index b4745b24..360ba833 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -1594,6 +1594,10 @@ fn serveFsInner(p: *Pardes, req: ctlfs.Req) ctlfs.Reply { pub const update = pardes.tape.taped(updateInner); fn updateInner(p: *Pardes, ev: Event) void { const v = p.view(); + // Its bands as its state stands: a step reads them (a press on a chip, a + // body's top under them), and what a frame drew, a view put back or a + // dump left in Pane.notices (derived) is not what every core has. + for (p.panes, 0..) |slot, id| if (slot) |pane| Messages.collectNotices(p, pane, v.rects[id], id); defer pardes.panes.File.syncTwins(p); defer p.reportFocus(); // A tick with no deadline due is the one event that cannot change @@ -1812,6 +1816,7 @@ fn noteLateFailureInner(p: *Pardes, id: usize) void { pub const presented = pardes.tape.taped(presentedInner); fn presentedInner(p: *Pardes) void { const v = p.view(); + for (p.panes, 0..) |slot, id| if (slot) |pane| Messages.collectNotices(p, pane, v.rects[id], id); if (v.pointer_inside and v.drag != .none) { v.hover_col = v.pointer_raw_col; v.hover_row = v.pointer_raw_row; -- cgit v1.3