From 469e8a3aa6a7e29ace184d1b09e769ff96fc61d5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:51:08 -0300 Subject: tape: replayMain replays each run with replayUnit, whose loop it copied record for record Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/tape.zig | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/tape.zig b/src/tape.zig index c4e36bcd..3774261c 100644 --- a/src/tape.zig +++ b/src/tape.zig @@ -1249,23 +1249,11 @@ pub fn replayMain(io: std.Io, path: []const u8) u8 { }; var failed = false; for (runs) |run| { - var t: Tape = .{ .gpa = gpa, .replay = true, .in = .{ .bytes = bytes }, .headless = run.headless, .scratch = .init(gpa), .arena = .init(gpa) }; + var t: Tape = .{ .gpa = gpa, .replay = true, .headless = run.headless, .scratch = .init(gpa), .arena = .init(gpa) }; t.dump_check = std.mem.eql(u8, run.name, "first") and libc.getenv("PARDES_REPLAY_DUMP") != null; on = &t; defer on = null; - while (t.diverged == null) { - const kind = t.peek() orelse break; - var rec = t.next().?; - switch (kind) { - .input => { - t.apply(&rec.payload); - _ = t.arena.reset(.retain_capacity); - }, - .set => t.applySet(&rec.payload), - .digest => t.check(&rec.payload), - .host, .ret, .done => t.diverge("a {t} record at the top", .{kind}), - } - } + _ = replayUnit(&t, bytes); // A session killed mid-step leaves its last input cut short: the // end of the tape, not a divergence. if (t.diverged) |why| if (std.mem.startsWith(u8, why, "the tape ends")) { -- cgit v1.3