summaryrefslogtreecommitdiff
path: root/core/term/terminal.zig
Commit message (Collapse)AuthorAge
* Panes say they are Ghostty (TERM_PROGRAM=ghostty, ↵Gabriel Schneider6 hours
| | | | TERM_PROGRAM_VERSION=1.4.0, the pinned ghostty whose VT every pane runs), and a Look on a link (OSC 8) in a terminal takes its URI: the user's report of 2026-11-27 ("the terminal applications aren't detecting that we have kitty graphics support (codex for example)") and ruling ("Posing as ghostty is fine by me, it's a good measure for us to have feature parity with it anyways"); THE CAUSE: codex 0.172 decides on kitty images from the environment alone (a terminal-name list, TERM/TERM_PROGRAM substrings, KITTY_WINDOW_ID, WEZTERM_*; its kitty query only for TERM_PROGRAM=herdr; pets never ask), and panes said TERM_PROGRAM=pardes and inherited the launcher's TERM_PROGRAM_VERSION (rex's under rex); pardes answers codex's own probe (`\e_Gi=31;OK\e\\` before DA1) and draws its `a=T,f=100,c,r,C=1` image (.scratch/kp/run.py, run_img.py); WHY THE LINK: a program that knows it is in Ghostty shows a link's label alone (codex's web_link_display), and pardes kept OSC 8 only in the dump: the URL would be nowhere to Look at; THE CHANGE: config.child_term_program "ghostty", child_term_program_version "1.4.0" (host_io.ChildEnv writes it over the inherited one); Term op `link` (abi/term.zig, replicated as textRows is: READ, NOT COVERED, core/Term.zig's S1 row exec.zig:1): the URI of cell x of a row (from the top of the history) and its run's cells on that row, counted in the text with the prompt cut when out of tty mode; exec.operandAt (every entry point: B3, hover, Enter in normal mode, a bare Look): a look at a link takes its URI, a `file://` one its path (the host dropped, %XX decoded), expanded to the label's cells; an exec takes the label's word as before; docs/macos.md's identity paragraph; NOT DONE (Ghostty parity, listed for later): OSC 9/777 notifications, OSC 9;4 progress, OSC 22 pointer shapes, OSC 10/11 colour answers (the `dark` theme takes the host terminal's colours and views differ per client: a design first); RUN (TEST FIRST): exec.zig "a look at a link (OSC 8) in a terminal takes its URI, a file:// one its path, and expands to the label; out of tty mode too" (an https link and a file://box/tmp/a%20b.txt one, in tty and normal mode; off the link `see`, an exec `docs`): fails with the branch off (`the` for `https://ziglang.org`), passes now; REAL CHECK (.scratch/kp/link_e2e.py: this tree's Debug pardes --tty in a pty, TERM_PROGRAM=rex and TERM_PROGRAM_VERSION=9.9.9-outer outside): the shell pane printed `TP=ghostty TPV=1.4.0`; an SGR B3 on plain text beside the link opened nothing; on the label (file://somehost/…/target%20dir/linked.txt) it opened `target dir/linked.txt`; GATES (Debug tui): core-test 1165/1343 (178 skipped), shell-test 1392/1395 (3 skipped), term-test 17/17, kitty-test 45/45, process-test rc 0, behaviour-test 293/293
* tty: a terminal pane whose program is mid-frame (synchronized output, DEC ↵Gabriel Schneider7 hours
| | | | 2026) keeps showing its last whole frame until the frame ends or a second has gone, as a terminal holds its picture (ghostty's sync_reset_ms): the user's report of 2026-11-27, "it seems to skip some stuff and then show repeated things", worst in long coding-agent sessions; THE CAUSE: agent TUIs (Claude Code, codex) wrap each redraw in ?2026h…?2026l, and a long session's redraw (Ink's 2J 3J H and the whole transcript) spans many 64 KiB pty reads; pardes drew the pane after each read, so the tty showed the transcript's top again (the repeat) and then the jump to its end (the skip); THE CHANGE: abi Modes.sync (ghostty's synchronized_output, read in terminal.zig's modes), surface Region.held set by draw.zig on a terminal body whose program is mid-frame, and tui.zig's Held: per pane, a held body's rect shows the cells (and the cursor) the tty last showed there; it lets go when the frame ends, after max_ns (1 s, counted from the first held draw), or on a resize or a moved rect; Screen.moving() keeps the loop drawing while one is held; other panes draw live; core/Term.zig's S1 table: modes draw.zig:2; the dump and the digest unchanged (Modes is not dumped; the digest hashes ghostty's modes already); NOT COVERED: the GUI and the 9P /screen file (the raw canonical surface) still show half frames; RUN (TEST FIRST): tui.zig "a terminal mid-frame (synchronized output) shows what the tty last showed of it, until the frame ends or a second has gone" (fails with max_ns 0, passes now); REAL CHECK (.scratch/ttyskip/harness.py: pardes --tty in a pty under pyte, an Ink-like generator in pane 1 over 9P, every outer frame (vaxis's own ?2026l) checked against the app's completed frames replayed from its byte log), 60 s ink runs, ReleaseSafe: the installed 24dc19130fd6 showed 362 of 3166 outer frames that were no completed app frame, this change 0 of 3270, final screens equal; Debug 112/1035 before, 0/965 after (a 60 s Debug run 5/2803: pardes more than 1 s behind lets a torn frame through by design, a 10 s cap gave 0); GATES (Debug tui): core-test, shell-test (1390/1394, 3 skipped), process-test 0 of 149 failed (3 skipped), term-test
* ansi, Term, term/terminal, abi/term: a terminal's colours from the chrome ↵Gabriel Schneider41 hours
| | | | | | | (the themes programme's L2d; DESIGN.md R1, R14, R15, B6): the paint and the filter take the page, its text, its dim ink and the sixteen the theme resolved once a theme change (`Chrome.page`, `Chrome.ansi`), never the theme's own fields: a theme with no sixteen of its own draws a program's in the ones worked out for it (R14: its own hues within 30 degrees, else canonical ones, held 4.5:1 on its page), where the cells named an index and each frontend drew its own palette (the tty the host's, the window ghostty's, the Mac Tango: three for one index); a theme that leaves its page to the host (`dark`) leaves page, text and sixteen to a tty as before (`Ink.host`), and in a window draws the null page, its text and its sixteen (R1, R14: "the window uses its ansi"); the filter's base is that sixteen and its 256 targets ghostty's generator over it, made once a theme (FilterPalette, keyed by the theme's values: no reimplemented generator, no per-frame make), where the base for a theme without a palette was made of its roles (ANSI 1 the keyword, 5 the selection, 13 its ink: C1's surfaces.md §3.10) and the page of `dark` was its tag (`ink.bg orelse ink.tag_bg`, #2c2a3e under a #121212 window: §3.1); SGR faint on the page's text is the page's dim ink (R15: the text toward the page to 3.5:1, so as faint on a light page as on a dark one), where a tty halved its brightness toward black and a window took 60 % of it (faint on a coloured ink stays the frontend's, L2e's); Ink is {fg, bg, dim, ansi, host} (abi/term.zig: `tag_fg`, `tag_bg`, `palette` and `base` deleted), ansi.inkOf takes the core (its chrome and its view's frontend); RUN (TEST FIRST): test/terminal.zig "a theme that leaves its page to the host (`dark`) draws a terminal's page, text, faint and sixteen as the null page and its own in a window, and leaves them to a tty; its filter keys to that page, never its tag": in a window a plain cell on #121212 in dark's text, SGR 31 in `ansi[1]`, SGR 2 in `page.dim` and not faint; in a tty `.default`, index 1, faint; the filter's page the null page and its ink the text: on the base the window's cells are `.default`, index 1 and faint and the filter's page dark's tag (the old Ink had no page to give: `ink.bg orelse ink.tag_bg`); the Filter tests re-pinned to the chrome: helix's SGR 31 raw is its resolved `ansi[1]` (was index 1), the `F` cell's faint on the page's text its dim ink (was the text, faint), a reversed explicit cell's ink the chrome's page, the in-place custom theme now a ThemeFile's way (its sixteen changed and its chrome worked out: finishThemeInitialization) where it poked the keyword the old base mapped to ANSI 1, the theme loops by setThemeIndex (they set `settings.theme` under a chrome worked out for another) and with `dark` among them; test/panes.zig's TerminalTests that assert a program's raw indices (an edit buffer sliding rows and their colours, a combining mark, an emoji prompt, a swallowed row, an emptied buffer, the overlay in tty mode, colours never taken from rows below the viewport: seven failed on helix's indices now its resolved sixteen, and the last would have kept passing while proving nothing) take `dark` in a tty, which leaves the sixteen to the host as helix's missing palette did; the wide glyph's last column keeps helix (a page of its own, so the body draws every cell) and asks its resolved red; goldens re-recorded: load.golden row 7 and headersweep-restored.golden rows 6, 14, 15 and 21: the `── restored history ──` banner (SGR 2, terminal.zig's restored_banner) in orchard's page dim ink #666f68 where the tty drew #e5eee5 faint, and the blank cells after it on its row the same fg (vaxis erases the rest of a row in its last SGR; nothing drawn there); pagercolor.golden, theme.golden and themesel.golden unchanged (every native and ported theme in them has its sixteen); GATES: core-test 1123/1296 (173 skipped), term-test 17/17, pane-test 184/185 (1 skipped: base 183/184, +1 the dark test), process-test 145 of 147 and the two re-recorded (3 skipped); load 3.4 to 7.8 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
* pty/run at a terminal's start answers the line it ran: a window session's ↵Gabriel Schneider4 days
| | | | | | | first run (test/daemon.py `gui_upgrades`' `echo $$`, twice this week a ValueError on its second line, `b''`) answered `error not run` while its command ran, and a run written just after a new terminal's greeting is typed answered `exit 0` with the greeting's `ls` output; (a) every window session's first terminal is sized twice, its shell forked at 78x14 and sized 78x13 by the window's first frame about 20 ms later, at its first prompt, where readline draws the prompt again (`\r\e[K\r` and PS1, marks and all): a run's line sent into the first prompt shows on the redrawn one, `noteMarks` takes that newer prompt with no C for the line fish refuses and keeps (Ctrl-U, `.kept_line`), and the read after it, the line's newline before PS0's C (bash writes them apart), leaves the cursor on a fresh row in the input which `prompt()` called an empty prompt: `error not run`, the command's C a read later (the ponytail at pty.zig's refused branch named it; the same under an adoption's two sizes, which test/daemon.py `adopted_pid` waited around since ymvuluxr, then ruled a run "told plainly that it did not run": it had run); now a row begun by a newline in the input, with no prompt on it, under a typed line, is not an empty prompt (core/term/terminal.zig `prompt()`, abi/term.zig's `input_empty`): the line was taken and the run waits for its C; (b) the greeting `ls\r` is typed at a new terminal's first prompt (Core.zig's layout), and until its echo the prompt looks empty: a run sent then is typed behind it and its want (started+1) is the `ls`'s C; now the pane keeps that its greeting was typed (`Pane.greeted`, cleared at a shell's start) and until the prompt after it a run waits for that prompt (pty.zig `greeting`: writeRun, noteMarks, pty/status's busy), as for the first, bounded since `ls` always starts (the reference says so); the failing tests first (core/ninep/pty.zig, shell-test): "a prompt redrawn under a run's line, the line taken, is the line run: never `error not run`" (the bytes pty/data read off a failing ReleaseSafe window start; on the base `error not run`) and "a run written just after a new terminal's greeting is typed is not answered with the greeting's output" (on the base `exit 0\nnotes.txt\n`); a user could hit both: a script that starts pardes-gui and runs at once in its shell (a retry on `error not run` runs its command twice), and one that opens a Term and runs in it at once (another command's output for its own, exit 0); the rates (.scratch/sketch/reorg/pardes-first-run, 200 runs a row pinned to CPU 6 and to CPUs 6,7, no made load, loads 1.5-10): every one of 24 rows 200/200, the base and this, Debug and ReleaseSafe, a window session and a terminal's, plain and with a WINCH trap in the shell's .bashrc: the fault is rare on its own (2 of 108 diagnostic ReleaseSafe window starts with that trap; the coordinator's checks twice under load), Debug never reaches it (its first frame comes before bash's first prompt), and its adopted twin comes more often: test/daemon.py `--relink` with adopted_pid's wait taken out, the installed build 18 of 20 (two `error not run` on the adopted shell), this tree's ReleaseSafe 20 of 20; the gates (with the harness change after it): tui Debug core-test 924/1090 (166 skipped: the two new tests need a terminal), shell-test 1132/1135 (3 skipped), process-test 0 of 146 (loads 3.0-6.2); test/daemon.py on ReleaseSafe: plain 1/1, `--upgrade` from the installed build (wire 31) 1/1, `--upgrade --gui` from the installed build 5/5 (loads 1.1-5.8); left: the Ctrl-U a redraw that shows the line still sends (it reaches bash after the line's Enter: a bell at the next prompt), `busy` for a run written into a prompt being drawn (its A read, its B not yet), and a line a user types, or `Term CMD`'s queued line, in the instant before its echo Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* terminals' views: the carry's fuzz against ghostty's own view at 3,000 ↵Gabriel Schneider5 days
| | | | | | | seeds, and its one disagreement ruled (pardes-term-join-11, item 1b: round 10's late finding, seed 1956: "carried 46, ghostty's own null"): the failing run first, a probe of seed 1956 step by step: a 44x3 terminal, the view on row 23 (the active area 24-26), resized to 21x6 (narrower AND taller): ghostty narrows in two phases, the rows first (PageList.resizeWithoutReflow: the active area grows to rows 21-26 and takes the view's row, so its pinned viewport is set to the output there, PageList.zig:2944-2950), then the reflow (row 23's line on rows 46-47 of 55, the active area 49-54): the row is history again, but ghostty decided in between; the carry (terminal.zig `carry`/`carried`) reads the pin's row once, after the whole write: 46, history; the ruling (the coordinator's lean, 2026-11-22): nothing under the view went away, ghostty's jump is the order of its own two phases (a widening's reflow checks before its growth too, PageList.zig:1525-1531), so the view stays on its line, and a view stays a function of the end state, not of the emulator's steps; so the carry is right and the oracle is taught: the fuzz's body is `carryFuzz` (one seed, how many it put back), whose oracle holds a pin of its own at its view's row through each resize, and where ghostty's view went to the output while that pin's row is history again, puts its view back on that row and counts it; the seed is its own test ("a scrolled-back view stays on its line through a narrowing that grows the rows ...", exactly one put back); the fuzz at 3,000 seeds (a local run, the bound put back to 300): clean, every disagreement of that one kind; not exercised by the fuzz and checked by reading: an erase of the history (CSI 3 J: the pin is garbage, the history empty, the place on the output, as ghostty's), a reset (ESC c: the screen made again, the place on the output, as ghostty's), a pruned row at the cap (the history's top, as ghostty's `.top`); a user could see it: a scrolled-back view of a pane made narrower and taller at once stays where it was reading, where ghostty the terminal would have jumped to the live screen; term-test 17/17 (the base's 16 and the seed's test), the 3,000 seeds 2/2 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* terminals: where a view stands in a terminal's history is the view's, not ↵Gabriel Schneider5 days
| | | | | | | the emulator's (pardes-term-join-10, item 1; the note's point 3, the coordinator's choice): `Pane.scrolled_to` (core/panes.zig), a per-view field (views.zig `pane_fields`, `PaneView`: in the rollback copy, the digest and the dump, each view's own), the row its top shows or null on the output, written only by a step (`scrollBy`, `followOutput`), and carried with every open view's through each write of the emulator that moves rows, once, in the confirmed unit's apply, on every side alike (`Term.feed`/`Term.resize` take the places; core/term/terminal.zig `carry`/`carried` pin each place's row on the primary screen and read the pin back: up by the rows the history drops, 0 when its own row goes, null in the active area or after a reset: a function of the fed bytes); the draw reads the rows from the view's place (`viewport`, `paint`, `ImagesAt.place`, terminal.zig `shown`), and ghostty's own viewport is never moved, read, digested or dumped (`Grid.offset`/`view`, `Parts.view` and the digest's offset gone): two clients no longer scroll one viewport (the new views.zig test failed on the base, `expected 80, found 77`), and a speculation's scroll is in the copy, so `putViews`, the view half of `keepViews` (now `keepSerials`), `viewTo`/`scroll`/`follow` (ops, wrappers, bodies), the Debug screen hash's view exclusion, `reflow`'s column-0 cure and `feedOutput`'s follow-after-read are deleted, and S1's `calls` lists no view write (the rows `viewTo`, `scroll`, `follow` gone); tests: the two-view test (with a dump), the place at the history's cap (`setMaxBytes(1)`), a 300-seed fuzz of the carried place against ghostty's own pinned view, a client's wheel over a shared terminal through output and a rollback, round 6's order explorer (30 seeds a run); the wire at 31 (abi/wire.zig, test/daemon.py `WIRE`): an installed build's dump loads with every view on the output; IN THE WORKSPACE core-test 912/1072 (160 skipped), shell-test 1114/1117 (3 skipped), term-test 16/16, kitty-test 45/45, pane-test 181/182, behaviour-test 275/275, --replay 275/275, process-test 0 of 146 failed, as pairs 0 of 146; gui unit-test 1707/1711, its one error BaselineHarnessMismatch (every base's) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* term: the emulator's boundary written down and enforced (S1 on the one road, ↵Gabriel Schneider5 days
| | | | | | | item 2 of pardes-term-join-8): abi/term.zig names `Ops` in two groups, `replicated` (what every side agrees on by construction, each emulator fed the same bytes in the tape's order, written only by a step or a load, read by a step as the digest covers it, or by a draw) and `local` (start, stop, gpa, due, cellPixels, echoCell, paint, images: this process's own), every entry in exactly one (a comptime check: a new entry fails to compile until it says which); the terminal's digest (core/term/terminal.zig `digest`) now covers what a step reads of it: its cols and rows, every mode bit (the alternate screen, the mouse's, focus reports, bracketed paste; `modes`), the mouse's event and format, and the OSC 133 cycle (`marksOf`, `prompt`'s), beside the view, the cursor, the reply buffer, whether it holds an image and the active area's text; NOT the history's text (its row count only: a step's read of it, a 9P read, a Save, a selection over a shell, is listed as not covered); the two tables of round 6 and pardes-image-loop are a test (core/Term.zig `calls`: every call of the core's into a terminal, by entry, file and count, with its rule: a WRITE outside the rollback copy and why no unit kept to replay makes it or how the copy puts it back, a READ by a step and whether the digest covers it, a LOCAL use and why no step's state reads it, PURE for the pager's; a new call fails until it is listed); the counted list, not a type, enforces that the digested paths call the replicated group (by type the digested code would need a handle of its own: every one of the 13 files that read `grid` and more, past the 200 lines the brief allows); core/root.zig's reasons that said a client's emulator is written by deltas, and that a terminal is in no digest, say what is true now; core-test 912/1069 (157 skipped: +1, the `calls` test), shell-test 1111/1114, term-test 15/15, pane-test 181/182, kitty-test 45/45, the soak's small run and `--echo` rc 0 (diverged 0, unequal 0) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* tape: no screen-state branch left, and a terminal's kitty images are each ↵Gabriel Schneider5 days
| | | | | | | side's own emulator's again (the old road's deletion, piece 6 of 8): core/tape.zig loses `Tape.screen_state` and every branch on it (a terminal's output recorded without its bytes, the positions and prompt checks skipped, `screenReplica`, `screenAuthority`, `screenState`, `viewOnly`, which on the one road did nothing), and the tape site `images`; core/panes.zig its replica branches (a feed skipped and the session's positions taken, a view's scroll or follow noted, a resize left to the authority, the reloads at a join skipped); core/Term.zig a terminal's digest that returned early under screen state, and the medium read that went past the tape; core/dump.zig a join's dump always holds each terminal whole (`slim_terminals` stays for the exit dump); the tests' `t.screen_state = false` lines (4 in core/replica.zig, 3 in test/replicas.zig); THE IMAGES (the brief's choice): `Pane.term_images` and its taped read after each output (pardes-image-loop's cure for a screen-state client, whose emulator never held an image) go, the tag reads `Term.hasImages` again (core/tagline.zig), and a terminal's digest holds whether it has an image (core/term/terminal.zig `digest`: one bool among its facts), so the fact the tag shows is covered by the digest it is computed from (S1's rule) rather than by a pane field copied after each output, and a parting over it is named at the terminal; abi/wire.zig's line for 30 says so (the dump's shape changed with it); the image-loop's test runs on the one road (the client's emulator has the image, its tag says what the session's does); core-test 911/1068 (157 skipped), shell-test 1110/1113, term-test 15/15, pane-test 181/182, kitty-test 45/45, the soak's small run and `--echo` rc 0 (diverged 0, unequal 0, corpus 22) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* term: screen_state.zig deleted, and the terminal module's side of the delta ↵Gabriel Schneider5 days
| | | | | | | road (the old road's deletion, piece 5 of 8): core/term/screen_state.zig (1,213 lines: the encoder, tracks, peers' flights, a replica's apply and holes, its own soak and four tests) goes whole; core/term/terminal.zig loses `encode`/`encodeRows`/`encoder`/`encoderFree`/`track`/`untrack`/`replica`/`replicaFree`/`replicaTop`/`missing`/`apply`/`applyRows`/`shown`/`blank`, `takeMarks` (`marksOf` stays, private: the tests compare two terminals by it), the State's `changes` (a version's counter for the tracks), `read` with `markRead`/`wasRead`/`clearRead` (the rows a step read, for the fills), and `resize_to` with `resizeDeferred` and `resize`'s `later` (screen state's authority sized its terminals after a step's unit); abi/term.zig loses the `Encoder`/`Track`/`Replica` handles, `flight_bound`, `Peer`, `Applied` and those entries of `Ops` (and `dumpScreen`, which nothing in the core called); core/Term.zig its wrappers; core/term/term.zig its ops, its handle map and its `screen_state` export; core/panes.zig its `resizeDeferred` and resizes now (its later screen-state lines go in piece 6); core/edit.zig its `markRead`; the cell-for-cell dump the soak compares a client's terminal with its session's by moves to terminal.zig (`dumpScreen`, over the emulator), the soak's three streams (a shell's, a full-screen program's, `yes`) into test/replicas.zig, their one user; test/terminal.zig loses `a replica's terminal pane draws as its authority's does` (a delta's) and `a terminal made fresh has no size waiting` (`resize_to`'s); core-test 911/1068 (157 skipped), shell-test 1110/1113, term-test 15/15, pane-test 181/182 (again after the machines reboot, on a wiped cache), the soaks small run and `--echo` rc 0 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* terminals' views: a view is its row again after every reflow (terminal.zig ↵Gabriel Schneider6 days
| | | | | | | `reflow`, which `resize` and `resizeDeferred` share: ghostty's pinned view set to column 0), so the row a replica's rollback puts a terminal's view back at (replica.zig `keepViews`/`putViews`, the view's row index, the one record of an emulator's view outside the copy) is the view that was there: ghostty pins a view to a CELL, a widening that joins a wrapped line's second row to its first left that cell mid-row, and the next narrowing carried it a row down, where a client put back by its row (at row 0 ghostty's `.top`) stayed: the same digest (the offset) until that reflow, then the client's view a row above the session's, the bytes soak's divergence (round 5: 5 whole runs of 29, every naming a 2-row pane at its history's top, `cat`'s long lines wrapped, panes resized all through); the previous change's two tests pass (term-test 19/19, the replica test under shell-test), a fuzz of put-back against left-alone emulators under random output, reflows and scrolls went from 5 apart in 191 seeds to 0 in 3,000; core-test 885/1046 (161 skipped), shell-test 1088/1091 (3 skipped), each the base's plus the new test (loads 5-11); the bytes soak, whole, untraced, --witness, on this tree frozen (its session doing nothing extra): 21 of 21 clean (against 5 of 29 before), seed 2 at 80 ms alone 16 of 16; the screen-state soak 5 of 6 (s9b-2: seed 1 at 207 ms, 'digest 11 differs in the session', the open screen-state fault scr-1, not this one); the frame and perf gate against tree3 PASS (77/77 frames, corpus2x +0.046%, 121 counts within 0.1%, client-key-down +0.0286%); daemon.py --far and --clients x3 on Debug and ReleaseSafe, plain 5 of 5 after one timing failure on each build at load 5-7, each passing again alone; nothing in replica.zig, tape.zig or wire.zig; a user sees a scrolled-back terminal keep the row its top line starts on through a widening and a narrowing (ghostty kept the joined cell's row: within a row of it); screen-state clients never reflow their own emulator and their terminal views are not digested: not this fault there Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* terminals' views: the bytes soak's divergence (a client's terminal view one ↵Gabriel Schneider6 days
| | | | | | | row above the session's, at its history's top, 5 whole runs of 29 in round 5) fails on purpose, without a soak, in two tests: at the terminal module, a view on a wrapped line's second row, joined into the row above by a widening (ghostty's view is a pinned CELL, now mid-row at row 0) and put back at the row it reports (`viewTo(grid.view)`, as a replica's rollback puts views back, replica.zig `putViews`: at row 0 that is ghostty's `.top`) is another view after the narrowing back (expected 1, found 0: the soak's sign); at the replica's surface (an Authority and a Replica, bytes), the session's frontend widens the shell with its view there, a key of the client's is rolled back under the session's (the copy put back, `putViews`), the session narrows again: the digests part on the terminal's view (17455102819691583991 against 7777253998216201365); found by a probe ring of pane 0's view at every engine step in the soak's clients against the witness (b7b-4: put back to row 0, then the next reflow moved the witness's view and not the client's) and a fuzz of put-back against left-alone terminals under random output, reflows and scrolls (5 apart in 191 seeds); both fail on this change, the next one fixes them Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* integration (the terminals' line, NOT the main line yet): a client that ↵Gabriel Schneider7 days
|\ | | | | | | | | | | | | falls behind lets go and joins again, a join's reloads never dropped and only of the terminals written, on the first client and the pair: pardes-term-join (with pardes-term-lag under it) and pardes-merge35; three conflicts, each two sides adding at one place: the tests at the end of core/replica.zig (both kept), the soak's fields and its end's checks in test/replicas.zig (the images' and the far client's both kept); one name follows: Peer.writeLoop's local for a cut link was named last, which the first client's Peer.last now is (cut_off); tui core-test 861/1018 (157 skipped), shell-test 1058/1061, term-test 18/18, the window builds; the soak, screen state: diverged 0, unequal 0, unlisted 0; BYTES: seed 0 at 30 ms two clients diverged (client 2 at digest 29, client 3 at digest 2): the divergence the join's report left open, here on the merged session: this line stays beside the main one until that soak is clean Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * term: wide characters in a pruned, reflowed scrollback snapshot and load ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | exactly (a test, core/term/terminal.zig: the soak's wide line among 30,000 lines in a 1 MiB history, reflowed twice at odd widths: the loaded terminal's snapshot is the first's, its join hash the reload's, and both go on as one through the rest and two more reflows; it passes on the base: pardes's snapshot and ghostty's are not at fault), so the soak's `cat` gets its wide lines back (the ASCII filter deleted): the divergence seen with them (seed 0 at 80 ms, a join's reload hash) was the refused join's skipped reload of the change before; and the soak's far client never types Detach (it left once, seed 6 at 80 ms, and the run failed for a final screen it could not show; the random draw is made as before, so no other client's script moves), and a run whose far client never shows its final screen says so and why; the soak, bytes, `--clients 5 --bytes --seeds 8` at 30/80/207 ms with the `cat` whole (Debug, load 25-44): 2 of 4 whole runs clean (diverged 0, unequal 0, quiet checks agreed, unlisted 0, corpus 22 of 22, no leak); in the other two, seed 2 at 80 ms (two clients at one session unit) and seed 0 at 30 ms (one client): OPEN, not root-caused (reports/pardes-term-join.md), never under a probe; seed 0 at 30 ms, 19 of 20 clean, one run hung spinning (killed, no trace); on the base seed 0 at 30 ms diverged every time and 9 of 24 runs; tui core-test 859/1011 (152 skipped), shell-test 1047/1050 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | term: a kitty image's medium (a file, a temporary file, shared memory) is ↵Gabriel Schneider8 days
|/ | | | | | | the session's read and a recorded answer on the tape, so every replica's emulator is handed the bytes the session read, or its failure, and never reads its own machine: ghostty's loader gets the bytes through `LoadingImage.read_medium` (an Edit in build/patches.zig, ghostty's own read handed to it, the report in docs/ghostty-kitty-medium.md), which the terminal module sets to the core's `Term.media`, a `tape.valueIn(.medium, ...)` site (a new Site; `valueIn` is `value` with the answer's slices in the loader's allocator, no yield inside a feed), so a read crosses to a client as a file read does (inline under 1 MiB, by hash at or over it), a temporary file is deleted and shared memory unlinked once, on the session, and the program is answered by the session alone; a replica no longer loads by direct data only: `Term.direct`, `State.direct` and the `direct` entry go (`media` in their place); under screen state the read stays the authority's (a screen-state replica feeds no emulator); FIRST the test through the replica's surface (a session and a bytes replica, four images shown, by a file, a temporary file, shared memory and a missing file): on the base the digests parted (expected 8810391091473565423, found 2236913079067993401: the replica's loader said "unsupported medium" and did not move its cursor), now they agree, the terminals dump the same bytes, the temporary file and the object are gone and the replica read nothing (ghostty's FileNotFound warned once); tui term-test 17/17, kitty-test 45/45, core-test 856/1007 (151 skipped), shell-test 1043/1046, unit-test -Dtest-filter=bytes: 23/23 (the perf check's BaselineHarnessMismatch, as on the base) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* replica: the bytes kind of replica made right and joinable (P29, P32; the ↵Gabriel Schneider8 days
| | | | | | | brief's step 2: 2a, 2b, 2c and 2d in one change): the one rule in place of two, the faults shown first (a session's output kept over a copy held ahead was fed again by a rollback: the digests apart; the pages an emulator gained while a copy was held were the epoch's and freed with it: a crash in PageList.increaseCapacity in the rollback's replay): every replica's emulators on the C heap (panes.emulatorGpa), Term.writes counting the writes into emulators, a unit whose replay wrote one never kept over a copy taken ahead, never taken as moving nothing (tape.feedsTerminal), a client's input that owed a reflow always replayed when confirmed; a speculation moves a terminal's view under bytes as under screen state; tape.unit_max (1 MiB) and Tape.cut, which the session's Peers sets, so a pump's reads are cut into units under it; the join: whole terminals in a joiner's dump, every replica the session included reloading each live terminal in the step that opens or reopens a view (panes.reloadTerminals), the session's hash taped (Site.reload) and compared, kitty records left out of it, the cell pixels set first as a feed does; .positions and .prompt compared with the replica's own emulator on replay; replicas load kitty images by direct data only (Term.direct); Peers.bytes for the soak; six tests (core/replica.zig, bytes:); tui core-test 848/997 (149 skipped), shell-test 1033/1036, pane-test 183/184, term-test 17/17, kitty-test 45/45, behaviour-test 275/275 and --replay 0, process-test 2 of 144 (the base's), image- and kitty-harness pass, unit-test bytes: 22/22; gui unit-test 1633/1637 (the perf check's BaselineHarnessMismatch); the soaks in klrvlrly's Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Term: the two things a speculation writes into a terminal and no rollback ↵Gabriel Schneider8 days
| | | | | | | puts back move into the pane, which the copy holds and the digest covers: the cell its program last heard the mouse at (Pane.term_mouse, handed to Term.mouse and Term.wheel, which ghostty's encoder reads and writes) and its kitty graphics as glyph art (Pane.term_petscii, which the Petscii builtin flips and the images' draw takes in ImagesAt): the sizing's table (reports/pardes-term-bytes.md, section 1; the brief's step 1c); Parts loses both (a dump of an older build carries them and they are passed over by name: a terminal's Petscii chosen before an Upgrade is off after it), Ops loses petscii and togglePetscii; term-test 17/17, core-test 848/991 (143 skipped), shell-test 1027/1030 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Term.reload: a live terminal made again from its own snapshot where it is ↵Gabriel Schneider8 days
| | | | | | | (the snapshot made, decoded, the old emulator let go, the new one installed with its stream, its sequence in flight and pardes's parts), returning the snapshot's hash: what makes two emulators with other histories of pages equal again, since ghostty prunes its history a page at a time against a limit in bytes and a snapshot does not say how its rows were cut into pages (reports/pardes-term-bytes.md, sections 1 and 2; the brief's step 1b; an Ops entry, the core's Term.reload); the sizing's join check as a test of the tree: plain text, a build's log and heavy colour and links (a truecolour a cell, a link a word, marks piled on letters) past a 1 MiB scrollback at 120x40, cut at random read boundaries: with every side reloaded (the session, a replica there from the start, a joiner loaded from the session's snapshot after) the same snapshot bytes, digest, marks and replies after more bytes and again after two reflows, 6 of 6 joins; without the reload the heavy joiner is another terminal, 2 of 2 (the pages pruned otherwise); term-test 17/17, core-test 848/991 (143 skipped), shell-test 1027/1030 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* Term: a terminal's stream keeps the sequence its program began and has not ↵Gabriel Schneider8 days
| | | | | | | ended (ghostty's continuation, up to 64 KiB: a CSI, an OSC, a UTF-8 codepoint, a kitty graphics chunk), its snapshot carries it and a load feeds it again, so a snapshot may be taken between any two reads (docs: reports/pardes-term-bytes.md, section 1; the brief's step 1a): ghostty promises it for its standard handler only, and a test pins it over pardes's MarkedHandler, a cut at every byte of a CSI, a link, pardes's own OSC 133 marks, a UTF-8 codepoint, a kitty graphics payload and three device queries (on the tree before: the first cut, inside the CSI, came to another terminal); the parse's cost with tracking on, pardes-perf --terminal-mib 8 and 32, instructions:u, three runs each, off and on alternated in one tree: 3,924.06M -> 3,924.09M and 13,202.27M -> 13,202.58M (+0.001%, +0.002%); term-test 16/16 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core: the rollback's two faults read by the probe (pardes-probes P4 b), each ↵Gabriel Schneider9 days
| | | | | | | shown by a test that fails on the base, and fixed: (a) a terminal's kitty-image cache (TerminalImages.converted, RGBA made of an RGB or grey image) was made with the drawing core's allocator, so on a far client, whose emulator is outside its rollback epoch, a frame drawn under a speculation left the emulator holding epoch-born memory that the rollback freed (reachable since a closed terminal brought back loads the session's dump of it, its images with it): the next frame read the freed map (SIGSEGV in TerminalImages.draw on the base), so the caches are now the emulator's own allocator's and a terminal's close takes none; (b) a far client's slot of a kind whose state is not plain was on the C heap (initDump's image_allocator), so its own Del of such a pane freed the slot outside the epoch, and the rollback by another client's unit put back a pane pointing at it (a general protection fault in Jump.trackJump on the base), so a far client's image_allocator is now its epoch, as every other of its allocators: the free is put off and the Del stays instant; two tests at the end of core/replica.zig; tui core-test 824/966 (142 skipped), shell-test 1001/1004, pane-test 183/184, behaviour-test 274/274 and --replay 274/274, process-test 2 of 144 failed (lspcomplete, lspcompletemoved; winch failed once under load and passed alone), replicas --clients 5 diverged 0 unequal 0 deltas wrong 0 quiet differ 0 at 30/80/207 ms, gui unit-test 1598/1602 with its perf check passing, daemon.py plain, --far and --games pass (--games once timed out at its teardown and passed again; --window-clients failed on the gate's own TMPDIR, a socket path past 108 bytes, and passed on the next change) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core: src/ becomes core/, pardes.zig its root.zig (the reorganisation's ↵Gabriel Schneider9 days
tree, step 2d), and every mention of a src/ path follows: the build's paths, the core's imports of its root, the tests that read the repository's files by path (lspbench's, look.zig's spans over core/look.zig), the comments that cite files, the documents and the manual (the typst corpus reads core/tutor.txt and core/plumbing); left as they were: the /src tree's served names (src/pardes.zig and the rest are the 9P tree's, not the repository's), the CHANGELOG's history, fixtures that are only strings; fs-unit-test runs from the core's root (a module of the core rooted at fs.zig had the runtime's and the devices' `core` be fs.zig); nothing else changes: the ledger (pardes.test.* now root.test.*), frames byte-identical, replicas and process-test the base's Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T