summaryrefslogtreecommitdiff
path: root/src/File.zig
Commit message (Collapse)AuthorAge
* idioms #20, the bound in the type or the cut handled: of the 166 `catch ↵Gabriel Schneider11 days
| | | | | | | unreachable` the pass kept, 64 stay where a reader checks the bound without arithmetic (an integer's digits, a declared field's size, and now the daemon's pid lists and the clock's two-digit fields written in their types), 69 texts print through Kind.Buf at their old size, 31 handle the failure once (a print into ename cut at its 320, paneText's line cut where its buffer fills, a log record or mouse report dropped rather than cut short, the question's letters that fit), Newcol's and pane/new's refusals are comptime strings, and dropUnsaved's too-long scratch name is null, not an empty sentinel Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* idioms #19, unreachable only where the type bounds it: the prints that carry ↵Gabriel Schneider11 days
| | | | | | | a path, a name, a miss or a reason (Core's shell and Dump words, colors' theme file, look's misses and refusals) cut through Kind.Buf at their old size, the header texts flatSurface could still fail on and colors' putName handle the failure again, and every kept site (integers, a same-statement cut into a [K + room] buffer, the hashing and discarding writers) says its bound on its line Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* idioms #16, edits fail by name: the edit operations return edit.Error ↵Gabriel Schneider11 days
| | | | | | | (memory, or a terminal's rows not read) and try where they caught and returned, so the key, chord or paste that ran one says the failure (`edit: out of memory`, reportError) where it did nothing; look, Core, File and terminal say theirs the same way, and the prints whose buffer provably fits catch unreachable with why Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* client #1, the views indexed: a view's share of the session is Pardes.View ↵Gabriel Schneider12 days
| | | | | | | (the ~42 fields views.fields named: size, cell metrics, columns, rects, focus, jumps, pointer, gestures, prefixes, frontend), one of Pardes.views[4] (null when closed), the live one views[live] through Pardes.view() (index field `view` renamed `live`); going into another view is the index plus the panes' shares, which stay swapped (park and unpark now move only Pane.pv); views.zig loses fields, Part over Pardes, Parked, kept, emptied and the session half of every copy, and a pane closing leaves every view's layout at once (views.gone, at the two places a slot is freed) instead of the serials each parked view kept; drawOne and within put the drawn view's own share back whole; the views are in the digest now (tape's per-field parts name views[k].field), so a fresh view's col_x/col_w default to zeros, not undefined; the dump keeps every open view in the core and the panes' shares of the others under `shares`; an image from before (live view as the core's own fields, the rest under `views`) loads them into views[] once; the ~2,400 references rewritten mechanically from the compiler's errors (p.active is p.view().active, `const v = p.view()` hoisted in 823 places), Kind.zig (4 lines) and addon_test.zig (3) among them, macos.zig by pattern (not compiled here); tape's watched host writes read the live view's frontend and active; perf.zig's accessor lines change its harness hash, the debug baselines re-keyed to it (their numbers the base's); no golden changes; gates: core-test 956/956 both, unit-test 1487/1488 tui and 1530/1531 gui, behaviour-test 248/248 both, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed tui, replicas ok Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* settings #2, five presentation variants go, each now the style it had by ↵Gabriel Schneider12 days
| | | | | | | default: Colors (text panes and terminals coloured, with SPC t c), TreeContextTagStyle (TreeContext rows in the tag's style), FocusTint (the focused tags tinted), SyntaxBold (keywords not bold) and Ligatures (the window shapes them; gui.zig's syncLigatures and the words' ligatures flag go, and Capabilities.ligatures); the reads deleted are in File.zig, body_layer.zig, Tables.zig, exec.zig's applySettingBuiltin, Core.zig (SessionView.layered left at its default), draw.zig, surface.zig's comment and gui.zig; deleted tests: "settings: Colors off draws a source plain, and on again colours its keywords", "Ligatures is a setting only in the shell that shapes text" and "Ligatures off draws a ligature as its cells' own glyphs, and on shapes it again", and the toggled half of TreeContext's Core test; rewritten through what stays: SyntaxBold's every-row test as keywords coloured in every row, the tag-click tests on JumpTrail, the tag-name tint tests with the focused tag's ink plain, Core's tab test by the keyword's ink; golden changes, each the cut's: syntax, theme, mini and ninep lose their Colors toggles and frames (the message row after them names the builtin before, Mini), and leader, ttyhelp and builtins' Help listing is four columns narrower, TreeContextTagStyle having been its longest word; perf.zig's harness id moves again; the window scenes from 09 on take new gui-goldens lines, the scene no longer writing FocusTint on and its word gone from the message row (the base window build running the same scenes gives the same frames); gates on tui: core-test 965/965, behaviour-test 242/242, unit-test 1482/1483, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1526/1527, gui-golden 0 of 1 failed Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* settings #1, Tagbottom goes, a pane's tag at its head the one value anyone ↵Gabriel Schneider12 days
| | | | | | | used: layout.bodyTop and tagTop, mouse's seam and clampBorderRow, applyRowSplit, body_layer's copy and the tests' row arithmetic lose their other arm (reads deleted in Core.zig, layout.zig, mouse.zig, draw.zig, gui.zig, macos.zig, whose ABI slot 11 says 0 now, and ninep/events.zig, ninep/tree.zig, look.zig, Messages.zig), with the registry row, SPC t b, Help, /commands, the builtins JSON and the reference row; deleted: the snapshot scripts tagbottom, tagbottomshort and tagbottomimage with their goldens, the behaviour test "placement: under Tagbottom a look from a pane's text goes under its text too", the window scene 10-tagbottom with its gui-goldens line and the macOS parity check tags-bottom; tests that ran both ends of the tag run the head; a dump that kept the field loads without it; perf.zig's harness id moves in the two debug baselines (its reads of the field went); the window scenes after 10-tagbottom (12 to 15, 17) take new gui-goldens lines, the two Tagbottom writes gone from the scene and with them their words on the message row (the base window build running the same scenes gives the same frames); gates on tui: core-test 966/966, behaviour-test 243/243, unit-test 1484/1485, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1529/1530, gui-golden 0 of 1 failed Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* digest: a blob of 4 KiB and up (a file's text, a register's text, a file's ↵Gabriel Schneider12 days
| | | | | | | rows, an undo entry's bytes) is taken as its length, never its bytes, a text's revision saying what it holds, where it was hashed once and kept as a word by its address (walk.zig's blob words, from when no text was written in place): since the journal a session's edit writes its text in place, and since the change before a replica's does too, so the word went at every edit and the next unit's digest hashed the whole text again, 100 MB of it in a big file, on the session's step and the replica's; the words go with what kept them (walk.forget, wordOf, forgetAll, unhashed, makeWords, the bench's blob_words_on, memory.freeRaw's and unpin's forgets, File.edit's and grow's), and so does the join's hashing thread (replica.Peers' held, texts, hasher and rounds, joins, hashTexts, unhashedDone, the `hashed` note), which made the words of the texts a session never digested before a join's digest took them, its pins with it: a client is joined at the boundary its connection comes at; the semantics change, so the wire's version is 20 (a client of the build before is refused at its hello, as any other build's, and test/daemon.py's own hello says 20); a blob under 4 KiB is hashed whole as before, so a small text's bytes stay in the digest, and the replicas harness (test/replicas.zig) compares every file's text byte for byte at quiescence beside the digest; tests: walk.zig's 'a blob is hashed once and folded in as a word; one written in place is not its word, which a Debug build checks; a freed one's word goes' becomes 'a blob of 4 KiB and up is digested by its length, what it holds told by its keeper's revision; a smaller one by its bytes' Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* rollback: a replica's core writes a file's text and its line index in place, ↵Gabriel Schneider12 days
| | | | | | | as the session's does, and its rollback copy keeps none of their bytes: the epoch notes what each write into a text or an index that was there when the copy was taken took out (rollback.Epoch.wrote, from File.edit and shiftIndex), and putting the copy back writes that back, the newest first, before the saved bytes go back (unwrite), where a replica's edit made a whole new text and a whole new index at every key so that the copy could pin the old ones; the bridge the journal left for this goes with it: rollback.isEpoch, File.keepsBytes (a text a join is still sending is copied on write as before, memory.isPinned), the replica's copy-on-write in File.edit and shiftIndex's `keep` (its in-place shift is File.shiftStarts, which the rollback runs turned round); the journal's steps, its `done` and its entries come back as the copy saved them, an entry a speculation merged into and the redo entries it dropped being saved bytes and put-off frees; File.State's content and line_starts are annotated `.journal`, which the copy neither saves nor pins (line_starts leaves `.blob`); a write that could not be noted (no memory) fails the replica at its rollback; tests: rollback.zig's 'a text written in place under a copy comes back byte for byte: typed into its room, undone, cut, and grown past it' is new, and File.zig's 'a line index shifted in place equals a rebuilt one' becomes '..., and the edit turned round gives the one before back' (its every tenth shift made anew, as a replica's core made them, gives way to the shift turned round in a copy, as a rollback makes it) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* text journal, a text replaced whole is swapped, not copied (the architect's ↵Gabriel Schneider12 days
| | | | | | | 15.3): an edit that takes out most of a text and at least 64 KiB of it (Get, Edit's e, a Restore, a 9P > body write, a delete of everything) gives the old buffer to the journal by pointer (Text.Journal.swap, an Entry with swap set and its buffer's room, a derived field) where it copied what it took out, and puts the rest in a new buffer; its undo swaps the buffers back, a step that began with a swap (a > and the writes after it) folding into one swap the other way (Journal.fold), so neither the edit, its undo nor its redo copies the old text; the 64 MiB bound counts copied bytes only, and a text keeps two swaps: a third drops the steps before the older, said in the pane's message row ('undo keeps the last two texts replaced whole: the steps before them are gone'); tests: 'a text replaced whole keeps its old buffer for its undo, swapped back and forth, two at most' is new, and 'undo keeps its steps within a byte bound, the newest always' takes out middles under half the text, so what it bounds are copies Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* text journal, a grown text's old buffer given back: a text whose room grows ↵Gabriel Schneider12 days
| | | | | | | by a copy frees a buffer of a megabyte or more, which an arena keeps resident for the next block its size; memory.trim gives its pages back at once, as a big pane torn down does (a detached session on a 100 MB file, Debug: after typing, twelve 9P edits, undo, redo and a 10 MB cut, 157-166 MB resident where the journal alone left 329 and the snapshots 730; the peak while the copy is made, 328 MB, stays) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* text journal, the step boundaries pinned through the 9P tree: the undo ring ↵Gabriel Schneider12 days
| | | | | | | keeps a long session's last 256 steps (300 appends, each its own open, undone back to the 44th and no further, then redone whole), the writes between mark 0 and mark 1 are one step, an open's data writes one step and the next open's another, a key typed at three ranges one step whose undo puts the three back (test/behaviour/flags.zig, four new tests); and in File.zig a walk back and forth through 80 steps of random edits, most where the last ended so their entries join, every step's text met again both ways (one new test) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* text journal, the ring and undo over it: a file's undo is the journal of its ↵Gabriel Schneider12 days
| | | | | | | edits (Text.Journal: entries of an offset, the bytes taken out and the count put in, grouped in steps between marks, each step with the place it began at and the place it was undone from), bounded at 256 steps or 64 MiB, the newest kept; pushUndo marks a step (none when the last changed nothing, as a snapshot equal to the text was none) and every edit goes into the last step, joined to its last entry when they touch (typing on, backspace over it, a write going on where the last ended); undo and redo turn a step's entries round, one in place, several in a copy whose gap moves from one to the next (File.Gap), one edit and one revision as the snapshot's was; the snapshots go (File.Snapshot, the undo and redo arrays and their copies of the whole text at every step); the replica's copy pins an entry's bytes (Entry.removed, a blob) as it pinned a snapshot's; tests: 'undo keeps its steps within a byte bound, the newest always' reads the journal, 'file history owns bounded snapshot storage without per-edit bookkeeping allocations' becomes 'file history keeps its last undo_max steps, and an undo or redo with no memory changes nothing', the far join's blob test makes its two blobs beside the text with a delete and a yank (its history held whole texts before), and the counts of steps read history.journal.done Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* text journal, the primitive: File.replace(off, len, bytes) puts an edit in ↵Gabriel Schneider12 days
| | | | | | | the text's own buffer (its tail moved with @memmove), the buffer grown by an eighth when it must be (State.cap), and moves its line index in place from the edit on (shiftIndex, State.line_cap), so a key, a backspace and a 9P write cost their bytes and what follows them, never a copy of the text (on the 50k-line file, Debug, medians against the base run beside it: edit-char 1105 -> 420 us, edit-twin 930 -> 433, body-2m 8.6 -> 4.7 ms, body-appends 173 -> 79 ms); setContent is the same edit with the caller's whole new text taken as the buffer; a replica's core (its allocator an epoch's, rollback.isEpoch) and a text a join still sends (memory.isPinned) keep their bytes, the edit putting a new buffer in their place as every edit did, so the rollback copy, its pins and the join's blobs work as they were; a pane's event readers hear an edit's span found from the edit (events.editSpan), the one diffSpan found from two texts; tests: 'edited line index equals a rebuilt one' becomes 'a line index shifted in place equals a rebuilt one' (editedLineStarts goes), 'an edit's span is where the texts before and after it differ' is new, and the panes test of history storage counts one allocation less for a redo (the index moves in place) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* targets: the ESP32-P4 board port goes (src/esp32p4*.zig and src/esp32p4/, ↵Gabriel Schneider12 days
| | | | | | | -Dplatform=esp32p4 with its pinned riscv32 target, -Desp32p4-cols and -rows, the Peek, Poke, Hexdump and Gpio words and the Board behind them, the board's 9P engine options, the gpio_toggle host slot), and with it every guard and limit only the board needed: terminal_panes and terminal.enabled (ghostty is in every build), memory.limits' board branching (the desktop values stay), MAX_PANES 64 and MAX_COLS 16 fixed, the board's boot buffer and its embedded boot, the pager's and the terminal's emulator-less paths; tests: the board's GPIO, ring and Board ones go, the boot-OOM and transition-grid ones stay under their own names; the perf harness loses the board's fixture, so the Debug baselines of both frontends are recorded again (--only medium --reps 10) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Text, edit, normal, look, Query and their readers: the second selection form ↵Gabriel Schneider13 days
| | | | | | | msel (whole rows r0..r1, for search-result highlights) goes; a visited search result and a query preview's place line are an explicit vsel like any other, back from the line's end (to the result's location start, the line's start for ordinary path:line rows; to the start for a preview line), and every msel branch in the edit ops, the drawing, the terminal's position tracking and the chords goes (visible: the result's highlight covers its line's characters and newline cell instead of the whole row width, with the ordinary selection colours; y, d and c on it act on that range as after x, its newline included, so a yanked result pastes as a line); selections.md and the ; Alt-; X Alt-x rows of helix-keys.md no longer describe msel; Text's walked shape changes (wire semantics) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File: a +Pager's text is told a diff by diff.looksLikeDiff, the one ↵Gabriel Schneider13 days
| | | | | | | heuristic command panes use (a diff --git line, or a ---/+++ pair over a valid @@ hunk, in the first 200 lines), not by a second one of its own (visible: a pager text with a diff line but no unified hunk, or ---/+++/@@ lines apart, is no longer shown as a diff) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File, edit: dropped marks go: an edit frees the location rows and pager ↵Gabriel Schneider13 days
| | | | | | | colours it drops, and an undo back to the same text no longer brings them back (visible: a +Pager or a results buffer undone to its text is shown plain); the pager test in ninep/ctl says so and Stream's no longer asks for the field; File.State's walked shape changes (wire semantics) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File, terminal, edit: undo and redo are one undoStep(back) each, as ↵Gabriel Schneider13 days
| | | | | | | Text.step already is, and their callers (normal, builtins, edit_cmd, file_watch, ninep/ctl's pager test, test/panes) say which way Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File: recolorSyntax paints a grapheme's cells in one loop (syntax colour, a ↵Gabriel Schneider13 days
| | | | | | | diff's emphasis ground, a result's emphasis, a pager's colours, in that order) instead of four loops over the same cells Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* normal, modal, File, edit: small ones: tryFind inlined (its clamp never ↵Gabriel Schneider13 days
| | | | | | | bound), the smart-case haystack is allocLowerString, the two WordTargets nothing produces go, File.lineCount is modal.cursorLineCount's alias, and pasteRegister and ClipRequest share one Paste enum Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* File: the four anonymous usize comparators handed to std.sort.upperBound are ↵Gabriel Schneider13 days
| | | | | | | one ascending fn Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* memory: freeUnfilled, freeRaw for a slice of u8 written out again, goes; its ↵Gabriel Schneider13 days
| | | | | | | callers (File.zig's three, walk.zig's, memory.zig's tests) call freeRaw, and walk.zig's comments name it alone Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* the walker's digest: a blob's hash made once and folded in as a word (a 100 ↵Gabriel Schneider2026-10-30
| | | | | | | | | | 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 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 -> 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 <[email protected]>
* dump: one walker dump of the whole session, by name across builds, for ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | Restore, -l, Handover and the store; dump.zig's hand-written schema gone A dump is walk.zig's walk of the core with a table of every type it reaches (fields, enum and union names, number widths), read back by name; terminals are ghostty's snapshot (screens, history, kitty images); a failed load frees what it made. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* phase 5 part A: the speculation and rollback engine, in one process: a ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | 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 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 <[email protected]>
* views: several clients on one session, each its own layout, focus, cursors ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | and scroll over the panes they share; a second `pardes --attach` draws on its own terminal beside the first, and `pardes-gui --attach` opens another window The core still sees one view, the live one, in the fields it always had (src/views.zig): a view's share of the session (`views.fields`: its screen, columns, rects, focus, pointer and gestures, jumps, key prefixes, column tags, presentation and animations, windowed and native_images) and of each pane (`PaneView`: its place in the layout, which text has the keyboard, the body's cursor, selections and mode, its scroll, a document's size, what the step measured of it) is copied out when another view goes live and back when it is live again. One view never parks: the single client pays a test of one byte a step. `toView`, `openView` and `closeView` are taped inputs; the pump draws each other view by going into it and back, which leaves every digested field as it was, so the replica that draws nothing skips it. A parked view is in no digest (its slot is written whenever it goes out); what drawing it made of its own (animations, presentation) is kept, whatever its unpark brought inside a changed text is done again when it is next live. Shared: the panes' text, terminals, tags, prompts, messages, registers (yanked in one view, put in another), the workspace tag and settings. A terminal shown at two sizes takes the size of the view that typed into it last (`Pane.sized_by`), and any view's once that one is gone; the others show it at that size. A text edited in one view moves the other views' cursors and scroll with the splice, as a Zerox twin's (File.ParkedPlaces). A pane closed in one view leaves the others' layouts (by its slot's serial); a pane focused in a view that does not show it is placed in its active column (views.show). tty: each terminal is a Screen of its own (its vaxis, input reader, frame answer, kitty images and shm probe, glide, trail and flash); its input reaches the loop as its view's (a `from` ahead of it when another terminal posted last, so one terminal posts none). A SIGWINCH asks every terminal its size; a SIGHUP asks each whether it hung up or lost its stub. Detach, or a terminal's end, with other views left closes only that view, its stub told `d`; the session's end tells every stub. daemon.zig: an attach names an attached session too (or the only one there is when none is detached). gui: the Gui holds the live window's share of itself (window_fields: the SDL window and its presenting, scroll, glide, scene and post chain, pointer, blink, captures); the others wait in Shell.windows, swapped in (`follow`) as the core's live view changes, and each SDL event first takes its window's view live (`route`). Closing a window while others stay closes its view. Harnesses: `start <rows> <cols> views=N` in a snapshot script gives the app N-1 more terminals (PARDES_TEST_VIEWS, opened as attached ones), `view <k>` types into and captures terminal k, every wait reads them all; `pardes-monkey --views=N` switches among N; `zig build replay` runs its seeds at three views too. views.snap pins two terminals: an edit seen in both, a scroll in one, a line yanked in one and put in the other, Newcol in one, Detach in one. Unit tests: own cursor, scroll, mode, layout and focus; edits shared; registers shared; terminal size by last typist; closing views; drawing the others leaves the digest; a view keeps its place in a text another edits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* tape: every input the core consumes recorded in turn order, replayed into ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | | | 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]>
* a row's last byte deep in a long line is found walking to its column only: ↵Gabriel Schneider2026-10-29
| | | | | | | | | | | | | | | | | | rawAtDisplay no longer measures the rest of the line first File.rawAtDisplay took the display width of the whole rest of the line before walking to the column, so every byteAtRowDisplay on a row of a 2 MB line measured 2 MB: a selection whose head is deep in such a line, with the line's first rows in view, drew in 20 ms (Debug) instead of 0.1. Only a line that ends before the column is measured whole now, and it is short. Same answers, at the end and past it included (the test). The perf gate's deep-sel cell had never drawn that line: its view, set by ensureCursorVisible from the last frame's wrap map, stopped six lines short of it. With the map made for the view as it is (File.geometry, next commit) the line is in view and the walk showed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* anim 7: what the probe found: the paced wait spins (asleep, the CPU's clock ↵Gabriel Schneider2026-10-24
| | | | fell and an input's frame took 2-5x as long), a glide measures the core's line count first and emits only the rows it shows, a far jump paints only its view, a long line 16 KB round the caret, the caret's sideways scroll measured from the view's edge, a paint never joined on the loop nor asked while the view stands still, rewritten generated panes do not glide, pictures decode off the loop
* anim 5: a scroll's colours are painted ahead on a worker ↵Gabriel Schneider2026-10-24
| | | | (Stream.paintAhead), two views on the way it goes, so a page after a page parses nothing on the frame
* Tables 4/4: a delimiter cell's colons kept at its edges; a wide table shown ↵Gabriel Schneider2026-10-24
| | | | as source in a wrapping pane, tested; docs/next-tables.md, the design as built, the numbers and the open questions
* Tables 2/3: the look, a table's pipes drawn as rules, its delimiter row one ↵Gabriel Schneider2026-10-24
| | | | rule with its colons kept, its header bold on the tag's ground (glyphs and colours on the cells there, nothing moved); the GUI draws light box-drawing rules edge to edge so they join across rows
* Tables 1/3: a markdown file's pipe tables laid out in their rows, cells ↵Gabriel Schneider2026-10-24
| | | | padded with virtual width before a byte (a tab's extra cells, not a parallel map): File.rowPads under displayOffset/displayEndOffset/byteAtRowDisplay, fillBody, recolorSyntax, the pointer sweep, j/k; tree-sitter-markdown as the detector's oracle
* Search converge 7/6: a script's Grep or Find that misses opens nothing, a ↵Gabriel Schneider2026-10-24
| | | | dumped query pane restores as plain text; fs.py's Recent and canary to the query pane
* Search converge 3/6: the query pane, line 1 the query and its first word the ↵Gabriel Schneider2026-10-24
| | | | source, rows made live like Callstack's, the owner's places showing the set, a +Preview promoted in place, Enter freezes, Esc restores
* Search converge 2/6: a pane's places, every match or listed place tinted and ↵Gabriel Schneider2026-10-24
| | | | ticked on the rail, n/N stepping them silently, shifted by an edit rather than searched again
* Audit (misc): std mkdir -p and JSON escaping, a 9P late failure's errno from ↵Gabriel Schneider2026-10-23
| | | | | | ctl.failureErrno, dead switches and dumpHex out Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Audit (colours, drawing): one Surface.tint, shared colour maths, the helix ↵Gabriel Schneider2026-10-23
| | | | | | | | | copies of hand-ported themes removed The 22 <name>_helix themes that duplicate a hand-written port are gone; monokai, ayu_dark and nord stay, since others inherit from them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Callstack lists every caller and pages a tree too big for one query; memory ↵Gabriel Schneider2026-10-23
| | | | | | | | | | | | | | | | bounds and resident-size fixes 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 <[email protected]>
* zig fmt for Zig 0.17Gabriel Schneider2026-10-22
|
* Add a readable static Callstack pane and align tagline textGabriel Schneider2026-10-22
|
* Def and Refs in a language-served file's tag, a diff viewer's tinted word ↵Gabriel Schneider2026-10-22
| | | | | | | | | | edits, context rows that hold still under a scroll, and the pardes skill Def and Refs (gd, gr, Ctrl-click; chorded 2-1 at the selection) for a file a language server speaks for; hunks.zig stacks a unified diff as a diff viewer does, its changed words on a tinted ground as delta's do; the tree-sitter context rows stay put while the body glides under a scroll; .agents/skills gains the pardes skill beside pardes-9p.
* A file whose disk text is what its unsaved pane was read or saved as is no ↵Gabriel Schneider2026-10-01
| | | | | | change on disk: an Undo back across Get file or Edit's e to unsaved edits no longer says the file changed, and Save writes it Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An undo step keeps no copy of the name: History keeps each name once, at the ↵Gabriel Schneider2026-10-01
| | | | | | rename that ends it, and a step its generation, so typing allocates a snapshot and nothing more (follows prwqwwxt); a rename of one Zerox twin is logged for each twin Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Zerox twins survive a Dump and Restore: their text is dumped once, in the ↵Gabriel Schneider2026-10-01
| | | | | | first, each other twin names it (twin_of), and Restore puts them back on one buffer with their dots Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Undo after Get file or Edit's e puts the old name back with the old text and ↵Gabriel Schneider2026-10-01
| | | | | | | | | | its clean state, so a Save or Putall after it writes nothing over the loaded file; a Get file that fails, or is asked about unsaved edits, renames nothing; Get file in a directory pane is refused with how to open it ctl.getFile is the one load-under-a-name path: it reads first, then makes one undo step (whose snapshot now keeps the name and its saved state), renames and loads, and leaves the pane clean. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Zerox opens a second pane on a file pane's buffer: one text, undo and ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | | | | | | unsaved state, a scroll and a cursor each; an edit in either is spliced into both at File.setContentSpan, O(the edit) more, and what a Save, a get, the disk watch or a rename changes on one is copied to the rest after each step Twins share the content buffer, the History and, while it is one, the line index; the other twin's cursor and scroll move past the splice as acme moves a clone's q0. Del of one twin asks nothing while another holds the text, Exit lists the text once, and a closed twin keeps a copy of its own until it is torn down. Both are in the index, each its serial, one name. An event reader on one hears no edit made through another (first cut). A dump keeps the twins as two panes on the file, not linked again. perf: edit-twin, typing beside a twin of the 50k-line file, gated within 3x of edit-char in the same run; the three baselines re-recorded for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Tab N sets a tab's width in cells, 1 through 16, in every pane, drawn and ↵Gabriel Schneider2026-10-01
| | | | | | | | | | | counted (wrapping, clicks, the cursor); bare Tab says it; the ctl read and a Dump keep it A session setting, not acme's per window: the width is read by File's pure width functions (~130 callers that are given no pane), so it is one value, config.tab_now, that Runtime.apply sets and a new session resets. A file:L:C column counts runes, as compilers do, and never depended on it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A look at a directory opens a pane listing it, as acme's directory window: ↵Gabriel Schneider2026-10-01
| | | | | | named dir/, its entries in acme's columns (bytewise, dotfiles kept, a directory's marked /), a look at an entry from there, Get or a look again reads it again, never dirty, Save refused; DirLook terminal keeps ls in a terminal Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A +Pager keeps its program's colours: the session parses what /pager is ↵Gabriel Schneider2026-10-01
| | | | written after its directory with ghostty-vt, SGR becomes spans drawn over the plain text, every other escape is dropped, and PagerColor off pages it plain