<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pardes.git/src/rollback.zig, branch macos</title>
<subtitle>Pardes</subtitle>
<id>https://git.0x4200.cafe/pardes.git/atom?h=macos</id>
<link rel='self' href='https://git.0x4200.cafe/pardes.git/atom?h=macos'/>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/'/>
<updated>2026-10-30T20:03:40Z</updated>
<entry>
<title>remote clients: a pointer's hit carries the place it was made on (Layer.Place, on the wire, version 17) and a step resolves it from that, never from this process's frame (`surface`, `.local`), which a session never draws for a client: a window's pointer over a tag diverged it at once (the user's `tape byte 119`, 15 rejoins in 25 s) and a click there aborted it; a replay that meets a site its tape lacks, or makes a syscall that is none, is a divergence that goes on harmless (poisonOf), not a panic, and a speculation that makes one waits (Tty's shell lookup, untaped, is a value site now, as Shell's was); a copy over a queue is refused, not asserted; a session's last client, while no one else watches it, leaves it its layout (leaveView, settled as closeView is), which its rejoin copies; a redial waits only after an Upgrade's `refused` (a divergence's redialled a gone session 20 s); a dying session shuts its clients' links before its trace, and an --attach client ends its ssh and socket whatever way it exits; a far join's hashing stops at a blob once its client is let go (its leave waits for it in the step); a confirmed speculation's state is checked against its unit's digest, and the trace gives a key's and a pointer's words; test/daemon.py: 200 far joins level, a window's pointer swept over tags and body, ssh stand-in clients refused and detached, a client of a killed session ending in 2 s; in-process tests for each</title>
<updated>2026-10-30T20:03:40Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T18:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=f2ede98aee0265e3506f5afd6039c70be7812767'/>
<id>urn:sha1:f2ede98aee0265e3506f5afd6039c70be7812767</id>
<content type='text'>
Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>views: a view drawn or read outside a step (a replica client's own while another is live) leaves the live view's slot and its panes' shares holding nothing, as unpark and drawOthers leave them</title>
<updated>2026-10-30T19:49:16Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T18:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=ac57e8c3a05cdd8f587b6faf47e7f9d2c4357dee'/>
<id>urn:sha1:ac57e8c3a05cdd8f587b6faf47e7f9d2c4357dee</id>
<content type='text'>
withParked parked the live view and copied it back, but left its slot (column tags' texts, a chord's argument, the presentation) and each pane's share (its selections) pointing at what the live fields own. A rollback copy walks every slot (src/rollback.zig): once the live view freed one of them and the heap gave the memory to another, the copy saved that and put its old bytes back over it, which `emptied` exists to prevent (the slot left as H5's hypothesis had it, in a path it did not name: Replica.draw and Replica.within).

Test (failing before): a view drawn outside a step leaves the live view's slot holding nothing a rollback could put old bytes back through.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>replica: what only the authority holds, a step reads off the tape (tape.authority): the store's closed panes and Recent, a script's hold on a pane's events, the 9P socket, the session's config directory and startup file; a replica's own are never read, and never put back by a rollback</title>
<updated>2026-10-30T19:49:16Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T18:15:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=5af775e9817395af39792cc609b832394d4a4fb8'/>
<id>urn:sha1:5af775e9817395af39792cc609b832394d4a4fb8</id>
<content type='text'>
The Panes picker's closed rows, Recent's rows, a closed pane brought back (a Look at @pN, a Panes row), a jump to a closed file and the +Jumps rows read `p.store` and `p.recent`, `.authority` state a replica keeps on its own: its store has no file, its Recent only what it replayed since it joined. The rows made of them went into digested state, so every client of a session diverged together after a Del (H4), every client that joined after one diverged at its first unit forever (H11: trackJump dropped a closed file's jumps at every step when Recent did not know the file), a client's Del of a file the session's Recent knew made the stat the session skipped (H12: noteClosed looked in Recent first), and a client on another machine read its own store (H13).

- tape.authority: poison, then a value read: the authority's answer is taped, a replay takes it, a speculation waits for it. One site, `.authority`.
- Readers through it: Query's Recent and closed-pane rows, Store.reopen's record, Pardes.recentByHash (jumps, +Jumps), mouse.reportRange's readers check (a script reading a pane's events takes a look or exec: `pane.fs.readers`, the 9P server's), Tty9p's socket check, Pardes.configDir and startupPath (ThemeFile, DumpThemes, Config, DumpConfig, an init file saved), DumpConfig's dump directory.
- trackJump no longer reads Recent at every step: a closed file's jump stays; the jump to it drops that file's entries when Recent has forgotten it, as when the file is gone.
- noteClosed asks the host (recentKeeps, a taped stat) before it looks in Recent: the same syscall on every side.
- The tty toggle, read on every key, is session state: Pardes.tty_toggle, from the options when the core is made, dumped.
- The rollback copy no longer saves `store` and `recent` (rollback.zig `unsaved`): their bytes put back pointed at lists the host's heap (recentGpa) had freed, which the epoch never holds. A speculated Del then a Panes listing read a freed name (H8, the segfault).

Tests, each failing before: a rollback leaves the store and Recent as a speculation left them; a replica joined after a pane closed has the session's jump to it, its Panes and Recent rows, asked by either (and the variant hunt's Recent written by another window); a replica's Del of a file its session's Recent knows asks the host what the session asked.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>replica clients over a socket: the session streams each its dump and every unit after it (replica.zig `Peers`, a writer and a reader thread a client, units at each step boundary, a client's input stepped there in its own view), and `pardes --attach=&lt;socket&gt;:&lt;name&gt;` and `--attach=&lt;host&gt;:&lt;name&gt;` (through `ssh -tt -L`) are a client in the tty host, its keys applied at once by its own replica and drawn by its own process</title>
<updated>2026-10-30T06:13:15Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-29T23:56:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=fdf74e199de7d0fc648f912875323f3dc920ffc2'/>
<id>urn:sha1:fdf74e199de7d0fc648f912875323f3dc920ffc2</id>
<content type='text'>
wire.zig version 15: welcome (the client's id and view, the dump's length, the session's UTC offset and digest), dump pieces, units (with the authority's clocks), terminal messages both ways, a check. A unit carries one digest, at its end (`unit_digests`).
The client: tty.zig `Shell.remote`, `feed` (a terminal's input to the replica and the session); the session's clock guessed from the last unit's (tape.zig `Guess`); a pump woken only by a client's post reads no new time (`mail_only`), and a unit of another's ending where the last ended leaves the speculation as it is (`neutral`); the rollback copy taken while idle (`Replica.ready`); views a frontend here does not draw left undrawn.
A lagging client never holds the session: its queue is cut off past 64 MiB (PARDES_REPLICA_LAG_KB). Detach in a client ends that client; a Restore lets every client go.
daemon.zig: a replica the daemon hands over is the session's loop's (a note), not a stub thread's. A window session refuses one in words.
test/daemon.py `--clients`: two clients (one through the delay relay) type into a detached session and agree with it, one killed outright, one detached, a third typing into a shell.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>replicas' core for a socket: a client's input settles as a `step` (no clock, no wait, no frame) on both sides, every kind of input speculated, the session's clock guessed, views no frontend here draws left undrawn, and a drawn view's selections given back to its slot</title>
<updated>2026-10-30T05:12:12Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-29T23:56:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=57aa8d2f9ae851fa9806abbd1fd04abf1fd2b57f'/>
<id>urn:sha1:57aa8d2f9ae851fa9806abbd1fd04abf1fd2b57f</id>
<content type='text'>
pardes.zig: `step`, the middle of a pump, is a client input's own top-level input on the authority and in the replica's speculation, so the two tapes read alike; a pump skips the live view when it is `undrawn` (a replica client's, drawn by its own process); `settle` is the pump's whole middle, the Upgrade's too.
tape.zig: a `.step` input; `unattended` is a watched field; a speculation's clock reads answer a guess of the session's clocks (`Guess`); `resync` says the host and its writes again for a joiner; `adoptCore`; a short ret is shown in a trace.
views.zig: `drawOne` draws a replica client's own view between steps; `drawParked` gives a drawn view's selections back to its slot, for drawOthers too.
rollback.zig: std's lists by walk.isList (a safe build's have a third field).

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>echo: a replica draws a key typed into a terminal at once, mosh's way (a printable character at the cursor, Backspace, Left and Right, in tty mode on the primary screen), from an overlay of its own that no digest, dump or rollback copy sees, painted over the terminal's body at the end of renderBody (the tty's and the GUI's); judged at each delta once the authority has the key and 50 ms have passed, every prediction taken back on a mismatch; drawn at once at a prompt pardes's marks vouch for, elsewhere only once an echo was confirmed, never after a drawn misprediction until one is, so a password prompt or a program that ignores input shows nothing typed; the keys typed behind one not predicted (Tab, Enter) predicted over the screen that shows its doing; zig build replicas -- --echo types a corpus into a played shell at 30/80/207 ms: a key to its character p50 239 -&gt; 8.9 ms and p90 248 -&gt; 15.8 ms at 207, no wrong character drawn; docs/next-daemon.md: the decisions, the hook for the remote client, the numbers, the gates and what is not done</title>
<updated>2026-10-30T05:10:05Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T04:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=3703c2526fb59708b00e12816bd88ffd8a15fc69'/>
<id>urn:sha1:3703c2526fb59708b00e12816bd88ffd8a15fc69</id>
<content type='text'>
Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>the walker's digest: a blob's hash made once and folded in as a word (a 100 MB file was 5 ms a digest, two a unit, on the authority); blob fields annotated `.blob`, which the rollback copy's pins read too</title>
<updated>2026-10-30T03:53:24Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T03:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=f264dbc4a646da695331fe7401fa013cbb720b6a'/>
<id>urn:sha1:f264dbc4a646da695331fe7401fa013cbb720b6a</id>
<content type='text'>
walk.zig: a field named in a type's `replica.blob` (a file's text, line index and location rows, an undo snapshot's text, a register's values and joined text, the rows an edit dropped, a query's saved rows) holds immutable blobs. A digest hashes one of 4 KiB or more once, keeps the word by its address and length, and folds the length and word in; `forget` drops the word, from memory.freeRaw and freeUnfilled, through which every such blob is freed raw. Only a Debug build (the tests, the harness, replay) hashes the bytes at every digest all the same and panics where the kept word is not their hash: a blob written in place, or freed past its word. A release build, ReleaseSafe the user's own as well as ReleaseFast, takes the word and never panics on a stale one: at worst a divergence, which a replica records and then stops at (nothing resets or rejoins it yet; the notes say so). File.zig: an edit's free of the old text went to `rawFree` itself and so kept its word; the next text of the same length at the same address folded in the old one (the ReleaseFast harness diverged in 162 of 180 replica runs, in `file.content`), and it goes through freeUnfilled now. Registers.zig: `put` makes a new values array rather than writing the old one. rollback.zig: the copy pins what `.blob` names (`pinned` and `pinnedDeep` gone).

Measured, ReleaseFast on the perf cores: with a 100 MB file open (PARDES_DIGEST_BENCH=100, replica.zig's bench), a unit of a key into it went from p50 10.45 ms, p99 41.6 ms to p50 24 us, p99 6.1 ms (the first, which makes the word), a digest from 5.18 ms to 10 us. The harness (20 seeds x 120 inputs x 3 clients): rollback p99 9.5 -&gt; 2.6 ms at 30 ms (1.5 and 1.4 ms at 80 and 207), copy p99 0.27 ms; none diverged, none unequal, no delta wrong. Tests: a blob hashed once, its kept word no longer its hash once written in place, its word gone when freed. docs/next-daemon.md: the follow-up.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>views and the rollback copy: a live view's slot keeps no pointer into what the live core owns; a register's texts and a file's location rows are pinned, not copied</title>
<updated>2026-10-30T02:59:54Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T02:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=bce88593014a4078dc9259855944f9ddbc19fe54'/>
<id>urn:sha1:bce88593014a4078dc9259855944f9ddbc19fe54</id>
<content type='text'>
views.zig: when a view goes live (to, close, drawOthers putting the live one back, only), its parked share is emptied (`emptied`): it was left holding copies of the pointers it handed the live fields (a column tag's text, a chord's argument, the presentation's), stale until it parked again. The rollback copy walks every slot: a stale pointer whose memory the live view had freed and another taken saved that other's bytes and put them back. A pane's share holds no pointer but its selections, which `unpark` already hands over. The test fails without it: a tag's text freed under view 0's stale slot, its memory taken by an allocation the copy has no business with, written under a held copy, and the copy put back.

Registers.zig, locations.zig, rollback.zig: a register's values and joined text, and a file's location rows (the dropped ones, a query's saved), are replaced whole and never written, so the copy pins them as it does a file's text, freed raw (a safe build's free would write over one a copy still holds); rows pin whole with what each owns (`pinnedDeep`). In the harness at 30 ms the big copies were a file's location rows, 5-6 MB after the flood, not the register. ReleaseFast, 20 seeds, three clients, p99: copy 5.1 -&gt; 0.22 ms at 30 ms (0.19-0.20 at 80 and 207); rollback 14.9 -&gt; 9.5 ms at 30 ms (1.3-1.4 at 80 and 207), what is left being the replay's digests (half the harness's CPU is Wyhash over the whole core per replayed unit). Tests: a 2 MB register and 500 location rows pinned, not saved, and whole after a speculation drops them and the copy is put back. docs/next-daemon.md: the follow-ups.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>screen-state replicas: a replica's emulators on the C heap, outside its rollback epoch, so a delta written under a held copy is no copy's to keep or put back (a ReleaseFast run found the heap corrupted)</title>
<updated>2026-10-30T01:30:29Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T01:01:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=77c4a6e346e08538abc410f85a86bec7e8dbedb3'/>
<id>urn:sha1:77c4a6e346e08538abc410f85a86bec7e8dbedb3</id>
<content type='text'>
terminal.zig: State.gpa, what an emulator and its State are allocated with: the core's, but on a screen-state replica the C heap (emulator_gpa). replica.zig applies deltas and rows with it; the epoch's pause is gone (rollback.zig back to part A's but for the rows cache).

The harness in ReleaseFast corrupted the heap after 20 seeds: a safe build's check named an allocation the copy saved and a delta freed while the epoch was paused, reached as `Text.own` through a view's stale slot (views.zig keeps the live view's parked share as stale copies, and the copy walks it), the replica's old terminal's pin map at that address. With the emulator outside the epoch, nothing of it is saved, kept or put back, and every free under a held copy is put off again, as in part A. Debug, 20 seeds at 80 ms and the defaults: no divergence, every replica and terminal the authority's.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>screen-state replicas: what a terminal's ingest tells the positions pardes keeps over it taped, the history a step reads sent before its unit, rows sent a blob once a message, and the rows cache out of the rollback copy</title>
<updated>2026-10-30T00:45:19Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T00:45:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=473bbaa838f290e932992ef625be2fdc05c952dc'/>
<id>urn:sha1:473bbaa838f290e932992ef625be2fdc05c952dc</id>
<content type='text'>
terminal.zig, tape.zig: ingestWithPositions tracks its rows only where an ingest happens; what the ingest told them (each tracked row's row after it and whether it was erased, a clear, whether the pages lived, a pin not made) is a taped value (Site.positions), which a screen-state replica, ingesting nothing, takes; the logic after it runs alike on both. On the stack, so the local path allocates nothing new. buildRows marks a terminal read (State.read) outside the render (terminal.drawing).

screen_state.zig, replica.zig: the authority keeps each peer's holes as its replica does (Peer.holes, from the deltas it sent), and Screens.fill sends a peer the rows it lacks of every terminal a step read, after the step and before its unit, so a replay reads what the step read (a text-mode cursor moved into history the flood scrolled past diverged). encodeRows sends each distinct blob once a message and the rows as addresses (a fill after yes is a third). The rows cache is dropped when a copy is taken and emptied when it is put back, not saved.

test/replicas.zig: Ctrl-b in the mix (a shell out of tty mode: text, cursors and selections over it), and a shell's session (prompts, titles, directories, clears) between the TUI and the flood. 4 seeds x 120 inputs x 3 clients at 30, 80, 207 ms: no divergence, every replica and terminal the authority's, 4,653 deltas checked.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
