| Commit message (Collapse) | Author | Age |
| ... | |
| |
|
|
|
|
| |
back to a pane, as Shift-Esc does, instead of running Last underneath it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
shows, and with none goes back a pane as Esc does everywhere else; Shift-Esc still goes at once
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
| |
speculation checked against the authority's tape, each client in its own view, what release builds read unwritten, and the numbers
Three clients typing 100 inputs a seed at 30, 80 and 207 ms RTT, a view each: no divergence and every replica on the authority's digest at quiescence (Debug 12 seeds, ReleaseFast with a filled heap 20, ReleaseFast timed 20, and 20 in one shared view). ReleaseFast, p50/p99: a speculative apply 35-54/168-183 us, a copy (1.3 MB) 75-94/198-447 us, a rollback 342-569/818-1561 us, the worst a tenth of a frame; rollbacks per input 31%, 76% and 129%, nearly all for another client's unit first, which views do not change (they change what a rollback shows); 2-7% mispredictions, every one a message's HH:MM:SS read in another second. rollback-bench: a typical session's copy 980 KB in 0.044 ms, put back in 0.036; a big one's 1.49 MB in 0.071, 0.051. What proved wrong (a 100 KB copy, rare mispredictions), what is not done (transport, the view's events at once, echo prediction, a single-threaded epoch), and fs.py's mounted-startup hang still on main, shown with main's own binary.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
| |
emptied when its view goes live, so a pane closed before that view parks again frees no selections that are not its slot's
installed() wrote the slots of the views not live and marked every open view's known, the live one's left as it was; and unpark() left a view's slot holding the selections it had just given the live body. A pane made, then closed while its view was still live and torn down after another went live (a Zerox twin closed at once, say) freed that view's slot: whatever the slot held, or the live body's selections a second time. A view's slot is now made fresh for the live view as for the others, and holds no selections while its view is live. Found by test/replicas.zig, whose replicas switch views on every input; the views unit tests and snapshots (views, views-pan, views-term) pass as they did.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
| |
decisions, the round trips locally, through the relay and to FreeBSD, and open points 3 and 5 decided (walker copy for rollback and for join, no fork)
A ping through `ssh -L` to a session on the FreeBSD box costs its RTT (median 205 to 210 ms against a TCP connect's 206 to 208) and a hello two (411 to 476 ms: ssh confirms the channel before it forwards a byte); through the relay at 30, 80 and 207 ms they are the RTT plus 0.3 ms. A rollback copy is about 80 KB (typical) or 96 KB (big) once file texts and undo snapshots are pinned, 0.02 to 0.045 ms; a fork of 1 GB stalls the authority 13 to 20 ms here and 20 on FreeBSD, and every page it writes while the child lives costs ~1.3 us more, so a join takes the same walker copy and a worker streams it. The tty A/B against phase 1's tip is within its A/A runs. Still open marks points 3 and 5 decided.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
of ~100 KB once file texts are pinned) and what a fork stalls the authority for, which settle open points 3 and 5
`zig build rollback-bench -Dplatform=tty -Doptimize=ReleaseFast` (test/rollback_bench.zig) builds a typical session (a shell with 1 MB of scrollback, three 60 KB files and a 3 MB one, 40 edits) and a big one (14 panes, 18 MB, 4x3 MB and 8 small files, 8 MB of scrollback, 200 edits) in process, then measures the state the digest walk visits, the part of it that is a file's text and its undo snapshots (immutable once made: an edit puts a new buffer in place, a snapshot is a copy, so a copy pins them), and the walk again with those taken out, plus a memcpy of what is left. Typical: 36.3 MB walked, 80 KB to copy, about 0.02 ms; big: 282.5 MB, 96 KB, about 0.045 ms. Then a fork of the big session (431 MB RSS: 3.4 to 8.3 ms) and 64 MB written by the parent under the child (~28 ms of copy-on-write).
test/fork_stall.py does the fork alone, on any system with a Python (the FreeBSD box): N MB written, then fork() timed and 64 MB written under the child, with Linux's THP as set and with 4 KiB pages. 1 GB: 13.3 to 19.6 ms here, 20.4 ms on FreeBSD 15.1; the copy-on-write after it ~1.3 us a page on both.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
-L` can forward, refuses another build's hello in words and hands the connection to its session, which welcomes it and answers pings
The daemon binds `pardes-replica.sock` beside its own (SOCK_STREAM, so ssh can forward it; the SEQPACKET socket that carries fds stays local) once it holds its lock. A replica's first message is a hello (detached/wire.zig, now version 14): the protocol version at offset 0, the client's semantics hash and the session's name. The daemon reads exactly that much and no further, so whatever the client sends next is the session's, keeps up to 16 hellos still on their way (ponytail: one that never comes holds its slot until it hangs up), and refuses in words another protocol, a session nobody has, or another build: every session now says its own hash in its registration (daemon protocol 2), so a mismatch never reaches it. An accepted connection goes to the session over its link (SCM_RIGHTS) and the daemon keeps no copy; the session welcomes it with its pid and name on a thread of its own and answers each ping with a pong, until bye or a hangup. ponytail: that stub is all a session does with a replica until phase 5 proper; it is what times a round trip through the handoff and `ssh -L`.
The semantics hash (wire.semantics) is phase 1's undone item: the protocol, the release and commit, the platform, the build options, every dependency the manifest pins by its content hash (grammars, ghostty, the Unicode tables: build.zig's new `deps` option) and the walker codec's assumptions (pointer width, byte order). Not the OS: a Linux client of a FreeBSD session is the main case. ponytail: an unstamped build has no commit, so two dev trees of one release with the same options are not told apart. `pardes --version` prints it on a second line. The hello lost its grid (a replica's view takes a resize like any other input).
test/daemon.py: a hello of this build welcomed by the session itself (its pid, one fd more in the session and none in the daemon, and back once it hangs up), 50 pings, another build's hello and an unknown session's refused, and `--ping <socket> <session> <pardes> [n]`, which times a hello and n pings on any replica socket (a forwarded one, say).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
held a fixed delay from its arrival each way, in order, with an optional rate cap
It accepts on a Unix or TCP socket and connects each client on to another; each direction is a reader that stamps every chunk with its due time (its arrival plus the delay, or, capped, the moment the link has carried the chunks before it plus the delay) and a writer that sends it then, so a stream's throughput is not serialised behind the delay. 15, 40 and 103.5 ms one way are the gates' 30, 80 and 207 ms RTTs (the last the FreeBSD box's). ponytail: the buffer is unbounded, a link of infinite bandwidth-delay product; ssh's own window is what bounds a real one.
`--self-check` measures what it adds against an echo and a sink: an RTT 0.26 to 0.56 ms over the two delays (the threads' wake-ups; the low end pinned to two quiet cores), 2.3 to 4.3 GB/s through it at every delay (256 MiB, against 9.9 to 12.4 GB/s direct), and a 20 MB/s cap held to 19.99.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
cursor, a shell's prompt never out of sight, an arrow in the gutter where rows are above; a name drafted in a tag is the view's that opened it
A terminal takes the size of the view that typed into it last; a shorter view used to show its top rows, the prompt below them cut. It now passes over as many as keep the cursor's row in sight, as tmux pans a bigger window in a smaller client: `Pane.pan` (per view, derived) is made in the step's sync and again when a view is drawn out of turn (views.unpark), by terminal.panFor (0 in the view that sizes it, in one tall enough, or folded), and read where the body's rows start: `Pane.scroll`, the body walk in tty mode, the visible cursor. One view never pans: the view that sizes a terminal returns 0 at its first test.
A `.name` prompt (a file's name drafted in its tag) is the view's that opened it (`Pane.prompt_view`): another view's step, where that pane has not the keyboard, no longer drops it; its view closing does.
views-pan.snap: a shell sized for a 24-row view, its last lines and prompt in a 12-row one under the arrow, then typed into from the short view and sized for it. A unit test: the short view's frame has the cursor's row, and the line on it, inside the pane. docs: the notes, the reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
and what is not done; ponytail marks for the shortcuts left (a paste shared by every terminal, a second window's hit test, one display density per process)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
another view, up to four; Detach lets one go); phase 4 notes in docs/next-daemon.md; tty: Screen.hungUp reads a test terminal's fd as the test build has it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
acknowledgement moved the live session's pointer and hover, and a replica that draws nothing applied it to another view); daemon.py attaches a second terminal and a second window beside the first; views-term.snap pins a terminal shown at two sizes
Found by `pardes-monkey --views=3 --tape`: 4 of 6 seeds diverged at acknowledge_panel_presentation inside the pump, the recording having moved the look-hover of the view it drew and the headless replica that of the live one. A view's panels are acknowledged when it is live and drawn. With it, 6 of 6 seeds replay in all three replicas.
test/daemon.py: with the first terminal attached, a second `pardes --attach` gets a view of its own; both are drawn (a line run in the shell shows in each), then it is detached from inside (its stub ends 0, the first draws on) and, again, its terminal closed outright; fds of the session and the daemon level. --gui: a second `pardes-gui --attach` while the window is open opens another (its captures under view-1), and Detach closes only it. views-term.snap: a terminal typed into from the big view is sized for it and shown at that size in the small one, then the other way round. ponytail noted at Pardes.sizes: a view smaller than the terminal shows its top rows.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
| |
ghostty's own records by content address, a delta a screen of row hashes and the blobs the peer lacks, history fetched by absolute row
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
reads queued at most, so it costs no frame a 4 KB read and holds no key or echo behind it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
The gigabyte took three minutes a run (seven runs to an interleaved
A/B), most of a measurement's time, and 32 MiB floods the pty as well:
the reader is starved or not in its first megabyte. The case is named
for its size (`live-tty-yes-32m`). perf.zig is the harness's identity,
so the gate's baselines are recorded again, from the base the line
started from, as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
missed, what is deferred, and the gate's numbers
How the tape and the walker came out (a tree at the host boundary, the
replay a mode of the same binary, three replicas, digests per field),
the annotations the walker needed (`len` besides local, derived and
authority), the render-time writes moved into the step, the clock and
host facts taped, the unit tests that had passed on a stale frame, and
the two per-frame costs the A/B found and that are gone (the geometry
key fed field by field, the paint-ahead worker started inside the
render). The gate's numbers close it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
time: its stamp and the unattended expiry read the clock again, through the tape
Moving them onto the session clock (now_ns, for the replay) stamped a
message with the last pump's time: written over 9P after an idle spell
longer than MessageLinger, it was as old as the spell and an unattended
session expired it at once (fs.py's unattended_messages_expire failed
when its session sat idle first). Both read CLOCK_MONOTONIC as before,
as a taped value, so a replica reads the recording's.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
one made again for every frame
File.geometry is made by whoever asks first, a step or the frame; the
render made it afresh all the same (so that an input its key missed
would show only as a headless divergence, never as a stale frame).
That cost every scroll a third walk of the body's rows: the step made
the map for its ensureCursorVisible, the frame made it again, and the
paint walked it. PageDown in the perf harness ran 4% over the base,
outside its 2% A/A spread. Drawn from the step's map, a scroll walks
the rows twice, as before the geometry was the step's. An input the key
misses now shows as a stale frame, which the snapshot goldens catch
(all 110 unchanged).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
| |
session's tape and fail a script whose tapes do not replay; `zig build replay`
pardes-snap --tape=DIR sets PARDES_RECORD for each script (each session, a nested pardes's too, writes DIR/<stem>-<pid>.tape) and, once the script has run and its goldens compared, replays every tape with the same build (PARDES_REPLAY): a divergence, or no tape at all, fails the script as DIVERGED with the replay's words. pardes-monkey --tape=DIR passes it on and counts a divergence as a hit. `zig build replay -Dplatform=tty [-Dreplay-seeds=N]` runs every snapshot script, then N monkey seeds of 70 steps (default 20), tapes under .zig-cache/tapes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
value (the replay digest) and encodes and decodes it (the tape's values)
Values, never addresses: a pointer is followed, a slice is its elements, an ArrayList its items, a hash map its entries in no order, a DynamicBitSet its bits; an allocator, an Io, a lock or a worker's future is machinery and walks to nothing. A type it cannot see into (a pointer to an opaque thing or a function, a many-pointer, an untagged union) is a compile error naming the struct and the field, until the struct says what the field is:
pub const replica = .{ .local = .{...}, .derived = .{...}, .authority = .{...}, .len = .{ .{ "jumps", "njumps" } } };
local (this process's own: frames, animations, caches of the host's), derived (made again from the rest), authority (held by the session that performs effects alone) are in no digest; `len` hashes a fixed array only as far as its length field says, since the rest is undefined (0xAA in a safe build, and a slice in it faults). A name that is no field is a compile error, so a rename cannot put a field back in quietly. `fieldDigests`/`fieldNames` give a digest a field, which is how a divergence is narrowed down. encode/decode are native byte order and an error is its number in this build: for the process that wrote it, or one of the same build.
Phase 2 is to make the complete dump on the same walk (docs/next-daemon.md); nothing uses it yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
blocked for good while keys still work
vaxis's event queue woke one blocked writer, and only on the pop from full. The tty's loop has two writers on it: a pane's pty reader, and the input reader posting the wake for a frame's answered status request (FrameAck). Under `yes` both block on the full queue; the loop then takes a whole batch, its first pop wakes one of them, the rest wake no one, and the pty reader waits for good: the program in the pane blocks writing to its pty, the pane stops moving, and every key still works. It happened from about 400 KB of output, every time at 1 MB, through the snapshot harness's pty as through a terminal.
build.zig patches vaxis's src/queue.zig at build time, count-checked as its Parser.zig and Vaxis.zig are: a pop that makes room wakes every blocked writer. A test (src/vaxis_input.zig) empties a full queue in one batch with two writers waiting and requires both to land. `yes | head -c N` through a bash pane in tty mode now finishes at 1 MB, 10 MB, 100 MB (16 s) and 1 GB (179 s, test/perf.zig --live).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
-c 1G` through a real pty, and a big file's open
The baseline the daemon work is measured against (docs/next-daemon.md). `pardes-perf --live <pardes>` runs the real tty binary in a pty (test/e2e_harness.zig, as the snapshot harness does): FrameStats.keys's gestures (key-down, key-right, edit-char, page-down, wheel) on the 50k-line fixture, a phase each, each frame's latency from the shell taking the input off its queue to the end of its present, read back from the session's PARDES_FRAMES dump; `yes | head -c 1G` typed into a bash pane in tty mode, wall time to the mark after it and the frames drawn; and a 1,000,000-line file opened on the command line, wall time to its first line on screen. `--live-gui <pardes-gui>` runs the same gestures as the GUI's own timedemo (PARDES_FRAMES_DEMO=keys) in a hidden test window. p50 and p99 per phase, pooled over --reps runs; text or --json.
Each run has a private home (bash with a `$ ` prompt), XDG_RUNTIME_DIR and fixtures under $TMPDIR, all removed after. The frames dump now says the monotonic time of its first frame (`# t0_ns`), so a driver lines its own phase times up with the frames'.
The perf gate's baselines (test/perf-baseline-{tty-debug,tty-fast,gui-debug}.json) are recorded again: the harness id is perf.zig's hash, and the medium cells came out within about 10% of the old ones (edit-char and edit-twin faster).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
terminal's HUP and detaches
PR_SET_PDEATHSIG (FreeBSD: PROC_PDEATHSIG_CTL) in the session child,
cleared again at Detach so the stub's own exit then is no hangup; a stub
dead before it was set hangs up at once. It is the HUP the signal thread
already takes (blocked in every thread, sigwaited), and setsid does not
touch it. An --attach stub is no parent of its session: one killed so
still leaves the session drawing until the terminal closes or Detach.
test/daemon.py kills a session's stub outright under a shell that keeps
the terminal (on FreeBSD the session leader's exit revokes it), waits
for the session to put the terminal back and detach, and attaches it
again; without the death signal it times out.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
ends: the reader that takes the daemon's ok starts before kept() waits on it
The reader starts after the first frame, and a hangup handled in that
frame had kept() wait its full 2 s for an `ok` nobody read, then end the
session. test/daemon.py's killed stub hit it 2 times in 55 under load,
and none in 95 after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Filter, SYSTEMD_PAGER read by the shell, and no pager of the caller's
Since 046979b8 (committed 2026-10-22) `pardes -` makes a new +Pager for
each paged text, one already there keeping its page, and maps its
colours through the theme as a terminal's until Filter shows them as
sent; the test still expected one +Pager refilled and the colour as
given. coreutils 9.12's printenv quotes a value with a blank on a
terminal, so the shell prints SYSTEMD_PAGER instead. And a session's
shells no longer inherit the caller's pagers: a PAGER naming the user's
own pardes-gui ran instead of the binary under test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Closing a 256 MiB +Pager base64'd and serialized its text (8.5 s in
Debug, the session answering nothing meanwhile) only to throw the record
away: an output pane's record always holds its text whole, so its length
decides first. fs.py's remove of that pane timed out on it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
which made a walk of a directory just made answer ENOENT
The tty frame's tick sweeps the table with the turn, but the turn comes
back to the editor after a step of its own with a 9P request still out
in a stat: the entry that request's walk had just made, which no fid
named yet, was freed under it, and the next element looked up nothing.
That was fs.py's one-in-a-few `/os` listing failure; walks of a fresh
directory against file churn in the session's directory failed 144 in
2799, and none in 4440 after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
connect, which FreeBSD refuses to a full listen queue as to a dead socket
The owner holds `<socket>.lock` flocked from before it binds until after
it unlinks (claim, release; the fatal-signal path unlinks it too). The
startup sweep, the registry sweep, a registry entry's replacement and
`taken` ask that lock: held is live, free is dead. They unlink only while
holding it, so no new owner comes between the judging and the unlink,
and two starters of one name are told apart by who took it. A socket
with no lock, a pardes from before the locks, is still judged by a
connect. The daemon's own start was already decided by its flock.
The sweep test gains a live session whose socket refuses connects on
every system (bound, not listening, its lock held) and a dead one's free
lock, which goes with it; it passes on the FreeBSD box now.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
running on the box, what differs there, what 207 ms costs)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and fs.py without /proc
- The refusing directory some tests name is Linux's /proc/1/root: that
part skips elsewhere. The committed builtins-*.json are Linux builds'
(Tty9p): their check skips, and a key the docs give a word this build
leaves out is found in the other's list.
- kitty: a shared memory object is sized before it is written (FreeBSD's
write does not grow it); a FIFO in /dev/shm is Linux's case.
- daemon.py asks ps and procstat where there is no /proc, and finds bash
on PATH. fs.py runs printenv once a name, and skips two permission
checks as root, who searches and writes anywhere.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
daemon included
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 <prefix>/test, to
run where the build cannot.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
glibc's tcgetattr overran by 16 bytes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
| |
docs/next-daemon.md
building.typ's detached sessions are the daemon and its sessions; the guide, cheatsheet and reference say what Detach, a closing terminal, --attach of each kind and Adopt do, and that attaching from another machine waits for phase 5. docs/next-daemon.md records the forks taken (sessions register and are not the daemon's children, and why; how it starts; masters; Adopt as a word; the stub's signals and job control; --detach; the Attach word; the harness switch), the known gaps, and the termios trap.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
| |
wire.zig
Nothing draws a session's screen from frames any more: a session is always an in-process authority with its terminal or window, and remote clients come back as replicas (docs/next-daemon.md, phase 5). server.zig, the third host and its frontend socket, the smallest-common-grid rule and its 32 frontends; client.zig, the frontend half; wire.zig's frames, cell and layer codecs, server messages and the post chain on the wire. wire.zig keeps the framing, the hello and its version (now 13) and the input events, with their tests, for phase 5.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Detach and --attach in place for terminals and windows, pty masters kept, Adopt
pardes in a terminal reaches (or starts) the daemon, opens /dev/tty and forks: the child is the session, in a session of its own (setsid), drawing on that terminal (tty.Term.fd, a raw vaxis Tty made from the fd); the parent stays as its stub, the job the shell waits on. Not the daemon spawning it from a passed fd, env and argv: the user's terminals each run in a 9ns user and mount namespace, which a session spawned by a per-user daemon would not share, and a fork costs one small process's page tables where the spawn cost an IPC and an exec. GUI windows and --detach sessions just register.
tty: Detach (and a terminal's end: EOF, EIO, a hangup the stub passes on, taken on the signal thread) puts the terminal back, drops it and the stub's stdio, tells the stub (which ends, exit 0), and leaves the session running with nothing drawn (Host.watched), its messages on the clock and `size` its own. pardes --attach[=name] hands its terminal through the daemon; the session enters it as the first one, sized, queried and drawn whole, and that process is its stub until it leaves. A hangup never ends a kept session; TERM and INT do, telling the daemon so the shells go with it (one async-signal-safe send).
gui: Detach closes the window (its swapchain or renderer) and keeps the device, atlas and pipelines; the loop sleeps on SDL's queue; pardes-gui --attach[=name] opens a window again. Closing a window still quits.
--detach is a session started detached: the tty host with no terminal yet, the GUI with a hidden window closed at once. forkShell sends the daemon a dup of every master and the hosts tell it what they close, so a session killed outright leaves its shells running; the new Adopt word takes them in as terminal panes (the Tty word's pane, its spawn taking the pty, a 1x1 size then the pane's to make it redraw).
The Attach word, which switched a session's own terminal to a detached session through the frames, goes, with its effect and request in the core. PARDES_DAEMON=off (the e2e harness's) runs a session as before. test/daemon.py: 50 detach/attach cycles at a level fd count with no stale socket, kill -9 and Adopt, and nothing left; --gui the same for a window. test/fs.py: a forked session's socket is found by its own pid, and a hangup leaves a kept session running.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
terminals to detached sessions
`pardes --daemon` listens on pardes-daemon.sock in the runtime directory (ninep_io.socketDir), its .lock flocked for its life so two never run. The first session that finds none takes the lock, binds and listens itself and queues its own connection; the daemon is then double-forked and exec'd onto that listener and lock (fds 3 and 4), by a terminal's stub after the session's fork, so no startup waits for it: the hello sits queued, and the `ok` is the reader thread's. Another starter waits on the lock; a stale socket is the lock holder's to replace. Idle a second (no connection, no master held), it unlinks the socket and exits.
It spawns nothing and is nobody's parent: a session registers on one connection (hello: kind, pid, name, attached or detached), sends a dup of every pty master it forks (`pty`), says which it closed (`close`) and when it ends (`quit`, its shells hang up), and asks for the masters of sessions that died holding them (`adopt`). A master whose shell is gone (POLLHUP, polled with no events, its output never read here) is dropped. `attach` hands a terminal and a stub's pipe (pardes --attach), or a window request (pardes-gui --attach), to the detached session of that name or the only one, and refuses in words: no such session, attached already, the other kind. SOCK_SEQPACKET datagrams, a line of words and the fds they carry.
The client half: connect (starting one), register, the session's link and its reader thread, and the stub a terminal's session leaves behind (forkSession, stubWait), which passes WINCH, TERM, INT, QUIT and HUP on and ends with the session's status.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
(deterministic replicated core, kakoune-style views, one daemon per user, phases)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
| |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
lowest first, and the tty hands z on to the outer terminal (under the text below 0); real clients recorded, replayed and run live
z-index was lost: an ImagePlace had none, so every image went over the cells in hash-map order, a z<0 picture (a background under text) over the text and overlapping images in any order. ImagePlace.z now carries the placement's z (a virtual placement's from its placeholder target), TerminalImages sorts what it appends lowest z first (stable), and the tty's exactKittyPlacement sets vaxis's z_index, so a kitty terminal outside stacks them and puts z<0 under the text. The GUI draws them in that order but still over the cells: under the text there needs a glyph pass after the images (ui.frag's clear_bg_bit) in gui.zig's vertex buffer.
Real clients: test/kitty_harness.zig's PARDES_KITTY_EXPLORE runs commands in the pane under script(1) and prints what pardes placed outside; kitten icat 0.49.2 (--align left/center/right, --place, --scale-up, --unicode-placeholder, --clear, file/memory/stream/detect), chafa 1.18.3, viu and yazi 26.9.1 all landed where they should. Their recorded traffic (test/kitty-fixtures/*.vt) replays through the core (test/kitty.zig) to the cells they drew live. The harness now also runs yazi live (shared memory, a virtual placement, placeholders), checks z=-1 outside, and runs a second pardes under a terminal without kitty graphics: no graphics command reaches it and the image is glyph art in all 32 cells. The harness empties NO_COLOR (zig build sets it, and vaxis drew no colour at all under the harness) by setenv, not unsetenv, which compacts the environment std captured.
Also: tests that a pane's image follows pardes's own scrollback, an edited copy taller than its rows, a narrow pane's edge, Collapse and a cell-size change; and a knownGap: images do not survive a dump (Dump, Handover, a pane reopened from the Store), whose VT text has none.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
(test/kitty.zig), in kitty-test and unit-test
Commands with any action, keys and values (huge, negative, zero, junk), payloads valid and broken (base64, a cut PNG), CAN, SUB and ESC mid-command, half of them loads and placements with random geometry so they reach the storage and the frame; placeholders with every diacritic, 24-bit and 256-colour ids and underline-colour placements; cursor moves, scroll regions, insert/delete lines, ED 2/3, the alternate screen; window and cell-size resizes and grid resizes; frames between; every batch split into reads anywhere. Each seed checks no crash, no leak (the testing allocator) and that every answer parses as a whole ESC _ G ... ESC \ or CSI. A bad answer shrinks to its shortest failing prefix; PARDES_KITTY_FUZZ=<seeds>, PARDES_KITTY_FUZZ_SEED and PARDES_KITTY_FUZZ_STEPS for long runs and replays.
Found nothing: 900 seeds of 400 steps pass, with frames drawing up to 42 places.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
hangs pardes or swells it (ghostty's loader patched at build time)
A program in a pane that named a FIFO (`mkfifo /tmp/f`, then t=f, t=t, or t=s through /dev/shm) hung the whole editor: ghostty's loader opens the path and only then checks that it is a regular file, and an open for reading waits for a writer. A device was opened too before being refused (an open may do something), and any image file up to ghostty's 400 MB was read and held before a screen's 64 MiB storage could refuse it.
build.zig's patchGhosttyKitty patches src/terminal/kitty/graphics_image.zig with count-checked anchors, as vaxis and mvzr are: on Linux a path is probed with O_PATH (which opens nothing), must be a regular file, and that same inode is reopened through /proc/self/fd; shared memory must be a regular file (stat of /dev/shm/<name> first, then shm_open non-blocking and fstat); max_size is TerminalImages.storage_limit. Which paths are accepted stays ghostty's (kitty's) policy, which the user accepts.
Tests: a FIFO by each medium and through a /dev/shm symlink does not block (a watchdog thread opens it for writing after 1.5 s and the test fails if it had to); /proc, /sys, devices and directories are refused; t=t leaves a tty-graphics-protocol file outside the temp directory, and one behind a /tmp symlink; a 100 MiB file is refused.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
linked by ghostty-vt), stb_image without them, its writer and its inflate, SDL without its private stb_image; a symbol-table guard; docs/shared-libs.md
ReleaseFast before, both binaries carried stb_image's PNG, JPEG and inflate beside wuffs's (whose function tables keep its decoders linked whatever pardes calls), stb_image_write and its deflate (unused), and the GUI a second stb_image of SDL's (SDL_stb.c, for SDL_LoadPNG and camera MJPEG). Now:
- image.zig decodes PNG and JPEG with wuffs (`wuffs_images`, wherever ghostty-vt is in the build), sized from the IHDR or the first SOF before decoding, as stb's info call sized them; other formats and the builds without ghostty-vt keep stb_image.
- build.zig compiles zstbi with -DSTBI_NO_PNG -DSTBI_NO_JPEG and patches its stb_image_write include out (one count-checked anchor; a no-op stbi_flip_vertically_on_write stays for zstbi.deinit), and SDL with SDL_DISABLE_STB.
Text: tty -74,488 bytes, gui -154,392.
`zig build shared-libs-check` (in unit-test, ELF) reads the linked symbol table and fails on a family the build chose against: stb's PNG/JPEG/inflate beside wuffs, a second stb_image, stb_image_write's deflate, a second zlib or FreeType. Checked against the old binaries: it names every one.
docs/shared-libs.md: the inventory (implementation, users, copies and bytes before and after, allocator hook) and where one copy was not possible: zlib and wuffs both inflate (FreeType's and MuPDF's zlib API vs ghostty's kitty o=z), MuPDF's libjpeg beside wuffs (filter-dct.c is libjpeg's API), MuPDF's unreached fitz image loaders, base64 in Zig std/simdutf/MuPDF, per-library Unicode code, std.debug's flate.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
`zig build kitty-test`, in unit-test) and an end-to-end harness (`zig build kitty-harness`, tty and gui); four gaps it found fixed, one left
The core suite feeds a pane's output as pty reads do and checks what the program reads back, ghostty's image storage and the ImagePlaces a frame draws: queries and their errors, q=0/1/2, f=24/32/100 and o=z, chunked m=1 split at every read size, t=f/t=t/t=s, a=T and C=1 cursor movement, a=p by placement id with source rects and re-puts, image numbers, every d= delete (a/A i/I n/N c/C p/P q/Q x/X y/Y z/Z r/R) and a delete abandoning a chunked load, Unicode placeholders over two rows with implicit columns and a placement named in the underline colour, scroll/resize/reflow, the alternate screen, clear (ED 2 + ED 3), replies per pane and never in the cells, many replies from one read, kitty before DA, CAN/SUB, an oversized image, 300 images against the storage limit, animations and relative placements.
The harness runs test/kitty_client.zig in a pane's bash (query, a 16-chunk 8x4-cell place, the three media, quiet levels, CAN, show then delete) and kitten icat (stream and detect) and chafa when installed. Outside, the tty arm is a kitty terminal (a ghostty-vt emulator): the image pardes re-emits lands at the cell after ANCHOR>, 8x4 cells a row at a time, the client's own commands and replies never pass through, and d=I frees what was sent. The gui arm reads the GPU capture.
Fixed: kitty file, temporary-file and shared-memory media (libghostty defaults to direct only; now allWithTempDir like ghostty and kitty); replies past 256 bytes of one read were cut mid-sequence (4 KiB now, an answer that does not fit dropped whole and counted); animations never played (TerminalImages draws renderData(), ticks ImageStorage.animationTick on the core clock, nextWake wakes for the next frame); relative placements (P=/Q=/H=/V=) were not drawn (resolveChain, as ghostty's renderer). image.decode no longer jumps through stb_image's null allocator before image.start.
Known gap (a knownGap test): no z-index; every image is drawn over the cells in storage order.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
had; vaxis and uucode stay on the commits it pins
What reaches pardes: ED 3 now flags tracked pins on the history it erases `garbage` and takes away the kitty placements there (they used to come back at the pane's top), a cancelled or aborted APC runs nothing, and scrollClear keeps the cursor's style and hyperlink valid when it prunes the cursor's page. No API pardes calls changed.
ED 3, decided by terminal.zig's own rule for rows that are gone: an edited copy or a selection (vsel, msel, the extra ranges) whose top row ED 3 erased goes, rather than being clamped to row 0. The undo history keeps its copy, at the top. `partial_clear_history` asserts it; MarkedHandler.lost and CommandOutput.whole say what ED 3 does now.
Tests: ED 3 takes away a placement in the history it erases; a finished command's output erased by a later ED 3 is not whole and has no text; a selection on an erased row goes, one on the screen stays.
CHANGELOG; docs/render-pipeline.md and Post.zig name ghostty 1.4.0 (its shadertoy Uniforms are unchanged).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
by their grips; a drag still draws its guide); cornerdrag, cornerdrag-left, tagalign2col, windowops goldens: the hover frames without the dashes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| |
|
|
|
|
| |
no spring of its own chasing it (the dance): its springs land on its cell (CursorGlide.How .rigid gone) and the pixel shell draws it at its cell less the glide's offset while its line rides (caretRide, Glide.caret_rides), clipped as the text is; a page that keeps its row leaves it still as before; tests: the springs land, the caret rides exactly with its line
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|