summaryrefslogtreecommitdiff
path: root/core/ninep/pty.zig
Commit message (Collapse)AuthorAge
* Core, Term: a terminal's emulator and pty are resized once a step and its ↵Gabriel Schneider39 hours
| | | | | | | burst of inputs, at the size the layout settles on, never once a key: a level that borrows a shell's rows and gives them back in one burst resizes neither, and the shell keeps its prompt line (agent M1's find, ymkwwwnn 94f00e966c90: ttyhelp's row 3, the shell's `$`, blank after `SPC ? tutor`); THE CAUSE: Pardes.sync, at the end of every `update` (a key), resized each terminal whose rect changed (Pane.resizeGrid, Term.resize) and queued its pty's resize; `?`'s level takes 3 of the shell's rows (layout.floorRows), `tutor` in the same read gives them back, so the emulator was reflowed twice, and each reflow cleared the prompt line under its cursor for the shell to draw again (ghostty's Screen.resize, clearPromptForRedraw under Terminal.flags.shell_redraws_prompt); bash, told twice with no gap, reads its size once, finds the one it had and draws nothing (the pty probe, .scratch/walkui/T123/bashprobe.py, bash 5.3.20 with pardes's mark: resized 17 -> 14 -> 17 with no gap it writes no byte; 0.3 s apart it writes `\r\e[K\r` and its prompt twice); THE FIX: `sync` is `layOut` (the geometry, every pane's cols and rows, the bands, the greetings) and `sizeTerminals`, which gives each terminal its pane's size when its emulator has another (Term.grid's cols and len: no new state, nothing in the dump), resizes the grid and queues the pty's resize; `update` lays out only, and `settle` (a pump's, a replica's step) sizes the terminals after its queued inputs and before the effects; a 9P request's step (serveFs, a kbdin write of many keys among them), a view's open and close and a watched file's reload keep the whole `sync`; `toView` sizes them before the live view parks (a terminal is sized by one view, `sizes`); a step's own layouts in its middle (a picker's first preview, Pick's showText, showKind and putBack, Query.displayPreview, Store.reopen, jj.open, layout.givePaneRows) call `layOut`; RUN (TEST FIRST): Core.zig "a level that borrows a shell's rows and gives them back in one burst of keys resizes neither its emulator nor its pty ..." boots ttyhelp's layout in the core (100x31, a shell over the +New), gives the shell pardes's bash prompt, focuses the +New and types SPC ? t u t o r with one settle after: fails on the base (two resize_pty effects queued, the shell's first row blank after the settle), passes now; three tests that fed a new shell before any step's end sized it get a `sync` (two in Core.zig) or a `settle` (ninep/pty.zig, pty/ctl's winsize read back after a resize), Term.zig's S1 table counts Core.zig's third Term.grid; the ttyhelp golden re-recorded: row 3 is the shell's `$` again (its leaderworks snap lists 6 rows, not 7); THE MARK (the ruling's second part): ghostty's own bash integration (the genizah's, and the pinned 1.4.0's) marks bash's prompt `133;A;redraw=last;cl=line`: `last` clears only the cursor's line on a resize (bash redraws only a prompt's last line), so it would not have kept M1's one-line `$` either, and ghostty never says `redraw=0` for bash (a narrower reflow would leave the old wrapped rows under bash's redraw): the mark is unchanged (`redraw=last` would keep a multi-line PS1's first lines through a real resize: a separate change, not made); a user hit it whenever a pane beside a shell at its prompt borrowed its rows and gave them back faster than the shell read its size; NEW HOT PATHS: settle and toView walk the panes once (a terminal: Term.grid, its two sizes compared), where sync did per step before; GATES: core-test 1129/1303 (174 skipped: +1, the new test needs a terminal), shell-test 1351/1354 (3 skipped: +1), pane-test 183/184, behaviour-test 285/285 and --replay 20 seeds of 70 steps, 0 failures, process-test 1 of 147 failed (3 skipped): ttyhelp, the golden re-recorded, then 5 of 5 runs alone pass, term-test 17/17, kitty-test 45/45, the gui unit-test 1959/1963 (4 skipped: +1; its perf check's BaselineHarnessMismatch, every base's); no dump change (no new state; effects are local); no frame or perf gate (the user's rule of 2026-11-26); the shots (S kit, 26 px, .scratch/walkui/T123/png): after-0..3, this change's Debug gui: ttyhelp's bare boot, the +New clicked, `SPC ? tutor` in one pty write: the prompt stays on row 3 and the level ends on the +New's tag row as in the golden; before-0..3, the installed stage's (install74): that build's level keeps 7 of the shell's rows after `tutor` (it predates W1's floor), one shrink that bash redraws, so it does not show the fault; load 4.5 to 9.0 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
* replicas: one decision a unit, by one count in the core ↵Gabriel Schneider5 days
| | | | | | | (pardes-term-join-11, item 2; P54, the coordinator's lean, held against the code first): `Replica.confirm` asked one question four ways from three sources ("did applying this unit write state outside the rollback copy, an emulator?"): the speculation's own observation (`Pending.terminal` from `Tape.touched`, set by `touchTerminal` at a grid it owed and at every READ of a terminal's rows), the unit's records (`tape.feedsTerminal`), a process-wide counter (`Term.writes`, seven increments, shared by every side of the soak's one process) and a dead read (`read_terminal`, always false); round 10's predicate over the records failed because no record names the unit whose `sync` reflows a grid, a load or a teardown; now the core counts its emulators' writes itself (`Pardes.outside`, a `Term.Outside`): a field, so copied with a speculation, digested and dumped, a function of the tape, the same on every side; every write of the `calls` table's WRITE rows takes it first and counts (core/Term.zig `open`, `close`, `revive`, `reload`, `feed`, `resize`, `endOutputHere`, and `replies` when it drained any), a comptime block fails the build if a WRITE row's entry does not take it (the compiler holds the call sites; S1's `calls` test holds that a new write is listed); `resize` owes under a speculation (counted, not made: the grid's guard moved there from panes.zig `resizeGrid`); a load sets it (the walk loads the field; `dumpRead` counts nothing); the one read in `confirm`: on the fast path the count's movement over the input's speculation (`Pending.outside`, a number, equal to the unit's by the path's premise: moved, the unit is replayed once on the confirmed core), on the replay paths its movement over `replayUnit` on the core that applied it (moved over a copy held ahead, the copy goes), and on the neutral path no read at all: the session's digest after the unit holds the count, so a unit that wrote an emulator never ends where it began (`feedsTerminal` deleted with its one use); the predicted echo is judged at every unit that moved it; DELETED: `Tape.touched`, both `touchTerminal`s and the read-touch in edit.zig `shellRows` (a read writes nothing outside the copy; on the one road a speculation reads the confirmed emulator), `Term.writes` and its seven increments, `feedsTerminal`, `read_terminal`; where the lean does not stretch, said and not built: a picture's pixels, a kind's state and the Store's closed list are written BY a speculation, so the fast path must let the copy go, not replay: `panesMoved`, the serials and `retiring` stay for them; the dump changes (a core field): the wire stays at 31 (its history line says so); tests: the existing path tests green (fast, neutral, ahead, owed grid, "a view that sized a terminal closing leaves nothing queued ..." among them); new: a session's reflow of a terminal's grid over a copy held ahead is the count's to decide (a unit with no output record: the copy goes, a rollback does not reflow again), and the count digested (one side's emulator written outside any unit, a colour set no other digested field shows: `partsApart` names `outside` alone); core-test 917/1079 (162 skipped), shell-test 1121/1124 (3 skipped), the gate below 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
* ninep: a client that joins a session with 9P work under way has the 9P state ↵Gabriel Schneider7 days
| | | | | | | the session has: what a step reads that the requests made is the core's state like any other (P30, P35), so the walk sees it: fs leaves Pardes's and Pane's authority lists and the 9P server's own part says so in its types (fs.Namespace: the sockets, mounts, log, the request being served's flags and the rest; pane.State: the event and pty readers' queues and counts, winsize, unannounced; Open: the listener's held read and a stream's last answer; LogOpen whole), so the open records, the writes held to go in as one edit (fs.batch) and each pane's addr, limit, dot truncation, wrsel, joined, nomark, noscroll, lock, run, unmarked, tag truncation and chord are in every dump and in the digest; the digest is cheap by type: a pane's 9P state adds nothing for a pane no script has touched and its fields as one run of bytes for the rest (pane.State.digest), the namespace the opens in use and held writes by their length (Namespace.digest: a 9P body append hashed its whole batch, +0.14% on body-appends), so the frame and perf gate's 121 per-operation counts are within 0.1% of tree2 (largest client-key-down +0.054%; the plain walk of the same state cost client-key-down +0.73%); an open's union is named (Open.What) and digests what a step reads of it (its kind, a run, an event reader's flag, a pager's serial, a port's index), never the text its reader is answered with, which each process makes of its own state (walk.hash takes a tagged union's own digest as it takes a struct's); the opens are taken as far as fs.opens_len (an idle session's none; the scans that read records bound by it, openOf too, and an open lets go of what a rollback left in its record past the length); a session revived from a dump (Restore, an Upgrade, a start from one: dump.loadAndRevive; a closed pane brought back: loadPane) drops the opens and each pane's 9P state, as today, its connections gone (fs.Namespace.forget): a client's join loads alone and keeps them; not the join's dump alone: the tape's dump round trip at a replay's end wants the image to carry what the digest covers; pty.Run's answer cut at its length; the wire version 24, so the semantics word moves 64e89d6b25a84796 -> 18636a639ac075de (it did not move with the walk alone: a base client would have digested other fields than its session; test/daemon.py's WIRE with it, and its upgrade case takes a client of the other side's protocol saying `run the same pardes at both ends`, as its third terminal already did); the eleven tests of the change before pass; a join's dump (the probe, Debug): idle 63258 -> 64612 bytes, 50 opens held 63270 -> 66744; the image idle 233426 -> 237001, 50 opens 233738 -> 295089; tui core-test 867/1022 (155 skipped), shell-test 1062/1065, behaviour-test 275/275 and --replay 275/275, replicas --clients 5 diverged 0/0/0, unequal 0, unlisted stops 0, corpus 22 of 22, no leak (load 30-40, before the digests were made cheap; the whole gate on the change after) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* integration: a client that joins during a 9P pty/run replays it as its ↵Gabriel Schneider8 days
|\ | | | | | | | | | | | | session does, and a far client's Del question is instant, on the build's second pass: pardes-faults-3 (a 9P open's handle is the session's recorded answer; a run reads its terminal's prompt marks through the tape's prompt site; a rejoin that lands as the session ends says so; Del sets question_asked and the host's pump gives it its time: the step reads no clock, so the bytes soak's one stop off may_wait, now, is gone) and pardes-merge32, merged without a textual conflict; the coordinator's gate in the ledger (reorg/merge33) Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * ninep: a client attached while a script's pty/run runs in a shell replays it ↵Gabriel Schneider8 days
| | | | | | | | | | | | | | as its session does: the open's handle is the session's 9P server's answer (tape.authority), not the client's first free open record, which a client joined since (holding none of the opens made before its join) chose otherwise, so its write named no record and its run never went (the base, the attach agent's probe: 6 of 6 runs a client diverged, "the core called prompt where the tape has a done"); and a run's step reads the shell's marks through the tape's prompt site (pty.marksOf, as the greeting and the run's answer did), not the emulator here, which on a client of screen-state terminals is the last delta's and comes a frame after the unit that replays the output (with the handle alone 3 of 6 still diverged: sent_command's count and the busy check read marks behind the session's); Pane.noteCommand takes the count from its caller; a client whose rejoin lands as its session ends goes as at a hang-up, in the same words ("let this client go"), never "could not join again: the session hung up before the dump was whole" (replica.ended: hung up, nothing answers, no such session); tests: a client joined from a dump with a listing open held across the join takes a run as the session does (failed on the base: its digest), the same with screen-state terminals and their deltas after each unit (failed with the handle fix alone: "the core did not make the host call the tape has, in output"), and the rejoin test says a session gone and one hung up mid-dump are its end; the tape's results list Term.Prompt, so the semantics word moves: 7a610621b2f37456 -> 92963bab2e4436fb; probe (exitclient.py, 6 runs): 0 of 6 diverge, 0 of 3 with a digest every unit (PARDES_REPLICA_TRACE); a pty/data-only variant diverged 0 of 2 on this build too; tui core-test 856/1009 (153 skipped: the two new tests need a shell), shell-test 1049/1052 (load 15-20) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | tape: the 7 free calls the same under either terminal design on the handle, ↵Gabriel Schneider8 days
|/ | | | | | | step 8a (reports/pardes-handle-69-design.md section 4): a terminal's output, its close (the poison and the refusal) read p.tape, the refusal to open one moves out of createTerminal into its two callers (newShell, newCommand: no parameter, no test changed), and the session's fonts and its shell checks (exec's Font and Shell, a 9P exec) are p.tape.site; the 3 the bytes would delete and the 11 that wait are left; the tape's bytes do not move (semantics 32640d4a722b811c unmoved, cross_replay both ways) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core, docs: the control tree's test harness is core/ninep/harness.zig, no ↵Gabriel Schneider8 days
| | | | | | | longer core/ninep/testing.zig (P18, the user's ruling on the tree step's name collisions: the file's name collided with the future `core.testing`): the file moved whole in this change, so its history follows it (no line of it changed), and its 27 imports follow, nine `@import("testing.zig")` in core/ninep (addr, cols, ctl, events, pane, pty, screen, sources, tree) and 18 `@import("ninep/testing.zig")` in core (Addon, Core three, Dir, Effect, Query, dump three, edit_cmd, fs, keys, look two, mouse, sam_edit, tape), with the two design notes naming it (docs/next-tests.md, docs/next-terminal.md); the build and the root's test lists never named it; a rename only, nothing else on any line; tui core-test 848/991 (143 skipped), shell-test 1027/1030, the window builds (`install -Dplatform=gui`), the macOS library for Linux and aarch64-macos and the FreeBSD cross-build rc 0, under a load of 22 to 60 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core, dev: what carries a slot across the core's edge carries its type (P21, ↵Gabriel Schneider8 days
| | | | | | | pardes-ids change 3): `Pane.Id` in Event's six variants that carry a pane (output, eof, exited, file_changed, addon, job), in the fourteen effects that do (spawn, write, resize_pty, signal_pty, close_pty, start, save_file, save_text, lsp, watch, dump_themes, detach, addon, job), in the fourteen Host functions that take one (dev/Host.zig: adopt, upgrade, spawn, pty_write, pty_resize, pty_signal, close_pty, tty_taken, fg_name, kill_job, write_file, watch_file, dump_themes, job; tape.zig's Wrap follows with no edit), in the device messages that carry one into the core (the inbox's output and eof and the five reader functions that make them, dev/Lsp.zig's Request, host_io's Adoption and Adoptions.take, which hold what adoptShell answered); `View.Id` in abi/wire.zig's welcome.view (its bytes on the wire unchanged: one byte, hand-encoded, `.at(takeByte())`/`writeByte(view.index())`); every producer converts at its own line (`.pane = .at(id)`, a script that refuses any path outside the workspace, `fields.py`), every consumer where it indexes or compares (`o.pane.index()`), every Host implementer at its own first line (`fn spawn(ctx, id: pardes.Pane.Id, ..) { const pane = id.index(); ..}`: the terminal's 14, the window's 14, the Mac's 10, and the tests' hosts), and an id that went integer and back is passed through whole (`s.core.readerFailed(e.pane, err)`); the compiler caught no pane's slot passed as a view's or the reverse, only integers meeting the type; kept integers on purpose: KindJob.pane (core/Kind.zig, another agent's, reads it four times; converted at KindJob's and Effect's lines), the Watch table (file_watch: its last slot is the theme's, no pane), the hello's view and the replica's Peer/Joined/Replica views (core/replica.zig, another agent's), the C ABI's `pardes_watch_changed(uint8_t pane)` (abi/pardes.h unchanged; runtime/macos.zig converts at its Host functions); in files another agent is in, each conversion on the line that was there: core/Kind.zig 2 lines, core/Addon.zig 4, core/replica.zig 31 (the welcome's view, 3 test hosts, test literals), test/replicas.zig 12 (4 host functions with their first lines, 1 signature, the welcome's view, 5 literals); the tape's shape moves (Event is update's input), so the semantics word moves, c47ecf638b3f4b9f -> 38b5ae573b965550; test/perf.zig follows on 6 lines its Event and effect literals forced, so its harness id moves, be7cc504010471bc -> 1ed95030eb768eae (unit-test's perf check was BaselineHarnessMismatch already); 607 lines added, 562 deleted in 48 files. Gate (load 4 to 8): tui core-test 841/984 (143 skipped), shell-test 1020/1023, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds of 70 steps, 0 failures, process-test lspcomplete and lspcompletemoved (the base's; hscroll failed once and passed on the runner's retry), gui unit-test 1618/1622 (BaselineHarnessMismatch, the base's); replicas --clients 5 (TMPDIR /tmp/claude-1000/ids): diverged 0, unequal 0 at rtt 30, 80, 207, deltas checked/wrong 1811/0, 1838/0, 1660/0, quiet checks 567/0, 650/0, 655/0, stops not on may_wait 0 (corpus through a client fails at step 21 as on the base with that TMPDIR); daemon.py plain, --far, --games, --window-clients, --upgrade both ways against pardes-tree's base prefix pass (the semantics words differ: the upgrade carries the session by its dump); test/cross_replay.py (tui records, gui replays): 27 digests agree in each of three replicas; rollback-bench runs; the macOS library for Linux and aarch64-macos and the FreeBSD cross-build build; frames (gpu/ids-3 against tree1) 77/77 byte-identical in Debug, unit-test 1618/1622 there, perfab corpus2x -0.021% (session noise 0.036%, threshold 0.4%), pictures identical in all 10 runs, perfops 97 counts within 0.1% (largest image-frame on longline +0.0231%), key-down on medium 10,040,108 -> 10,039,990 an operation (-0.0012%), render on medium 11,455,765 -> 11,455,683 (-0.0007%), terminal on all +0.0030% Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core: the entries that take or answer a slot take and answer its type (P21, ↵Gabriel Schneider8 days
| | | | | | | pardes-ids change 2): a pane's slot is `Pane.Id` in the twelve entries that took it, six as `usize` (setCwd, acknowledgeShell, setMessage, setStatus, reportError, noteLateFailure) and six as `u8` (readerFailed, shellFailed, restartFailed, saveFailed, reloadWatchedFile, File.deleted), and in what adoptShell answers (`?Pane.Id`); a view's slot is `View.Id` in closeView, leaveView, awayView, rejoinView and the hand-written toView (its `to_view` variant is `Pardes.View.Id` now, and its replay arm unchanged) and in what openView answers (`?View.Id`); the tape's other variants follow their inners' types with no edit (`Args`); each inner converts where its body indexes (`id.index()`), passes the id itself to another entry, and the core's own code stays integers; every caller converts at its own line, `p.reportError(.at(id), ..)` (the decl literal of the parameter's type), 514 calls in 56 files written by a script that refuses any path outside the workspace (`.scratch/sketch/reorg/pardes-ids/wrap.py`), 46 `.index()`; nothing the compiler caught was a pane's slot passed as a view's or the reverse: what it caught were a script's wrong guesses (Editor.reportError(err) and macos.zig's own reloadWatchedFile, same names, undone) and the integers a view's id met (views.zig's tests, replica.zig's Authority and Peers.join, host_io's Adoption); in files another agent is in, each conversion on the line that was there: core/Kind.zig 5 lines, core/Addon.zig 4, core/replica.zig 23 (Authority.openView and join, closeView/toView/awayView/rejoinView/leaveView calls, Peers.join's `openView`, tests), test/replicas.zig 1; the tape's records are smaller (a `usize` is a byte in six inputs) and its shape moves, so the semantics word moves, 313a99190b93a8c5 -> c47ecf638b3f4b9f; test/perf.zig untouched (its harness id does not move); the Mac: runtime/macos.zig 16 call lines, abi/pardes.h unchanged; 581 lines changed in 56 files, no line added. Gate (load 4 to 28: a drat build and other agents' gates beside): tui core-test 841/984 (143 skipped), shell-test 1020/1023, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds of 70 steps, 0 failures, process-test lspcomplete and lspcompletemoved (the base's), gui unit-test 1618/1622 (BaselineHarnessMismatch, the base's); replicas --clients 5 (TMPDIR /tmp/claude-1000/ids, alternated with the base twice, both pass both times): diverged 0, unequal 0 at rtt 30, 80, 207, deltas checked/wrong 1811/0, 1838/0, 1715/0, quiet checks 567/0, 650/0, 544/0, stops not on may_wait 0 (its corpus-through-a-client scene fails at step 21 as on the base with that TMPDIR); two earlier runs of this tree under a load of 10 to 28 ended in a leak of Places' compiled regex (Places.derive from Query.produce) and one rtt-207 run in an assertion in mouse.kindMouse's clamp during a client's speculation, the leak not seen in the eight runs of this tree after them (the full soak, each rtt alone, single seeds), the assertion not in the two full runs after it, and neither in three full runs of the base (by reading neither touches a slot: in the report); daemon.py plain, --far, --games, --window-clients, --upgrade both ways against pardes-tree's base prefix pass; test/cross_replay.py (tui records, gui replays): 27 digests agree in each of three replicas; rollback-bench runs; the macOS library for Linux and aarch64-macos and the FreeBSD cross-build build; frames (gpu/ids-2 against tree1) 77/77 byte-identical in Debug, unit-test 1618/1622 there too, perfab corpus2x -0.059% (session noise 0.134%, threshold 0.4%), pictures identical in all 10 runs, perfops 97 counts within 0.1% (largest image-frame on longline +0.0274%), key-down on medium 10,040,104 -> 10,039,959 an operation (-0.0014%), render on medium 11,455,764 -> 11,455,707 (-0.0005%) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* core: the session's facts are the core's state, read once at its start (the ↵Gabriel Schneider9 days
| | | | | | | reorganisation's 12b, the design round's step 3; the user's ruling P16 and the lean put with P17: a far client's `~`, default shell and "is this shell installed" are the session's): its home (`~`) and the shell its terminals run when no `Shell` is set ($SHELL if executable, else /bin/sh) are fields beside `session_dir`, `session_home` and `session_shell` (working names, the user's to rule), each read once with `session_dir` by Pardes.readSessionFacts (tape.value(.env): a replay of the boot reads the session's answers), at the session's start and after a load of a dump made before they were dumped, and carried by the dump; `sessionDir` no longer fills itself at first use (it was filled at the start already), and a client's step reads the session's, never its own machine's: Pardes.expandHome (`~` the session's home; `~user` a passwd read, taped, as before) at Save, a tag's name, Theme's path, Get, Incl, a Look of `~/x`, a 9P name and pager, Dump's path, sam's B, e, r and w (sam_edit.World.home) and DumpDir's check (config.Runtime.apply takes the home); bare `Shell`, the shell a terminal runs, the settings report and its 9P twins read `session_shell`; "is this shell installed" (Shell <bin>, Term <bin>, a 9P exec) is a question to the session's disk, tape.site, so far away it waits a round trip instead of answering from the client's machine and rolling back; deleted: the value reads at config.defaultShell (now the process's read, made at the start alone) and at Core.sessionDir, and the tape's `cwd` tag (the directory is read under `env` at the start); fs.expandHome stays for this process's own home, the launcher's (runtime/main.zig) and the state file's directory and a Restore's name (the session's side: a client's Restore waits, its replay reads the tape); the tape's shape changes (`cwd` gone, `shell` a site), so the semantics word moves (the tape's shape now hashes the sites too: it did not see a site gone or added, and this change alone left it as it was), adacca2db2b39264 -> 517cd1c276996a3c: an old build and a new refuse each other's clients, in words; a test at the end of core/replica.zig (a joined client's own `Look ~/x`, bare `Shell` and Tutor, a word run in the session's directory, record no `env` read; the client's shell and directory are the session's), shown failing on the change before (`Look ~/x` read the environment); not handled: a Restore of a dump carries that dump's facts (as `session_dir` did); tui core-test 833/976 (143 skipped), shell-test 1011/1014, pane-test 183/184, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed (lspcomplete, lspcompletemoved, the base's; hscroll flaked once), replicas --clients 5 diverged 0 unequal 0 deltas wrong 0 quiet differ 0 at 30/80/207 ms, stopped 89/73/108, gui unit-test 1609/1613 (its perf check's BaselineHarnessMismatch the base's), daemon.py plain, --far, --games, --window-clients pass; gate-w seam-b-3 against tree1: 77/77 frames byte-identical in Debug, its unit-test 1609/1613, perfab corpus2x +0.095% (pictures identical in all 10 runs), perfops 97 counts within 0.1% (largest +0.0198%, body-appends on longline) 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