diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 15:26:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 17:21:46 -0300 |
| commit | 3ad8138b483031aeb9a406f1928891631e7e7833 (patch) | |
| tree | 5d9fe94f7af8c1f41f24b50e1f03f8a7b41917bf /test/replicas.zig | |
| parent | 553a62bac675bfc0a64254718488d3c8012f533e (diff) | |
| download | pardes-3ad8138b483031aeb9a406f1928891631e7e7833.tar.gz pardes-3ad8138b483031aeb9a406f1928891631e7e7833.zip | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/replicas.zig')
| -rw-r--r-- | test/replicas.zig | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/replicas.zig b/test/replicas.zig index 7f7ca0b3..572707a9 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -792,19 +792,16 @@ const Soak = struct { /// A Peer's queue, swapped out as its writer swaps it (the Peers' /// allocator's). sending: std.ArrayListUnmanaged(u8) = .empty, - /// This wait ended at its frame's tick: its pump draws. - at_frame: bool = false, fn of(ctx: ?*anyopaque) *Soak { return @ptrCast(@alignCast(ctx.?)); } - /// Its own view drawn at its frame's tick (`.frame`), as the soak's - /// session always drew it; not after every pump, as a terminal's is: - /// drawn so, the soak finds a client's step replayed with a kind's call - /// more than the session's (reports/pardes-runners-d.md). - fn watchedHost(ctx: ?*anyopaque) bool { - return of(ctx).at_frame; + /// Its own view drawn after every pump, as a terminal's session draws + /// its own (Core.render: drawn whenever a frame is owed and someone + /// sees it, and a terminal is always seen). + fn watchedHost(_: ?*anyopaque) bool { + return true; } fn ptyWrite(ctx: ?*anyopaque, pane: u8, bytes: []const u8) void { @@ -1124,7 +1121,6 @@ const Soak = struct { return false; } var took_output = false; - s.at_frame = false; // What its boundary took is old news. _ = s.l.peers.urgent.swap(false, .acq_rel); while (true) { @@ -1219,7 +1215,6 @@ const Soak = struct { s.frames_left = if (busy) 120 else s.frames_left -| 1; if (s.frames_left > 0) try net.send(.{ .at = m.at + frame_us, .n = 0, .kind = .frame, .who = 0, .bytes = &.{} }); if (took_output or core.needs_frame or (core.nextWake() orelse std.math.maxInt(u64)) <= s.now_ns) { - s.at_frame = true; s.framed = true; s.encode_ns = s.l.peers.screens.encode_ns; return false; |
