From 70de5ec5ff3dad01afcc45244ad5e5a481486da6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 29 Oct 2026 17:01:35 -0300 Subject: dump: one walker dump of the whole session, by name across builds, for Restore, -l, Handover and the store; dump.zig's hand-written schema gone A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 --- test/monkey.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/monkey.zig') diff --git a/test/monkey.zig b/test/monkey.zig index d35599ff..2e19cb21 100644 --- a/test/monkey.zig +++ b/test/monkey.zig @@ -177,7 +177,7 @@ pub fn main(init: std.process.Init) !void { const io = init.io; const args = try init.minimal.args.toSlice(init.arena.allocator()); if (args.len < 4) { - std.debug.print("usage: pardes-monkey [steps] [--from=N] [--out=DIR] [--keep] [--tape=DIR] [--views=N]\n", .{}); + std.debug.print("usage: pardes-monkey [steps] [--from=N] [--out=DIR] [--keep] [--tape=DIR] [--views=N] [--dump]\n", .{}); std.process.exit(2); } const snap = args[1]; @@ -192,6 +192,9 @@ pub fn main(init: std.process.Init) !void { // seed is a hit if one does not replay (pardes-snap --tape). var tape: ?[]const u8 = null; var views: usize = 1; + // --dump (with --tape): each replay loads the session's dump at its end + // too (pardes-snap --dump). + var dump = false; var positional: usize = 0; for (args[3..]) |a| { if (std.mem.startsWith(u8, a, "--views=")) { @@ -202,6 +205,8 @@ pub fn main(init: std.process.Init) !void { keep = true; } else if (std.mem.startsWith(u8, a, "--tape=")) { tape = a; + } else if (std.mem.eql(u8, a, "--dump")) { + dump = true; } else if (std.mem.startsWith(u8, a, "--out=")) { out = a["--out=".len..]; } else { @@ -223,7 +228,7 @@ pub fn main(init: std.process.Init) !void { const path = try std.fmt.bufPrint(&path_buf, "{s}/seed-{d}.snap", .{ out, seed }); try std.Io.Dir.cwd().writeFile(io, .{ .sub_path = path, .data = script }); const run = std.process.run(gpa, io, .{ - .argv = if (tape) |t| &.{ snap, app, "--update", "--no-retry", "--jobs=1", t, path } else &.{ snap, app, "--update", "--no-retry", "--jobs=1", path }, + .argv = if (tape) |t| (if (dump) &.{ snap, app, "--update", "--no-retry", "--jobs=1", t, "--dump", path } else &.{ snap, app, "--update", "--no-retry", "--jobs=1", t, path }) else &.{ snap, app, "--update", "--no-retry", "--jobs=1", path }, .stdout_limit = .limited(64 << 20), .stderr_limit = .limited(64 << 20), }) catch |err| { -- cgit v1.3