summaryrefslogtreecommitdiff
path: root/test/replicas.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 20:21:32 -0300
committerGabriel Schneider <[email protected]>2026-11-22 20:21:32 -0300
commit3f250d0f963f375d699f11ffc02b07f2e2cbbbee (patch)
tree4e5a1f577fd3dd247f3643d979868347524ce703 /test/replicas.zig
parent34e2d82a322bd3767a8ec62b3a4c0894399e8c04 (diff)
parentc607dc14502a6956bdfa3575bc7363514a7abeb4 (diff)
downloadpardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.tar.gz
pardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.zip
integration (a base for the terminals' next round, not yet the gathered line): the viewport in the view and the patches in the semantics hash on merge58 with the terminal put back: pardes-raw-tty (`muwnrqro`, on pardes-merge58: a TERM that reaches a session while it leaves its terminal no longer leaves it raw: `Killed.disarm` puts the cooked modes back itself, `leave` calls it last) and pardes-term-join-10's two changes (`xktusoyq` on `qtxssxyk`, on pardes-term-join-9: where a view stands in a terminal's history is the view's (`Pane.scrolled_to`), carried once a confirmed write that moves rows, the wire at 31; build/patches hashed into a replica's semantics); no conflict; core-test 917/1077 (160 skipped), shell-test 1119/1122, pane-test 182/183, term-test 16/16; NOT gated whole: the viewport's gate had one perf count over its budget ("terminal on all" +0.235%), which the next round brings down before this is the gathered line (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/replicas.zig')
-rw-r--r--test/replicas.zig19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/replicas.zig b/test/replicas.zig
index 90f7c10d..a68ce222 100644
--- a/test/replicas.zig
+++ b/test/replicas.zig
@@ -856,19 +856,18 @@ const Watchdog = struct {
/// the untraced one.
const Named = struct {
const Parted = struct { c: usize, origin: u16, seq: u32, parts: []u64, terms: [pardes.MAX_PANES]Term };
- /// A terminal pane's: its screen's digest without its view and with
- /// it, and where its view and cursor stand.
- const Term = struct { content: u64 = 0, viewed: u64 = 0, grid: pardes.Term.Grid = .{} };
+ /// A terminal pane's: its screen's digest, where the live view stands
+ /// in it (the pane's, `scrolled_to`), and its grid.
+ const Term = struct { content: u64 = 0, place: ?usize = null, grid: pardes.Term.Grid = .{} };
fn terms(p: *const pardes.Pardes) [pardes.MAX_PANES]Term {
var out: [pardes.MAX_PANES]Term = @splat(.{});
for (p.panes, &out) |slot, *t| {
- const state = (slot orelse continue).terminal orelse continue;
+ const pane = slot orelse continue;
+ const state = pane.terminal orelse continue;
var a = pardes.walk.Hasher.init(0);
- state.digestScreen(&a, false);
- var b = pardes.walk.Hasher.init(0);
- state.digestScreen(&b, true);
- t.* = .{ .content = a.final(), .viewed = b.final(), .grid = pardes.Term.grid(state) };
+ state.digest(&a);
+ t.* = .{ .content = a.final(), .place = pane.scrolled_to, .grid = pardes.Term.grid(state) };
}
return out;
}
@@ -898,8 +897,8 @@ const Named = struct {
const theirs = arena.allocator().create(pardes.tape.Parts) catch return;
const want = pardes.tape.digestParts(rp.core(), theirs);
w.print("seed {d} rtt {d} ms: client {d} names: at unit {d}/{d}, against the witness's replay: {s}\n", tag ++ .{ x.c + 1, u.origin, u.seq, pardes.tape.partsDiffer(x.parts, want, arena.allocator()) }) catch {};
- for (x.terms, terms(rp.core()), 0..) |a, b, id| if (a.viewed != b.viewed or a.content != b.content) {
- w.print(" pane {d}'s terminal: content {s}, view {s}; the client's {any}; the witness's {any}\n", .{ id, if (a.content == b.content) "equal" else "DIFFERS", if (a.viewed == b.viewed) "equal" else "DIFFERS", a.grid, b.grid }) catch {};
+ for (x.terms, terms(rp.core()), 0..) |a, b, id| if (a.place != b.place or a.content != b.content) {
+ w.print(" pane {d}'s terminal: content {s}, view {s}; the client's {any} at {?d}; the witness's {any} at {?d}\n", .{ id, if (a.content == b.content) "equal" else "DIFFERS", if (a.place == b.place) "equal" else "DIFFERS", a.grid, a.place, b.grid, b.place }) catch {};
};
};
}