diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-19 13:51:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-19 14:46:05 -0300 |
| commit | f1db5eaf5a5cc5f891cc2c180aa706fefc39971d (patch) | |
| tree | 921c66c6c530153c85472e548d7eecb27ce2d2b5 /core/Messages.zig | |
| parent | 1553f31259f545329dd8032b73888b688520dd38 (diff) | |
| download | pardes-f1db5eaf5a5cc5f891cc2c180aa706fefc39971d.tar.gz pardes-f1db5eaf5a5cc5f891cc2c180aa706fefc39971d.zip | |
core: the core's own files' tape calls are the handle's, `p.tape` (the handle's step 4, P20, pardes-handle-sizing section 3's fourth noun): Core.zig's twelve (the state file off in a replica, `p.tape.replaying()`; the config directory, the startup file and Recent by hash asked of the authority, `p.tape.authority`; the focus report under a speculation of screen state, `p.tape.speculating and p.tape.screen_state`; a missing interpreter, the session's facts (its directory, home and shell), a command's prompt and a greeting, the next wake, `p.tape.value`), Messages.zig's two clocks (a message said, the unattended expiry: `p.tape.value(.clock, ..)`), dump.zig's two (a terminal's kind refused to a speculation, a slot revived on a replica); every function among them holds the core, so none gains the parameter; the sizing's three handed none: Core.parentTrouble and config.Runtime.apply took the tape in step 2, and Messages.Message.stamp is no step's at all: its only callers are hosts (dev/file_watch.zig, dev/host_io.zig, dev/tui/tui.zig, dev/gui/gui.zig, runtime/macos.zig: a file reloaded, a save, a language server's status), between steps, handing the text to `setMessage`, an input the tape carries, so its `tape.value(.clock, timeOfDay)` recorded nothing anywhere (a host's call is the host's side: `call` goes straight through) and is now the host's own `timeOfDay()`, no tape, no parameter, no `&tape.none` in five host files; left on the global with the entries, for step 9: init's and initFromDump's startFromEnv, deinit's `current` and `forget` (a client's core freed between its steps would write `forget` into its idle tape, the rule of this line's first change), Restore's `adopt`, and the hand-written entries' enter and leave; config.zig has no other tape call; no file of these four imports `tape` (Core.zig and dump.zig say `pardes.tape.`, config.zig's is a parameter); the five numbers: (1) functions that gained the parameter 0 (row: 3, two of them done in step 2, the third off the tape); (2) the 97 per-operation counts within 0.1%, the largest image-frame on longline +0.0232%; no function on a per-row path touched; (3) nothing stopped compiling for want of an io; (4) global io uses 7 (unchanged), free calls into the tape 63 -> 45, machine_lines rows unchanged (Messages.zig's 6: timeOfDay's libc lines are the same lines); (5) lines changed: tests 0, code +21/-19. Lines in files not this work's: none. Gate: tui core-test 840/983 (143 skipped), shell-test 1018/1021, pane-test 183/184, term-test 15/15, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds 0 failures, process-test lspcomplete and lspcompletemoved (the base's; winch and headersweep failed once, passed on the runner's retry), replicas --clients 5 diverged 0, unequal 0, deltas wrong 0 (2033/0, 1978/0, 1682/0), quiet 568/0, 581/0, 748/0, stops not at may_wait 0 (its "corpus through a client" fails as on the base, steps 18 to 21), gui unit-test 1616/1620 (BaselineHarnessMismatch, the base's), daemon.py plain, --far, --games, --window-clients pass, test/cross_replay.py tui to tui: 28 digests agree in each of the three replicas, semantics 313a99190b93a8c5 (unmoved); frames (gpu/handle2-4 against tree1) 77/77 byte-identical in Debug, gui unit-test 1616/1620, perfab corpus2x +0.112% (session noise 0.068%, threshold 0.4%), pictures identical in all 10 runs, perfops PASS
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Messages.zig')
| -rw-r--r-- | core/Messages.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/Messages.zig b/core/Messages.zig index de10b845..767eb297 100644 --- a/core/Messages.zig +++ b/core/Messages.zig @@ -111,9 +111,11 @@ pub const Message = struct { } pub fn stamp(buf: []u8, verb: []const u8, subject: []const u8) []const u8 { - // The time of day as the session that said it read it, in its - // zone: a replica's clock and TZ are its own (core/tape.zig). - const clock = pardes.tape.value(.clock, timeOfDay, .{}); + // The time of day of the host that stamps it, in its zone: only a + // host stamps a message (a file reloaded, a save, a language + // server's status), between steps, and the message it then hands + // the core (`setMessage`, an input) is what the tape carries. + const clock = timeOfDay(); const head = std.fmt.bufPrint(buf, "{s} {s} ", .{ &clock, verb }) catch return buf[0..0]; const room = buf.len - head.len; const tail = if (subject.len <= room) subject else subject[subject.len - room ..]; @@ -161,7 +163,7 @@ fn showMessage(p: *Pardes, id: usize, text: []const u8, stack: bool) void { pane.msg_len = @intCast(n); // The clock when it was said (the session clock is the last pump's, // and a 9P write after an idle hour would say it an hour ago). - pane.msg_said_ms = pardes.tape.value(.clock, nowMs, .{}); + pane.msg_said_ms = p.tape.value(.clock, nowMs, .{}); p.needs_frame = true; // New, the same line again or a status update: fresh, so it stays. pane.msg_life = .{}; @@ -185,7 +187,7 @@ fn nowMs() i64 { pub fn expireUnattended(p: *Pardes) void { if (!p.unattended) return; // The clock as the session that recorded read it (core/tape.zig). - const now = pardes.tape.value(.clock, nowMs, .{}); + const now = p.tape.value(.clock, nowMs, .{}); for (p.panes) |slot| { const pane = slot orelse continue; if (pane.msg_len == 0 and pane.msg_older_len == 0) continue; |
