diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 17:31:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 20:57:35 -0300 |
| commit | 40a24ca96be07778dfac7c789d936c732c0cc567 (patch) | |
| tree | c484b4cd32d191ad2a421fd8d77fb76491efc33c | |
| parent | 8c2c07bb4b991fde28b9af6207c7eb7418540130 (diff) | |
| download | pardes-40a24ca96be07778dfac7c789d936c732c0cc567.tar.gz pardes-40a24ca96be07778dfac7c789d936c732c0cc567.zip | |
pair: PARDES_TERM_BYTES (a working name) puts a session and its clients on the terminals' second road, the pty's bytes in the units to each client's own emulator (`Peers.bytes`), which only the soak could take (`--bytes`): the session's `Peers` is made with `.bytes` set (runtime/session.zig), every joined replica, a dump's or a pair's own boot, is turned to its own emulators as the soak turns its clients (core/replica.zig `takeJoined`: `screen_state` false, no predicted echo), and the process harness keeps the variable in a case's environment as it keeps PARDES_PAIR (test/process.zig `Child`); a client started without it against a session with it diverges: for the corpus through a pair's client window, not for a user (the switch for real clients is the terminals' line's); with it the corpus as a pair (PARDES_PAIR, a client window) is byte-identical to tree3's through frame 57, the kitty image in a terminal's pane (frame 50) included, where screen state diverges the client; frames 58-59 (WindowOpacity) differ and frame 61 (Font) never idles: only the own window applies or answers either (dev/gui/gui.zig `pollFrame`), a client window never does, and a window pair's session is the tui binary beside it; core/root.zig's machine_lines counts replica.zig's new getenv (76); core-test 896/1056, shell-test 1098/1101
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -rw-r--r-- | core/replica.zig | 6 | ||||
| -rw-r--r-- | core/root.zig | 2 | ||||
| -rw-r--r-- | runtime/session.zig | 5 | ||||
| -rw-r--r-- | test/process.zig | 5 |
4 files changed, 14 insertions, 4 deletions
diff --git a/core/replica.zig b/core/replica.zig index cbb64363..817d2c19 100644 --- a/core/replica.zig +++ b/core/replica.zig @@ -3257,6 +3257,12 @@ fn takeJoined(r: *Replica, j: *Joined, have: ?*Have, t0: u64) void { // PARDES_REPLICA_STATS: its timing samples kept, for its line. r.stats.samples = std.c.getenv("PARDES_REPLICA_STATS") != null; r.gmtoff = j.gmtoff; + // PARDES_TERM_BYTES: its terminals its own emulators, fed the pty's + // bytes its units carry (a session started with it: Peers.bytes). + if (std.c.getenv("PARDES_TERM_BYTES") != null) { + r.t.screen_state = false; + r.core().echo = null; + } // On the session's machine: a file read sent by hash is read here; // far, it goes to the disk for the next join. r.t.local_files = have == null; diff --git a/core/root.zig b/core/root.zig index 65f61e0d..8c325935 100644 --- a/core/root.zig +++ b/core/root.zig @@ -631,7 +631,7 @@ const machine_lines = [_]struct { []const u8, usize, []const u8 }{ .{ "jj.zig", 8, "jj run under tape.site(.jj) on an io of its own (the tape's spawns nothing) with this process's environment, the signal mask cleared as Stream's children's: the session's, a replica replays its answer" }, .{ "look.zig", 6, "openLink's fork (the host's: a view's frontend opens a link) and a remote's error name" }, .{ "memory.zig", 7, "the memory regions themselves (mmap, madvise, their locks)" }, - .{ "replica.zig", 75, "the client and session engines: sockets, threads, clocks, the blob cache, traces" }, + .{ "replica.zig", 76, "the client and session engines: sockets, threads, clocks, the blob cache, traces" }, .{ "rollback.zig", 1, "a test helper's directory" }, .{ "root.zig", 4, "dev's modules re-exported (host_io, file_watch, glide, fonts)" }, .{ "selection_pipe.zig", 14, "a pipe's child processes and their files: the host's `pipe` entry" }, diff --git a/runtime/session.zig b/runtime/session.zig index 75e8efcc..65432d97 100644 --- a/runtime/session.zig +++ b/runtime/session.zig @@ -86,7 +86,10 @@ pub fn Loop(comptime Frontend: type) type { defer l.prompt_rcs.deinit(); l.fs = ninep_io.start(l.io, l.gpa, l.core); defer if (l.fs) |f| f.deinit(l.gpa); - l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name() }; + // PARDES_TERM_BYTES (a working name, the pair's corpus runs): its + // clients' terminals by the pty's bytes (Peers.bytes), as the + // soak's `--bytes`; its clients must be started with it too. + l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name(), .bytes = std.c.getenv("PARDES_TERM_BYTES") != null }; l.inbox = .{ .io = l.io, .gpa = l.gpa, .lsp_allocator = l.allocs.lsp }; defer l.inbox.deinit(); // A search's worker may be waiting on the queue for room. diff --git a/test/process.zig b/test/process.zig index 791a5b8e..b16c50ff 100644 --- a/test/process.zig +++ b/test/process.zig @@ -945,8 +945,9 @@ pub const Child = struct { while (environ[i]) |kv| { const entry = std.mem.span(kv); const eq = std.mem.indexOfScalar(u8, entry, '=') orelse entry.len; - // PARDES_PAIR kept: the suite run as pairs (main.zig `pair`). - if ((std.mem.startsWith(u8, entry, "PARDES_") and !std.mem.startsWith(u8, entry, "PARDES_PAIR=")) or std.mem.indexOf(u8, entry[0..eq], "PAGER") != null) { + // PARDES_PAIR kept: the suite run as pairs (main.zig `pair`); + // PARDES_TERM_BYTES, their terminals by the pty's bytes. + if ((std.mem.startsWith(u8, entry, "PARDES_") and !std.mem.startsWith(u8, entry, "PARDES_PAIR=") and !std.mem.startsWith(u8, entry, "PARDES_TERM_BYTES=")) or std.mem.indexOf(u8, entry[0..eq], "PAGER") != null) { var name: [256]u8 = undefined; const n = std.fmt.bufPrintSentinel(&name, "{s}", .{entry[0..@min(eq, 255)]}, 0) catch _exit(126); _ = unsetenv(n); |
