From ff183922e78f04eee85043d29f1bd5e5ba43a6cd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 06:35:16 -0300 Subject: tape: the turn's check is a count, step 9a (reports/pardes-handle-69-design.md section 3.2): Turn.yield no longer asks the global tape whether a replica steps, it counts (Turn.yields, and Turn.zig no longer imports the tape); a speculation's tape notes the count at beginSpeculation and endSpeculation compares it, and apply compares it around each replayed input (the divergence still names the input; not around a session's end, whose dump check reads through no tape), with the same verdicts as before (a speculation poisoned, a replay diverged: Tape.stray, which now takes the count it started from); the free stray goes, the free replaying stays (the terminal's emulatorGpa reads it); the stray test drives a yield through both; the tape's bytes do not move (semantics df1f0502317ed362, cross_replay both ways against step 7: 29 and 27 digests agree x3); tui core-test 857/1008 (151 skipped), shell-test 1048/1051, pane-test 183/184, term-test 17/17, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed at a load of 37 (tagalign, exec-bigdrag) and both pass alone, the bytes soak as the base (diverged 0, unequal 0, corpus 22 of 22, the base's one now stop), the plain soak cut short after rtt 80 (diverged 0, unequal 0, corpus 22 of 22; its 207 is the next change's gate); gui unit-test 1645/1649 (the perf check's BaselineHarnessMismatch) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/Turn.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/Turn.zig') diff --git a/core/Turn.zig b/core/Turn.zig index 687e287f..249c6795 100644 --- a/core/Turn.zig +++ b/core/Turn.zig @@ -17,7 +17,6 @@ //! come from a shell performing a save between steps -- so a parked request //! is never the syscall's own. const std = @import("std"); -const tape = @import("tape.zig"); const Turn = @This(); @@ -46,6 +45,10 @@ restores: u64 = 0, lsp_answers: u64 = 0, /// All of the above, and `out` reaching zero. settled: std.Io.Condition = .init, +/// Every `yield`, ever: a replica's step makes none (each syscall of its +/// core is a tape site), which its tape checks by this count across a +/// speculation and a replayed input (core/tape.zig `stray`). +yields: u64 = 0, /// The editor's thread takes the turn for good; it has it until `stop`. pub fn start(t: *Turn, io: std.Io) void { @@ -79,10 +82,7 @@ pub fn wake(t: *Turn) void { /// a step. Nests: a directory listing that resolves each entry yields /// inside a yield, and only the outermost one lets go. pub fn yield(t: *Turn) void { - // A replica makes no syscall: each is a site of the tape's. One that - // is none stops a speculation and diverges a replay (it joins - // again), never the process (a window client's `Term fish`, H17). - if (tape.replaying()) tape.stray(); + t.yields +%= 1; const io = t.io orelse return; yield_depth += 1; if (yield_depth != 1) return; -- cgit v1.3