summaryrefslogtreecommitdiff
path: root/core/tape.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 10:39:52 -0300
committerGabriel Schneider <[email protected]>2026-11-22 10:39:53 -0300
commit94561bf0e13d034384eae01d2cb9d48a8fe0a502 (patch)
tree1a7ba2b66e6fbe69b06457863dc8e732435fb265 /core/tape.zig
parent9158de5d50831e115e14e2ed502300ee8c1d9930 (diff)
downloadpardes-94561bf0e13d034384eae01d2cb9d48a8fe0a502.tar.gz
pardes-94561bf0e13d034384eae01d2cb9d48a8fe0a502.zip
tape: no screen-state branch left, and a terminal's kitty images are each side's own emulator's again (the old road's deletion, piece 6 of 8): core/tape.zig loses `Tape.screen_state` and every branch on it (a terminal's output recorded without its bytes, the positions and prompt checks skipped, `screenReplica`, `screenAuthority`, `screenState`, `viewOnly`, which on the one road did nothing), and the tape site `images`; core/panes.zig its replica branches (a feed skipped and the session's positions taken, a view's scroll or follow noted, a resize left to the authority, the reloads at a join skipped); core/Term.zig a terminal's digest that returned early under screen state, and the medium read that went past the tape; core/dump.zig a join's dump always holds each terminal whole (`slim_terminals` stays for the exit dump); the tests' `t.screen_state = false` lines (4 in core/replica.zig, 3 in test/replicas.zig); THE IMAGES (the brief's choice): `Pane.term_images` and its taped read after each output (pardes-image-loop's cure for a screen-state client, whose emulator never held an image) go, the tag reads `Term.hasImages` again (core/tagline.zig), and a terminal's digest holds whether it has an image (core/term/terminal.zig `digest`: one bool among its facts), so the fact the tag shows is covered by the digest it is computed from (S1's rule) rather than by a pane field copied after each output, and a parting over it is named at the terminal; abi/wire.zig's line for 30 says so (the dump's shape changed with it); the image-loop's test runs on the one road (the client's emulator has the image, its tag says what the session's does); core-test 911/1068 (157 skipped), shell-test 1110/1113, term-test 15/15, pane-test 181/182, kitty-test 45/45, the soak's small run and `--echo` rc 0 (diverged 0, unequal 0, corpus 22)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/tape.zig')
-rw-r--r--core/tape.zig57
1 files changed, 3 insertions, 54 deletions
diff --git a/core/tape.zig b/core/tape.zig
index 5056f225..1cbf8aed 100644
--- a/core/tape.zig
+++ b/core/tape.zig
@@ -140,9 +140,6 @@ pub const Site = enum(u16) {
/// A kitty image's medium as a terminal's emulator read it (a file, a
/// temporary file, shared memory: Term.media), its bytes or its failure.
medium,
- /// Whether a terminal holds a kitty image after its program's output
- /// (Pane.term_images): a screen-state replica's emulator never has one.
- images,
};
/// What the sites return. wire.semantics hashes their shape with the
@@ -311,13 +308,6 @@ pub const Tape = struct {
dump_check: bool = false,
dumps: usize = 0,
dump_bytes: usize = 0,
- /// Screen-state terminals (core/term/screen_state.zig, docs/next-daemon.md
- /// phase 5): an authority recording for replicas, or a replica. A
- /// terminal's emulator is the authority's alone: its output is recorded
- /// without its bytes (they cross as screen state), its pty writes are
- /// not recorded, and no digest covers it. A replica's core never writes
- /// one but by `apply`.
- screen_state: bool = false,
/// The session's (replica.Peers): called between two of its inputs once
/// what it recorded since its last unit passes `unit_max`, to send that
/// as a unit: a pump of a flood's reads is cut into units under it.
@@ -423,12 +413,7 @@ pub const Tape = struct {
t.noteWrites();
t.noteHost(core);
}
- // A terminal's output crosses as screen state, not as its bytes.
- if (t.screen_state and input.* == .update and input.update.args[0] == .output) {
- var bare = input.*;
- bare.update.args[0].output.bytes = &.{};
- t.record(.input, Input, &bare);
- } else t.record(.input, Input, input);
+ t.record(.input, Input, input);
return .{ .tape = t };
}
@@ -806,12 +791,12 @@ pub const Tape = struct {
// output) is the session's answer, kept, and a replica whose
// emulators are fed the same bytes asks its own and compares: a
// check a unit, for nothing (P30: a digest, not state).
- if (comptime s == .positions or s == .prompt) if (!t.screen_state) {
+ if (comptime s == .positions or s == .prompt) {
const mine = @call(.auto, f, full);
t.scratch.clearRetainingCapacity();
walk.encode(R, &mine, &t.scratch.writer) catch @panic("tape: out of memory");
if (!std.mem.eql(u8, t.scratch.written(), t.last_ret.bytes[t.last_ret.at..])) t.diverge("what this replica's terminal told ({t}) is not what the session's did", .{s});
- };
+ }
var ret = t.last_ret;
return walk.decode(R, &ret, a orelse t.arena.allocator()) catch {
t.diverge("the tape's answer to {t} is short", .{s});
@@ -885,17 +870,6 @@ pub const Tape = struct {
return t.depth > 0 or t.replay or t.speculating;
}
- /// A replica's core under screen-state terminals: its emulators are
- /// written by `apply` alone, never by its own steps.
- pub fn screenReplica(t: *const Tape) bool {
- return t.screen_state and (t.replay or t.speculating);
- }
-
- /// An authority recording for screen-state replicas.
- pub fn screenAuthority(t: *const Tape) bool {
- return t.screen_state and !t.replay and !t.speculating;
- }
-
/// What a speculation reached is the authority's (`why`): the input is
/// undone and waits for the authority's order.
pub fn poison(t: *Tape, why: []const u8) void {
@@ -913,14 +887,6 @@ pub const Tape = struct {
return true;
}
- /// A speculation that moves a terminal's view: it may (its rollback
- /// puts the view back, replica.zig `views`); a screen-state replica's
- /// says it did (a delta sets the view again).
- pub fn viewOnly(t: *Tape, comptime _: []const u8) bool {
- if (t.speculating and t.screen_state) t.touched = true;
- return false;
- }
-
/// A speculation read a terminal's rows or moved its view (`Tape.touched`).
pub fn touchTerminal(t: *Tape) void {
if (t.speculating) t.touched = true;
@@ -1356,19 +1322,6 @@ pub fn stepping() bool {
return (on orelse &none).stepping();
}
-/// Screen-state terminals, on either side (`Tape.screen_state`).
-pub fn screenState() bool {
- return (on orelse &none).screen_state;
-}
-
-pub fn screenReplica() bool {
- return (on orelse &none).screenReplica();
-}
-
-pub fn screenAuthority() bool {
- return (on orelse &none).screenAuthority();
-}
-
pub fn poison(why: []const u8) void {
(on orelse &none).poison(why);
}
@@ -1383,10 +1336,6 @@ pub fn authorityOnly(comptime why: []const u8) bool {
return (on orelse &none).authorityOnly(why);
}
-pub fn viewOnly(comptime why: []const u8) bool {
- return (on orelse &none).viewOnly(why);
-}
-
pub fn touchTerminal() void {
(on orelse &none).touchTerminal();
}