summaryrefslogtreecommitdiff
path: root/src/tape.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:51:08 -0300
committerGabriel Schneider <[email protected]>2026-11-05 09:54:56 -0300
commit469e8a3aa6a7e29ace184d1b09e769ff96fc61d5 (patch)
tree7984d191e3ad705e0b1779527687e60fb97a208e /src/tape.zig
parent2c1611695bc8897756c1168445c0d4f67a683049 (diff)
downloadpardes-469e8a3aa6a7e29ace184d1b09e769ff96fc61d5.tar.gz
pardes-469e8a3aa6a7e29ace184d1b09e769ff96fc61d5.zip
tape: replayMain replays each run with replayUnit, whose loop it copied record for record
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/tape.zig')
-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")) {