From 558051ca5525a4dade47ab6ef7794eefd848f7b2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 18 Nov 2026 15:36:25 -0300 Subject: replicas: the soak loads addons (a picture, a PDF and a game of life as a user's libraries, in a data directory of its own; the picture open at the start, every client joining with it), its session has a clock (its loop's: a frame, its own input or a pty's read moves it, a client's mail does not; a frame pumps it, Authority.pump) and takes the Detach word (the client's link ended by the session, its view closed), pictures' draws land on their loop 3 ms after they are asked (Kind.drawer), and what it found: a client joined from a dump replayed a step that made a file's pane and said why it had no room for it by announcing to /log first (events.bootFirst read the session's log, p.fs, which a client's is not: a replica never announces there now; a test fails without it), and a Debug client's rollback put back a kind's Debug list of its allocations that a speculation had grown and freed on the page allocator (Slot.used now the slot's allocator's; the soak's seeds 0 and 2 at rtt 207 crashed without it); not fixed, reported: a client joined from a dump holding a PDF pane diverges at another client's key into it (pane N.addon, views[k].jumps); daemon.py --games, --window-clients (its PDF case run with the addons installed) pass on the base, process-test the base's two; replicas five clients diverged 0, unequal 0, checked/wrong 2143/0, 2000/0, 1846/0, quiet checks 554/0, 540/0, 706/0; three clients diverged 0; tui core-test 823/964, shell-test 999/1002, behaviour-test 274/274 and --replay 20 seeds 0 failures, pane-test 180/181, gui unit-test 1593/1597 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- build/tests.zig | 13 +++++++++++++ build/tools.zig | 6 ------ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'build') diff --git a/build/tests.zig b/build/tests.zig index 6ed97299..b7c7a5e7 100644 --- a/build/tests.zig +++ b/build/tests.zig @@ -135,6 +135,19 @@ pub fn add(b: *std.Build, c: struct { const liar_mod = b.createModule(.{ .root_source_file = b.path("test/liar.zig"), .target = c.target, .optimize = c.optimize, .imports = &.{.{ .name = "addon", .module = c.addon_mod }} }); const liar_lib = b.addLibrary(.{ .name = "liar", .linkage = .dynamic, .root_module = liar_mod }); for ([_]*std.Build.Step.Compile{ snake_lib, life_lib, liar_lib }) |lib| addon_test_step.dependOn(&b.addInstallArtifact(lib, .{}).step); + // The replicas' soak, its clients showing a picture, a PDF and a game + // of life from these libraries, as a user's addons are loaded. + const replicas = program(b, "pardes-replicas", "test/replicas.zig", c.target, c.optimize, &.{ .{ .name = "pardes", .module = c.core_module }, .{ .name = "term", .module = c.parts.term } }); + const run_replicas = b.addRunArtifact(replicas); + for ([_]?*std.Build.Step.Compile{ c.image_addon, life_lib, c.pdf_addon }) |l| if (l) |lib| { + run_replicas.addArg("--addon"); + run_replicas.addArtifactArg(lib); + }; + run_replicas.addArg("--pdf"); + run_replicas.addFileArg(b.path("docs/design.pdf")); + run_replicas.addPassthruArgs(); + run_replicas.has_side_effects = true; + b.step("replicas", "one authority and several replicas in process, each client typing over a delayed link: digests at quiescence, rollback rate and costs per RTT (-- [--seeds N] [--steps M] [--clients C] [--rtt 30,80,207])").dependOn(&run_replicas.step); for ([_]*std.Build.Module{ snake_mod, life_mod, liar_mod, c.parts.image }) |m| addon_test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); // ...and the pdf addon's, which mupdf-check runs too (its script // opens docs/design.pdf, from the build root). diff --git a/build/tools.zig b/build/tools.zig index bcf073ef..9b18019b 100644 --- a/build/tools.zig +++ b/build/tools.zig @@ -162,12 +162,6 @@ pub fn add(b: *std.Build, c: struct { run_rollback_bench.has_side_effects = true; b.step("rollback-bench", "a replica's rollback copy (walked state, pinned blobs, walk time) for a typical and a big session, and a fork of the big one (-Doptimize=ReleaseFast)").dependOn(&run_rollback_bench.step); - const replicas = program(b, "pardes-replicas", "test/replicas.zig", c.target, c.optimize, &.{ .{ .name = "pardes", .module = c.core_module }, .{ .name = "term", .module = c.parts.term } }); - const run_replicas = b.addRunArtifact(replicas); - run_replicas.addPassthruArgs(); - run_replicas.has_side_effects = true; - b.step("replicas", "one authority and several replicas in process, each client typing over a delayed link: digests at quiescence, rollback rate and costs per RTT (-- [--seeds N] [--steps M] [--clients C] [--rtt 30,80,207])").dependOn(&run_replicas.step); - const locations_bench_step = b.step("locations-bench", "measure cold/warm result formatting (-Doptimize=ReleaseFast; CSV on stderr)"); if (c.optimize != .fast) { locations_bench_step.dependOn(&b.addFail("locations-bench requires -Doptimize=ReleaseFast").step); -- cgit v1.3