summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tape.zig16
1 files 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")) {