<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pardes.git/src/memory.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-30T06:13:15Z</updated>
<entry>
<title>a replica client's join costs the session's step its mutable state alone: the dump leaves the blobs out (walk.zig `Dump.deferred`: a `.blob`'s texts of 4 KiB and up, noted where they go) and its terminals' emulators (a size: the first delta brings each), the client's writer thread writes the welcome and the dump with the blobs put back in place, and each blob is pinned until written (memory.zig `pin`: its free put off); the texts the session never digested are hashed first on a thread of their own (walk.zig `unhashed`, `makeWords`), the join waiting a boundary for them</title>
<updated>2026-10-30T06:13:15Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-30T05:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=c892cf0c3246b6c41f8f67810d360c5ea0ff66ef'/>
<id>urn:sha1:c892cf0c3246b6c41f8f67810d360c5ea0ff66ef</id>
<content type='text'>
The client is unchanged: what it reads is the dump `dumpBytes` makes, byte for byte (a test splices one and compares).
ReleaseFast, the session's worst boundary while three clients join one after another (`t2/join2.py`), before and after: typical (4.1 MB of files, 1 MB of scrollback, an 8.1 MB dump) 12.4 to 1.6 ms; big (38.6 MB, 8 MB, 76 MB) 51.3 to 1.5 ms; a 100 MB file open beside typical's (254 MB) 172.5 to 1.6 ms. Of the dump the step makes 113 to 122 KB.
PARDES_REPLICA_STATS says each join's time and the state's size.

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>phase 5 part A: the speculation and rollback engine, in one process: a walker copy put back where it was, replicas that apply their own input at once and take the authority's tape as the truth, and a harness of typists over delayed links</title>
<updated>2026-10-29T23:19:19Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-29T21:19:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=3b57a72becd6dd6700d996c9c5c000e1cb53e076'/>
<id>urn:sha1:3b57a72becd6dd6700d996c9c5c000e1cb53e076</id>
<content type='text'>
src/rollback.zig: the replica core's allocator (`Epoch`) knows every allocation, and while a copy is held puts off frees of what was there before and refuses to grow it in place, so what the core held stays where it was. The copy (`Copy`) is the digest's walk saving the bytes of every allocation it reaches, field by field (the derived caches and this process's own too: a safe build's free writes over what it frees, and the frame arena points at what the epoch then frees), but the queues a step drains and the frame statistics; a file's text, its line index and its undo snapshots are pinned instead (made anew at each edit, never written; now freed raw everywhere), checked unchanged in a safe build. Put back, each allocation's bytes go back over it, the epoch's allocations are freed and its put-off frees forgotten; let go, they are made. Tree-sitter's trees, the C heap's, are held the same way (syntax.held_trees).

src/replica.zig: an `Authority` records its core's every input to a tape in memory and hands each client's input back as a unit (origin, sequence number, its tape); a `Replica` applies its own input at once, as the authority will (update, then pump), recorded by its own tape (tape.zig's speculation mode), and for each unit in order drops its pending head when the authority recorded the same (inputs, host calls and answers: the fast path), else puts the copy back, replays the units since and this one (every digest checked) and applies its pending inputs again. A host call or a syscall stops a speculation: it is answered harmlessly, undone when it returns, and the input waits for the authority's answer; a clock or environment read is a guess the comparison checks; an emulator is the authority's (terminal.zig's writers stop a speculation; a safe build asserts none changed). The view's events (a resize, the pointer) wait. Messages are bytes: no transport yet.

Each client has a view of its own (src/views.zig): the authority goes into it before the client's input (`toView`, taped), the replica's speculation the same, and the copy walks the views not live too (`parked`, each pane's `pv`).

test/replicas.zig (`zig build replicas`): one authority and N replicas, a view each (`--shared` puts them in one), each client typing monkey.zig's mix at 50-200 ms over its own link (half the RTT plus 10% jitter, in order), the authority's pty echoing 2 ms later; gates: no replica diverges, every replica's digest is the authority's at quiescence; reported per RTT: inputs applied at once, stopped, waiting, fast paths, rollbacks (mispredicted, foreign), and what a speculative apply, a copy and a rollback cost. 3 clients x 100 inputs at 30, 80 and 207 ms: no divergence over 12 Debug seeds and 20 ReleaseFast ones with a filled heap; ReleaseFast p99 a speculative apply under 0.2 ms, a rollback under 1.6 ms. `zig build rollback-bench` times the real copy now (take, release, an edit, restore).

What the replicas found, fixed: a release build reads what the heap had where Debug's fill made two cores agree: `col_panes` and `restore_buf` digested undefined (zeroed now), `terminal.State.reply_dropped` never set at create, `Text.sels` and `PendingPipe.ranges` digested past their length (a walker `len` cuts a slice too). PARDES_REPLICA_FILL fills a replica's allocations to show what is left.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>FreeBSD: the tty pardes builds for it and runs there, terminals, 9P and the daemon included</title>
<updated>2026-10-29T16:11:16Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-29T15:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=6b89fed454fd56a3af4b576646538b45d3315146'/>
<id>urn:sha1:6b89fed454fd56a3af4b576646538b45d3315146</id>
<content type='text'>
Cross-compiled with -Dtarget=x86_64-freebsd.15.0 (15 ships libutil.so.10;
Zig's default 14.0 links .so.9) and run on the FreeBSD 15.1 box:
- 9p_io serves there: fstatat, not Linux's statx. madvise is Linux's.
- WINCH reaches the sigwait thread through a handler that does nothing:
  FreeBSD drops a signal ignored by default as it is sent.
- A dead terminal answers a write with ENXIO, which std does not expect: a
  Debug build traced it to stderr, that same terminal, and recursed until
  the stack ran out (a session whose ssh dropped hung). No tracing there.
- waitid's FreeBSD numbers and 64-bit id: a command pane's exit is seen.
- No /proc: a shell's directory and program by sysctl, ttyTaken by the
  foreground group, the foreground job's name by its program.
- File watching by FreeBSD 15's inotify.
- ghostty's kitty loader: off Linux a stat comes before a t=f open (a FIFO
  hung it); FreeBSD's shm_open refuses O_NONBLOCK.
- vaxis's test terminal has no read off Linux: no input thread for it.
- test-install: the test-build programs installed into &lt;prefix&gt;/test, to
  run where the build cannot.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Arenas are regions mapped once with a page bitmap under a DebugAllocator; the shells allocate from one too</title>
<updated>2026-10-23T20:11:12Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-23T20:11:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=ef0de36bf473f22d37cc885054bf4eed98bf275f'/>
<id>urn:sha1:ef0de36bf473f22d37cc885054bf4eed98bf275f</id>
<content type='text'>
Each arena (pardes, frame, lsp, tree_sitter, image, pdf and the new host)
maps its region once and tracks 4 KiB pages in a bitmap; a full region
spills to malloc and counts it. Freed runs of 64 KiB to 1 MiB go back at
once, the rest at memory.trim. In a release build init.gpa is
memory.host over libc's malloc. Measured against the old arenas: typing
in a 7.4 MB file 1.95 ms a key (was 2.0), a V8 Callstack page 142 MiB
(was 134) and 42 MiB after close (was 69).

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Callstack lists every caller and pages a tree too big for one query; memory bounds and resident-size fixes</title>
<updated>2026-10-23T20:10:58Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-23T20:10:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=0073d05329335dbb0eb85f5c3044e42805d144e5'/>
<id>urn:sha1:0073d05329335dbb0eb85f5c3044e42805d144e5</id>
<content type='text'>
Callstack walks while the server answers, counts on the message row past a
second, puts test callers last at each level, and ends a tree past one
query's memory (memory.limits.arena.lsp_query, a 256 MiB region taken and
given back per query) in a row whose Callstack shows the next page. Grep
reads whole files. New hard limits: undo text per file, image decode
pixels, the LSP snapshot of other open files, one paste. Safe builds no
longer fill worst-case buffers with 0xAA (memory.unfilled), big regions are
kept off transparent huge pages, and malloc_trim runs after big results.
Also: Look's git show pages into a +Diff, and dropped marks in File.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Build with Zig 0.17</title>
<updated>2026-10-22T13:03:15Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-10-21T17:35:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=bc3d18d27f9fc1155db7fac3946c4d38774f9e65'/>
<id>urn:sha1:bc3d18d27f9fc1155db7fac3946c4d38774f9e65</id>
<content type='text'>
ghostty, libvaxis and uucode move to ghostty's 0.17 pins, cloud9 to its 0.17
main, SDL to castholm's release-3.4.x (3.4.18), zstbi and tree-sitter to
forks with 0.17 build files (see build.zig.zon). A bare zig build copies the
binaries into ~/.local/bin (-Dhome-install=false leaves it out): 0.17 keeps
the prefix from build scripts. A terminal's edited copy goes when the program
clears the screen. tinywin.snap is gone; perf baselines are re-recorded.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>A selection holds up to 1024 ranges on the desktop, 64 on the board</title>
<updated>2026-10-01T03:12:15Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-09-28T19:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=7ce5d94b5d48b68c86d015060ebcabe63e299e1a'/>
<id>urn:sha1:7ce5d94b5d48b68c86d015060ebcabe63e299e1a</id>
<content type='text'>
The limit was 64 everywhere, which helix-golf's enumerate_and_align outgrows
(%s |\d+ makes 121 ranges). It is now memory.limits.selections, per platform,
and the counts that hold it are u16. The ranges stay inline in each Text, so a
pane grows by about 80 KiB on the desktop (three texts and the regex prompt's
snapshot); the Pane size budget in Terminal.zig moves from 128 to 160 KiB and
says why.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Record /log whether or not anyone reads it, with the editor's messages in it</title>
<updated>2026-10-01T03:12:14Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-09-27T20:41:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=542dd489149e33915d19878a277e23b3a9c0b070'/>
<id>urn:sha1:542dd489149e33915d19878a277e23b3a9c0b070</id>
<content type='text'>
/log is now one ring (64 KiB, 4 KiB on the board) that records new, del,
rename and save, and a msg line for everything the editor says. An open
freezes it, so cat log shows what happened lately and ends; writing
follow to that same open makes reads past it wait for newer records, and
a follower the ring outran reads lost N first.

The message log keeps the pane's serial, not its reusable slot.

A test now fails when the tree serves a file /README never mentions; it
caught pty/status, now documented along with typing through pty/data.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Keep the arena buffers out of Debug binaries</title>
<updated>2026-10-01T03:12:14Z</updated>
<author>
<name>Gabriel Schneider</name>
<email>gbrls@0x4200.cafe</email>
</author>
<published>2026-09-27T15:21:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x4200.cafe/pardes.git/commit/?id=9b8146a7df6270613ab48ba3df53e97a558d1ba4'/>
<id>urn:sha1:9b8146a7df6270613ab48ba3df53e97a558d1ba4</id>
<content type='text'>
The five arena buffers are zeroed globals instead of undefined fields, so a
Debug build keeps them in .bss rather than writing 160 MB of 0xAA filler
into every binary (Debug pardes 839 MB -&gt; 246 MB).

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