summaryrefslogtreecommitdiff
path: root/src/tape.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 11:40:11 -0300
committerGabriel Schneider <[email protected]>2026-11-05 12:41:36 -0300
commit3f1533813b6692a736251e4d467a7f108229ddee (patch)
tree37a32c5ebbf9d3af08923856fd6fa516f3b33a39 /src/tape.zig
parentcfd2b993feda1b3f7474225bb32db8cac8edc5ae (diff)
downloadpardes-3f1533813b6692a736251e4d467a7f108229ddee.tar.gz
pardes-3f1533813b6692a736251e4d467a7f108229ddee.zip
targets: the DOM web shell goes (src/web.zig and src/web/, its harnesses web_harness, web_snapshot, web_driver_test and web-snapshots/, tools/web_fixture.py, -Dplatform=web, -Ddump, and the web, web-harness, web-snap, web-e2e and web-driver-test steps), and with it what only a freestanding build needed: `hosted` and every guard on it (every build has a host now), memory's stack-fallback arenas and reduced_target sizes, the emscripten main, the tree-sitter libc shim and the stb stub, lsp's has_client, the web arms of the platform switches (-Dplatform is tui, gui or macos); the macOS files pass zig ast-check; docs/web.md is a paragraph on what it was
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.zig9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/tape.zig b/src/tape.zig
index 0e8bbfe6..3723537e 100644
--- a/src/tape.zig
+++ b/src/tape.zig
@@ -150,8 +150,8 @@ pub const results = .{
/// taped by its name, and `anyerror` keeps no list of names to look one up
/// in. ponytail: kept by hand, the sets of what a host reports from; one
/// outside them is a Debug build's panic as it is taped (walk.encode) and a
-/// release build's divergence (the replica joins again). No host, none.
-pub const Failure = if (!pardes.hosted) error{} else ErrorOf(host_io.forkShell) || ErrorOf(pardes.filesystem.write) ||
+/// release build's divergence (the replica joins again).
+pub const Failure = ErrorOf(host_io.forkShell) || ErrorOf(pardes.filesystem.write) ||
ErrorOf(pardes.filesystem.readRestore) || ErrorOf(pardes.dump.restore) ||
@typeInfo(@TypeOf(pardes.config.User.dumpThemes(undefined, undefined, undefined, pardes.themes))).error_union.error_set ||
ErrorOf(host_io.Lsp.snapshot) ||
@@ -279,7 +279,6 @@ pub const Tape = struct {
}
fn flush(t: *Tape) void {
- if (comptime !pardes.hosted) return;
// A tape in memory (a replica's, an authority's stream) is taken
// by whoever holds it.
if (t.fd < 0) return;
@@ -894,7 +893,6 @@ fn call(comptime s: Site, a: ?std.mem.Allocator, comptime f: anytype, args: anyt
} else @compileError("tape: the site ." ++ @tagName(s) ++ " returns " ++ @typeName(R) ++ ", which tape.results does not list");
}
// No tape where there is no host to record or replay one.
- if (comptime !pardes.hosted) return if (yields) out(f, args) else @call(.auto, f, args);
const t = on orelse return if (yields) out(f, args) else @call(.auto, f, args);
const id: u16 = @as(u16, host_fns.len) + @backingInt(s);
if (t.replay) {
@@ -1201,7 +1199,6 @@ pub fn digestOf(p: *const Pardes) u64 {
/// PARDES_RECORD set: the tape is written from the session's first call.
pub fn startFromEnv() void {
- if (comptime !pardes.hosted) return;
if (on != null) return;
const prefix = std.mem.span(libc.getenv("PARDES_RECORD") orelse return);
if (prefix.len == 0) return;
@@ -1257,7 +1254,6 @@ pub fn replayMain(io: std.Io, path: []const u8) u8 {
}
test "a syscall that is no site, made replaying, diverges the replay and poisons a speculation" {
- if (comptime !pardes.hosted) return;
const gpa = std.testing.allocator;
var t: Tape = .{ .gpa = gpa, .replay = true, .scratch = .init(gpa), .arena = .init(gpa) };
defer t.scratch.deinit();
@@ -1276,7 +1272,6 @@ test "a syscall that is no site, made replaying, diverges the replay and poisons
}
test "a replay that finds no answer where its core reads one diverges, and the read goes on harmless" {
- if (comptime !pardes.hosted) return;
const gpa = std.testing.allocator;
var t: Tape = .{ .gpa = gpa, .replay = true, .scratch = .init(gpa), .arena = .init(gpa) };
defer t.scratch.deinit();