summaryrefslogtreecommitdiff
path: root/src/TerminalImages.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 11:14:38 -0300
committerGabriel Schneider <[email protected]>2026-10-29 15:57:34 -0300
commit044da0f75ab5fb5be0213e512741860d95dad8e5 (patch)
tree98c1dd8ddf2095ead2e783577124313b88eae9ef /src/TerminalImages.zig
parentc4f3749c058121ba086a851188691e7ae40d2018 (diff)
downloadpardes-044da0f75ab5fb5be0213e512741860d95dad8e5.tar.gz
pardes-044da0f75ab5fb5be0213e512741860d95dad8e5.zip
tape: every input the core consumes recorded in turn order, replayed into replicas that must reach the same digests; the core's leaks of render, clock and host closed
The recorder (src/tape.zig) is null unless PARDES_RECORD=<prefix> names a tape (<prefix><pid>.tape); the local path pays a null check a call. It records a tree at the host boundary, both ways: each call the host makes into the core (`Input`: update, serveFs, pump, perform, the shell's acknowledgements and failures, a Restore, ...) with its arguments, and each call the core makes out -- a Host function (the vtable wrapped generically while recording) or a syscall of its own (`tape.site` for every old `turn.yield()`, `tape.value` for a clock or environment read) -- with its result; `done`/`ret` close each, a 9P request served while a step is out lands inside that step's syscall, and fields a host writes between calls (native_images, present_skipped, ...) are found by a diff at every crossing. After each call the host made at the top, the session's digest (src/walk.zig), one per field of the core, its stream and each pane, file and places. `PARDES_REPLAY=<tape> pardes` (main.zig) replays it with the same build into three replicas: two at different addresses (the first's memory held while the second runs) and one that never draws. A host call answers what it answered, a site returns what it returned, nothing is performed and no syscall is made; `turn.yield` panics in a replica, so a syscall no site covers is a stack trace; a call the recording did not make, or a digest that differs, is a divergence that names the fields. The headless replica steps over the presents it does not make, applying what the host told the core inside them. What the replicas found, fixed: - Render wrote core state. The view's geometry (wrap map, context rows, body layer rows) is File.geometry, a lazy cache keyed by a hash of what it is made of (revision, scroll, size, tags, tables read, context declarations, the session's view: wrap, layered context, row metrics, rect); the render makes it afresh, a step reading it makes it on demand (wrapAt, wrapRow, ensureCursorVisible). Context declarations, notice bands and the header's reveal are the step's (sync), the tables' reading the tick's (a first look of 4096 lines, a count, wherever it is asked; the rest a frame's clock budget a tick), and a view's paint-ahead is asked of the host as the frame is drawn rather than queued as an effect. - The clock: advance's wakes are the recording session's (a picture decoding or a fade adds no tick to a replica), as are the budgets of Places, Names and Tables (`tape.over`), a message's time of day (the stamp; msg_said_ms and the unattended expiry use the session clock), File.mtime, and the pump reads its clock whether or not it waits. - The host: the session directory (getcwd, asked once at init), $SHELL and its existence, $HOME for `~`, `Shell` naming one that is not there, a missing interpreter, a directory refused above, a deleted file, a pointer seen through a sliding pane (Pardes.pointerCell). - Worker handles (futures, the Io), the 9P server's state, the store file every window shares (a replica keeps its own in memory) and Recent read from it are authority-only; frames, animations and the render's caches local. Query rows' paints count apart from a view's. Terminals replay from their taped pty bytes and are digested as their active screen, cursor and scroll; kitty images are left out until phase 5's screen-state terminals. tagnav.golden: the header's caret reveal now runs every step, as a pane's does, not once per frame drawn, so after `g l B B` typed in one burst the bar stays scrolled as a human typing it sees it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/TerminalImages.zig')
0 files changed, 0 insertions, 0 deletions