From 893e12345c2458e70b333faedaaaaf8fbffb6932 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 17:22:24 -0300 Subject: A 9P monkey drives random requests at a throwaway session and checks the documented rules test/monkey9p.py starts pardes --detach with its own HOME, XDG dirs and runtime dir, speaks raw 9P (test/ninep.py) with a timeout on every reply and Tflush for held reads, and after each seeded operation checks that pardes is alive, the one-failure rule over a marker-delimited log window (with and without a follower), /index against /pane, and chunked against whole reads. Every run writes a replayable ops log; a failure is saved with its seed and step, shrunk by delta debugging over replays, and the run goes on in a fresh session. Teardown makes the fuzzer a subreaper and kills every process carrying the session's token. zig build monkey-9p -- --seed N --steps M | --replay F | --shrink F; a 150-step fixed-seed smoke run is part of fs-test. Co-Authored-By: Claude Opus 5.5 --- build.zig | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 8646be05..e9e64056 100644 --- a/build.zig +++ b/build.zig @@ -1568,7 +1568,25 @@ pub fn build(b: *std.Build) void { if (enable_quic) run_fs_test.addArg("--quic"); run_fs_test.setCwd(b.path(".")); run_fs_test.has_side_effects = true; - b.step("fs-test", "exercise default 9P service and mounts with an independent client").dependOn(&run_fs_test.step); + const fs_test_step = b.step("fs-test", "exercise default 9P service and mounts with an independent client"); + fs_test_step.dependOn(&run_fs_test.step); + + // Random 9P operations against a throwaway detached session, checking + // the documented rules (test/monkey9p.py). The fixed-seed smoke run is + // part of fs-test; the long run is manual. + const run_monkey9p = b.addSystemCommand(&.{ "python3", "-B", "test/monkey9p.py" }); + run_monkey9p.addArtifactArg(exe); + if (b.args) |args| run_monkey9p.addArgs(args); + run_monkey9p.setCwd(b.path(".")); + run_monkey9p.has_side_effects = true; + b.step("monkey-9p", "random 9P operations checking the documented rules (-- [--seed N]... [--steps M] [--replay F] [--shrink F] [--no-shrink])").dependOn(&run_monkey9p.step); + const run_monkey9p_smoke = b.addSystemCommand(&.{ "python3", "-B", "test/monkey9p.py" }); + run_monkey9p_smoke.addArtifactArg(exe); + run_monkey9p_smoke.addArg("--smoke"); + run_monkey9p_smoke.setCwd(b.path(".")); + run_monkey9p_smoke.has_side_effects = true; + b.step("monkey-9p-smoke", "a short fixed-seed 9P monkey run (part of fs-test)").dependOn(&run_monkey9p_smoke.step); + fs_test_step.dependOn(&run_monkey9p_smoke.step); const run_discovery = b.addSystemCommand(&.{ "python3", "-B", "test/fs.py" }); run_discovery.addArtifactArg(exe); -- cgit v1.3