summaryrefslogtreecommitdiff
path: root/runtime/client.zig
Commit message (Collapse)AuthorAge
* link: a far client that falls behind dials again, as before round 1 (the ↵Gabriel Schneider5 days
| | | | | | | coordinator's ruling P63a): `Link.backHere` says no for a link that crosses machines (`Link.far`, set by runtime/client.zig from its `Have`) and fell behind `behind_max_ms`, so that client says its goodbye, shuts its link and dials again through the daemon, a new connection that drops what the old one holds for it; every other way back (a divergence, a near lag, a cut, a refused load's ask) stays on the link; marked in the code as the second road it is, with what replaces it (bounded flight: the session never more than a window past what its client has taken); the failing row first: test/daemon.py `--far` on ReleaseSafe 6 of 7 on round 1's tree (`far_flood`: over its own link the far client read through all the relay held for it, agreeing 49-68 s after `yes` against 22.7 s by a dial); `far_flood` now asserts the far client behind took ANOTHER connection; the lag test asserts both roads (`backHere` near yes, far no) ; gated with the next change as its tree (g1, rnllpvzw fd3730201cb3): `--far` on ReleaseSafe 7 of 7, far_flood ANOTHER connection each time and agreed 22.3-26.0 s after `yes` ended (Debug 25.3 s), every other row as before: core-test 931/1095 (164 skipped), shell-test 1137/1140 (3 skipped), process-test 0 of 146 failed both ways, the soak x3 and --pair x3 clean, daemon.py every mode on both builds, the upgrades 12 of 12, frames 77/77 and 121 counts within 0.1% against tree6, the cross-builds Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* merge: round 1 of a link's lifecycle (pardes-link-1, `nlqrtuns`: a client ↵Gabriel Schneider5 days
|\ | | | | | | | | | | | | whose link is up comes back over it) onto the dump and the digest (pardes-m63-base, `xxvnuywy`: the installed tree + the one decision + a join's digest taken with its dump, a refused load naming its field), the two implementations of "a refused load names its field" made one: the dump line's naming kept (every join's dump ends with the session's digest a field at a time, `dump.joinParts`, read by `loadDiffers`), round 1's deleted (the wire's `ServerTag.parts` 0x0d and `ServerMsg.parts`, a bye's byte 3 and `ClientMsg.bye.parts`, `Peer.fields`, `Peer.parts`, `Peers.partsOf`, `Peer.writeParts`, the `Parts` read in `loadAgain`, `comeBack`'s `parts` argument, `fromDump`'s second naming from that message); round 1's road kept (`fromDump` asks once more over the same connection, `loadAgain`, `joinOn` reading on to a welcome); the conflicts: abi/wire.zig's 31 line (both sides' sentences, round 1's without `parts`), `Peers.join` (the dump line took `dumpJoin`'s `.{ bytes, digest }` inline where round 1 had split the dump and the welcome out, `Peers.dumped` and `Peers.welcome`: `dumped` now returns the bytes WITH the digest `dumpJoin` took at the dump's moment and `welcome` takes that digest, so a join again over the link (`dumpAgain`) has the dump line's guarantee too, where round 1's `welcome` read `tape.digestOf(core)` after the dump), `fromDump` (the dump line's named refusal and round 1's loop: now the first refusal names its fields in the log and asks once more, a second, or a link that cannot ask (its words kept, `j` and its dump the caller's), gives up naming them in its words: "the session's dump loaded as another session twice: fs differs"); `loadAgain` asks before it lets the dump go (the dump line's test hands `fromDump` a dump of its own and no link: it was freed); semantic conflicts looked for: the one decision's `Replica.confirm` and core/tape.zig (`feedsTerminal`, `touchTerminal`, `Pending.terminal`, `shell_rows` gone): nothing of round 1's used them; the rollback copy's walk: `Peer`'s and `Link`'s new state (`gen`, `written`, `back`) is outside the core it walks (Peers and Link are the engines', not `Pardes`'s fields), nothing to declare; tests: round 1's "refused twice" made from the dump's own parts (its first field's word changed in the dump, no message), the dump line's "says which field" given the session's name argument; root.zig's machine_lines for replica.zig 90 -> 89 (`loadAgain`'s close gone); core-test 930/1094 (164 skipped: the base's 924/1088 and round 1's six), shell-test 1136/1139 (3 skipped: the base's 1130/1133 and round 1's six) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * link: a client whose link is up and must take the session's state again (it ↵Gabriel Schneider5 days
|/ | | | | | | diverged, fell 2 s behind, or the session cut it off 64 MB behind) comes back OVER THAT LINK, the daemon not asked: its goodbye that says `again` and today's hello for its view in one write (`replica.comeBack`, runtime/client.zig `Loop.run` when `Link.backHere`), its reader letting the stream it leaves go (units, blobs and checks not even copied) and stopping at the session's welcome there, put back at its framer's front for the join's reader (`readLink`'s back mode, `Framer.putBack`), the join read on that framer (`joinOn` takes it; `replica.join`'s `here`); on the session the reader reads on after a `bye` that says `again`, a hello after it is the same client back (`Peer.take`, inputs numbered afresh), and `Peers.joinAgain` dumps for it there with what the old road put on the tape (`awayView`, then the join's `viewFor`: every side's terminals reloaded in that step), what was queued for it let go, the cut over; one writer loop writes a join whenever one is due (`Peer.gen`, `Peer.written`; the `.joined` note carries its gen so a stale one releases nothing), what it was sent a MiB at most a write at a message's end (`writeOut`) so a join due waits for no more of the old stream, a far client's old zstd frame ended before the welcome; a cut keeps the link (its words, then nothing until the hello); a link that ends before the welcome (an Upgrade's or a Restore's words: the session closes it), or one gone, is dialled again as before: the one case left for a redial; and a client refused its own load (`fromDump`) asks ONCE more over the same link with the session's digest a word a field after that dump (wire 31, nothing at 31 installed: a bye's byte 3 = `again` + `parts`, a new ServerTag `parts` 0x0d) and only then gives up, naming the fields that differ in its words and its log; the failing run first: test/daemon.py's new `pair_back` (a no-daemon pair whose client diverges, and one stopped 3 s while the session is edited) on the installed build 79b73e14711e: "the client and the session went (client exit 1)", "'diverged' let this client go", on this tree both join again over their own link, the session alive, the unsaved text there, agreed; `clients`: client D's socket the same across its rejoin, the session counting 6 joins, 1 over a client's own link and 5 handed by the daemon; `far_flood` (20 KB/s, 200 ms): the same link after 3 joins again of 0.56 s each against a dial each time on the installed build (0.99 s each), but agreement 68.6 s after `yes` ended against 22.7 s: the client reads through what the relay holds for it (the relay buffers without bound; ssh bounds it by its window), said in reports/pardes-link-lifecycle.md; `Peer.rejoin` and `hungUp` stay for the one road that still dials after a goodbye saying `again` (a client of another build exec'ing: `sameBuild`), their test rewritten for it; core tests at the replica's surface with real link threads (near and far: back over its own link; a refused load asked once more and loaded; refused twice and named, against a session played by hand; a cut client back over its link, the same peer, connection and view); the soak models the road (`ended`, `Soak.joinDown`, the `here` column); core-test 924/1084 (160 skipped), shell-test 1126/1129 (3 skipped), root.zig's machine_lines for replica.zig 76 -> 90 (the tests' sockets and sleeps; the session's one shutdown of a link it will not dump for again, and a close) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* replica: the delta protocol deleted, with the wire's screen messages (the ↵Gabriel Schneider6 days
| | | | | | | old road's deletion, piece 3 of 8): core/replica.zig loses the screen-state section (the screen message's head, `Screens`: tracks, peers, flush, fill, filled, take), `Peers.screens`/`msgs`/`flushed`/`screensOut`/`screensTo`, the `.screen` note and its arm in `boundary`, `Peers.input`'s flushes and fills, a joiner's `addPeer` and a leaver's `dropPeer`, `Peer.sid` and its `screen_ack` arm, `Replica.screen`/`screenRequest`/`screenMessage`/`overTerminals`, `Replica.screens`/`screen_out`/`ScreenOf`, `Stats.apply_ns`, `Said.screen` (and its arms in dev/tui/tui.zig and dev/gui/gui.zig: a delta no longer counts as an echo there, nor is its latency noted), the Link's `.screen` arm and `drawn`'s row requests, `sendScreen`, and the `screens` argument of `Authority.init` and `Replica.init` (every caller: core/jj.zig 10, core/tape.zig 2, core/echo.zig 2, test/panes.zig 15, test/perf.zig 2, runtime/client.zig 1, test/rollback_bench.zig 1, test/replicas.zig 10, core/replica.zig 98); a replica's own `made` no longer starts on screen state, and `confirm` and `applyPending` keep only their one-road branches; abi/wire.zig retires the replica's `screen_ack` (0x04) and the session's `screen` (0x06) as gaps (the version moves once, in piece 4); test/daemon.py's round trip passes over units alone; the tests that were the old road's alone go: a delta under a speculation, a terminal sized again by a client's key (screen state's deferred size), pardes's own keys over a terminal's history and a delta while they wait, a unit kept over a copy and a delta after it, a step's rows sent as a new client's holes, the screen-state twin of the 9P pty/run test, and the 9P open over a copy taken ahead (on the one road a unit that feeds a terminal lets the copy go: `Term.writes`, so no copy is held across the run's output: its premise was the old road's); the others that ran on screen state now run on the bytes road (a kitty image: the client's emulator has it as the session's does; prompt marks and Kill; the far client's may_wait walk, its click into a focus-reporting shell, its backed-up queue; a view that sized a terminal closing; a closed terminal brought back; a leave's queued resize before a join); FOUND AND FIXED on the way (those tests on the one road failed: the far click `expected 0, found 1` stopped, and may_wait named `Del`, `DelAbove`, `Up`, `C-w a`, `click shell`, `Look` stopped at `pty_write`): a client's own step that moved the focus in a session whose shell asked for focus events wrote the report (CSI I/O) through pty_write, which a speculation stops at (`keeps_stopping`), so the key or click waited a round trip, and the session's write was on the tape; on screen state both were skipped (core/Core.zig `reportFocus` skipped the write only `speculating and screen_state`, core/tape.zig `hostCall` kept pty_write off the tape only under screen state): both now on every road (a user on the flip's build could hit it: a far client's click, pane switch or Del beside vim or tmux waited a round trip); core/root.zig `machine_lines` for replica.zig 76 -> 74 (Authority.init's getenv and a joiner's `addPeer` failure's shutdown gone); core-test 911/1068 (157 skipped: 7 tests gone, each one skipped there for want of a shell), shell-test 1110/1113 (the 7 gone) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* client: an Upgrade from the installed build (main 6d937cd125ca) to this one, ↵Gabriel Schneider6 days
| | | | | | | the coordinator's release stage: a window exec'd at an Upgrade takes its size from PARDES_JOIN_SIZE (runtime/client.zig `execAgain`; dev/gui/gui.zig where `--geometry` is read), a string a test finds in the binary as PARDES_JOIN_VIEW is: test/daemon.py `knows_size`, and `pair_window_geometry` skips with a line said when the old window cannot pass its size (the installed build's: by design, its exec is the old client's); a far link cut with no last word dials again too (`replica.cutListed(why, session, far)`: the dial is the asking, the far daemon's "no session called" ends it), as near ones do since item 0: from the installed build `far_exec` lost its client before (2 of 6 runs) and still does once in five (the old far client is the installed build's code); a far client whose ssh link drops now dials again for up to 20 s before it says so Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* client: a link an Upgrade's exec cuts with no last word joins again: ↵Gabriel Schneider7 days
| | | | | | | `Peers.refuseAll` queues each client's `refused` after what it is still being sent and gives the writers 200 ms (`flushed200`), then `drop` cuts every link, so a client whose join's dump was still on its way read the cut as its session's end and exited 1 ("'NAME' let this client go"), with PARDES_PAIR or without (a `new --detach` session holding a 100 MB file, the Upgrade written as the attach is listed: 3 of 3 on main's ReleaseSafe build, 3 of 3 Debug); now a near link that ends with no last word asks this machine's daemon whether its session is listed still (`replica.cutListed`), and listed, joins again as one told `upgrading` (runtime/client.zig `Loop.run`; a first join cut mid-dump likewise, `replica.join`), so no flush bound decides a client's fate; a patient redial stops at once at "no session called" (`redial`: a session killed outright costs no 20 s of dialling); a far client and a no-daemon pair ask nobody (nothing changes); test/daemon.py `attach_upgrading` gains the round (two attaches to a 100 MB session, the Upgrade written as each joins; plain mode and --attach-upgrading): failed on merge48's builds, passes on both builds; tui core-test 885/1045 (160 skipped) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* integration: the pair's finished steps on the gathered line: pardes-pair-4 ↵Gabriel Schneider7 days
|\ | | | | | | | | | | | | (`rustnvoo`: an attach handed to a session as it upgrades is told so and joins the new process; the fast start, the boot as input zero: the wire at 27; a window client exec'd at an Upgrade comes back the size it was) and pardes-merge47 (`rprvwpnv`: the terminals' line at 26 and the library for a browser reader); three textual conflicts: abi/wire.zig's history says 27 and 26 each in its own words and the version is 27, test/daemon.py's WIRE is 27, core/replica.zig's Link keeps both lines' fields (the lag bound's `behind`, `least`, `fresh`, `lagged`; the pair's `held`); core-test 885/1045 (160 skipped), shell-test 1087/1090; its gate: .scratch/sketch/reorg/merge48, the numbers in PARDES.md (2026-11-21) Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * client: what the pair's last rounds left, each a test first: a window client ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | exec'd at its session's Upgrade comes back the size it was, not the default (runtime/client.zig `execAgain` passed `--attach=` alone, so the new process made a 1120x720 window: a `--geometry=900x560` pair's session went from 56x16 to 70x20 after an Upgrade to another build, with the variable or without (any `pardes-gui attach`); now the window's size at the exec, SDL_GetWindowSize, as `--geometry=WxH`); a pair's client exec'd at an Upgrade waits for its session at `ended` as before the exec (tui.zig and gui.zig `runClient` asked `opts.pair`, which the exec'd `--attach=` client has not: now every near client waits, a non-child answers ECHILD at once; not seen to fail here: the subreaper took the session first); tests in test/daemon.py: `pair_upgrade_views` (plain, --pair: two clients' own views, the pair's scroll and the attach's focus, the same after a same-build Upgrade: the screens by pyte, the focus by where typing lands: passed before this change too), `pair_exec_reaps`, `far_exec` (a far client, PARDES_REPLICA_FAR by the socket's path, execs the build at its start path and agrees after: passed before too), `pair_window_geometry` (offscreen, not test mode: failed before), the last three in --upgrade OLD NEW Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * integration: the pair's fast start on the landed main: pardes-pair-start ↵Gabriel Schneider7 days
| |\ | | | | | | | | | | | | | | | | | | (`xrkvvkkk`, the boot as input zero: the client makes its own core and says its digest, `boot`; the session's dump only when they differ) merged over main (merges 40 to 44: the typed slot fields, the 9P state in the join's dump and digest) and step 1 of pardes-pair-4; three conflicts, none by the compiler: abi/wire.zig's history and version (main 25, the boot 26: now 27, as 26 is the terminals' line's, merging now), Peers.join's welcome (main's typed `peer.view` with the boot's `peer.digest = digest` before it), `replica.join`'s first dial (the boot took the pair's arm out, step 1 put the upgrading redial in: both kept), test/daemon.py WIRE 27; tui core-test 878/1036 (158 skipped), shell-test 1078/1081 Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| | * pair: the boot as input zero (the last step's design 3, way a2): under ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | | | | | | | | PARDES_PAIR the client no longer waits for its session's init, dump and socket before its first frame: it makes its own core from the same options and arguments (replica.ownBoot, Replica.initBoot: Pardes.init on no tape, as the session's start, its file read on its own machine, then the view the session's join opens for it, Peers.viewFor, shared by both), draws it, and says its digest before its `far` (a new client word, `boot`, 0x0a: 0x09 is the server's zstd envelope, which a stream's reader unpacks whichever way it runs; wire protocol 26, after the other line's 25); the session's writer sends no dump when the joiner's boot digest is its own at the join, and the client, reading the welcome once its first frame is drawn (replica.confirmBoot, client.zig `confirm`, the start's inputs held until then: Link.held, Link.release), goes on from its own core, or, unequal (the file edited between the two reads, anything else a start reads otherwise), loads the dump in its place and starts again; what made boots unequal by construction, found by the digest's parts compared in a scratch build: a join's view settled the session's first effects (Pardes.settle in openView: its boot shell spawned and acknowledged inside the join), which a client cannot perform; the effects queued before a join are now performed after it, on the tape the client is sent (viewFor, queueFirst), so the boot shell's spawn and first bytes reach the client as units, as P32 asked, and the dump path gets them so too; and a boot stepped on the replica's own tape read the machine as a replica's step would (the shell, the directory): Pardes.init runs on no tape, the view on the replica's tape (no terminal reloaded there, as on the session's screen-state tape); confirmed over 100 starts of a file and 100 of a shell (see the report); a boot's terminals are made on the C heap (panes.emulatorGpa reads dump.terminal_gpa); a window's pair's client boots unwindowed, as the terminal binary its session execs (main.zig `pair`, Options.windowed); tests: core/replica.zig "a pair's client makes its own core ...: no dump is sent" and "... the file edited between ...: the dump is sent, loaded in its place, and the client shows the session's file", and firstOnPair's screen-state client now its own boot, confirmed with no dump, the boot shell's spawn and first bytes after, digests equal, no reload; the start (ReleaseFast, medium.zig, one build alternated, NOT quiet: loads 8-16): the pair's first frame best 9.5 ms against the own path's 9.9 (median 10.2 against 11.4), the client 45.0-53.8M instructions:u (the bar 56.7M), its session 17.2-17.6M beside it, the own path 53.5M bit-equal to the base's; confirmed 100 of 100 starts of a file and 100 of 100 of a shell, a window pair 17 of 17; tui core-test 863/1018 (155 skipped), shell-test 1060/1063, term 17/17, pane 183/184, kitty 45/45, behaviour-test and --replay 275/275, process-test 0 of 144 failed, as a pair (PARDES_PAIR=1) 16 of 144 failed (the base 17), both soaks diverged 0, unequal 0, checked/wrong 0, unlisted 0, corpus 22 of 22, no leak, daemon.py plain, --far, --pair, --relink, --launch, --games, --window-clients, --gui, --upgrade both ways (new->old failed once on a client's key under load, then passed twice) pass, an idle pair 0 and 0 wakeups in 2 s, gui unit-test 1656/1660 with only BaselineHarnessMismatch, the frame and perf gate against tree2 PASS (77/77 frames, corpus2x -0.008%, 121 per-operation counts within 0.1%), macOS lib (Linux host), aarch64-macos and FreeBSD build (loads 5-23) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | | integration: the terminals' side line on the landed main: pardes-term-join-4 ↵Gabriel Schneider7 days
|\ \ \ | |/ / |/| | | | | | | | | | | | | | (terminals by the pty's bytes: a client's emulator fed the session's bytes, reload at a join, the lag bound; the query rows' paint decided on replicated state; views.park's leak; a view kept for its client's rejoin; C and Alt-C on a long text walking on from the row last tried: 306 G instructions to 194 M; the soak's witness and watchdog) and main (pardes-new-upgrade); seven conflicts: the wire's version (the side line's 24 is 26 here: 24 is the bye's close byte, 25 the 9P state), Peers' join (the view typed, the lag limit a field's default), a peer's end (the view's index; cut joins again), the client's and the soak's bye (the struct, again or lagged), daemon.py's WIRE; three more the compiler found (a test's view typed: its index where a u8 is asked) Co-Authored-By: Claude Fable 5.2 <[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
| | * | replica: a client measures how far behind its session it is and past two ↵Gabriel Schneider8 days
| | | | | | | | | | | | | | | | | | | | | | | | | | | | seconds lets its link go and joins again from a dump, saying so once (P32 (b); step 3, item 2): the fault shown first (a client whose units came 2.1 s later than its quickest took them on: Link.quit false) and in the soak (the far client never let go: one join, its final screen 17.7 s after the flood's end); Link.behind, each unit's head's session clock against the client's own (Link.time), less the smallest difference seen; one constant, behind_max_ms = 2,000, near and far; past it the link let go (the bye's `again`, its view kept), the notice "joined again: N.N s behind" (Link.rejoins), the first unit after a join past it taken as the link now (a session's clock stood still while its machine slept; a dump that took longer than the bound: never a let-go at once, never a loop); the clock is the client's machine's, read in Link alone (no new line on root.zig's machine_lines; Link is no part of Pardes, so no digest or dump reaches it); a test that fed a simulated client clock with units of the real clock made them on its own clock; the soak counts the let-gos and how far behind each client fell; tui core-test 859/1009 (150 skipped), shell-test 1045/1048, term-test 17/17; the soak, screen state (--clients 5, 4 seeds): diverged 0, unequal 0, deltas 7093/0 7518/0 7603/0, quiet 590/0 472/0 541/0, unlisted 0, corpus 22 of 22, the far client 9/9/7 let-gos, others 0; bytes (--seeds 8): the far client shows its final screen in every run, 6.5-7.9 s after the flood's end, refreshed every 7.0-7.3 s (p50), others 0 let-gos and 2-10 ms behind at most, quiet 1077/0 1083/0 1457/0, unequal 0, BUT 5/3/1 near clients diverged at joins (reports/pardes-term-lag.md: open); ReleaseFast (2 seeds, 80 ms): 0 diverged, a join's unit on a client already there 9.6 ms p50, 17.7 ms at worst, the session's join step 1.4/14.3 ms Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | | | pair: a hang-up is a close (P36): a terminal client (`runClient`) blocks HUP ↵Gabriel Schneider7 days
| |_|/ |/| | | | | | | | | | | | | | | | | and TERM before its join makes a thread and winchWatch takes both as `quit`, which in a client now sets the goodbye's close (as a window's close button does, and as SDL already makes a window client's TERM), so its terminal closed, its ssh dropped under it or a TERM says goodbye with the close, puts the terminal back and exits 0, and the session, a pair's not kept (daemon.State `pair`), ends when that was its last client; with other clients or kept it runs on, and a client killed outright stays a loss (no goodbye: it runs on, listed); without PARDES_PAIR the close is read by no session, so the own path's terminal closed still detaches its session, the one change a user sees there being a `pardes attach` client's TERM: a goodbye and exit 0 where it died of the signal; and a client exec'd at an Upgrade (runtime/client.zig `execAgain`) clears its signal mask first, since the mask crosses an exec and a build that sigwaits no TERM would never take one (found by `--upgrade` new->old with clients: the exec'd terminal client ignored the test's TERM for 20 s; with the clear both ways pass); test/daemon.py `pair_rows` gains 2.2 B's not-kept column (a client's terminal closed, not the last: runs on; the pair's own client killed -9: runs on, listed `(tty)`; the last client TERMed: exit 0, its terminal put back, the session ended; a pair upgraded, its terminal closed: ended) and the own path's rows (an attach client TERMed: the session on; its terminal closed: `(tty, detached)`); on the change before, `--pair` fails at the TERMed client's status (-15); here: tui core-test 861/1016 (155 skipped), shell-test 1058/1061, term 17/17, pane 183/184, kitty 45/45, behaviour-test and --replay 275/275, process-test 0 of 144 failed, soak --clients 5 diverged 0, unequal 0, checked/wrong 1874/0 1937/0, quiet checks 597/0 673/0 779/0, unlisted 0, corpus 22 of 22, no leak, --bytes --clients 5 the same (quiet checks 693/0 586/0 802/0), daemon.py plain (launch, pair, pair_rows), --far, --relink, --manage, --window-clients, --gui (gui_pair) pass, an idle terminal pair wakes 0 and 0 times in 2 s, gui unit-test 1654/1658 with only BaselineHarnessMismatch, --games, --upgrade with clients both ways against the base built with -Dembed-sources=true (another semantics) pass, nothing left behind by any mode (load 4-18) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | | upgrade: an Upgrade carries near clients (the last step's design 1.4, Z3): a ↵Gabriel Schneider7 days
| | | | | | | | | | | | | | | | | | | | | client let go by an Upgrade dials again as before, and when the session runs another build (or another protocol) and a newer file is installed at its own start path since it started (upgrade.replaced), the client loop ends `.upgrade` and its frontend lets its screen go and execs that file as `--attach=<socket>:<name>` (client.zig execAgain), the same process, for the view the session kept for it (PARDES_JOIN_VIEW, Options.join_view, dialled patiently as a rejoin is): the terminal's is the blink (it leaves the alternate screen and enters it again; no record), the window a new window; a client whose start path holds no newer file keeps today's sentence "session upgraded to a newer pardes: upgrade this client too"; a far client the same, through its forward (PARDES_REPLICA_FAR=1); a pair with no daemon refuses the Upgrade in words ("no daemon keeps this session, so its client could not join it again"), since its first client has no socket to find the session again by (on the base the Upgrade cut the client off and ended the session); test/daemon.py upgrade_clients (a terminal client and a window client, each its own pane in its own view): old->new the base's clients are let go and told to upgrade too (what they do today), new->old they exec the base build and come back in a view of their own (the base reads no PARDES_JOIN_VIEW), new->(this built with -Dembed-sources, another semantics) each is back in ITS view with its own pane; `pair`'s no-daemon Upgrade refused; tui core-test 858/1013 (155 skipped), shell-test 1053/1056, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and --replay 275/275, process-test 0 of 144 failed, both soaks diverged 0 unequal 0 corpus 22, daemon.py plain, --far, --games, --window-clients, --gui, --upgrade both ways (with clients) pass, gui unit-test 1650/1654 (the perf check's BaselineHarnessMismatch its one failure), macOS lib (Linux host), aarch64-macos, FreeBSD build (loads 3-15) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | | pair: under PARDES_PAIR `pardes-gui FILE` is a window client and a session ↵Gabriel Schneider7 days
|/ / | | | | | | | | | | | | with no SDL (the last step's design 1.2, Z1's rest): the child of a fork before SDL_Init EXECS the `pardes` beside it (`--paired=FD` first, the window's arguments after; its end of the socket pair kept across the exec), since a window binary's session loop is woken through SDL (gui.zig `sdlWake` is the Inbox's and the Peers' wake) and the terminal's binary needs none; with no `pardes` beside it the window is its own session as before; the session registers itself (and starts the daemon when none runs); the window's close button ends the session when it was its last client and no Detach was typed in any (a CLOSE: the client's bye says so, wire byte 2, protocol 24), a killed window leaves it running (a LOSS), with no daemon it ends with its last link; a client dialling again after an Upgrade that moved the protocol now stops at the daemon's "run the same pardes at both ends" as at "runs another build" (it dialled 20 s in vain); test/daemon.py `gui_pair` (in --gui, alone --pair-gui; on the base: the window was its own session) and `upgrade_clients` (in --upgrade when a pardes-gui is beside each build); the window's start, ReleaseFast, medium.zig, offscreen test mode, one build alternated, instructions:u (perf stat total, perf record split by pid): own 387.9-393.3 M, pair 397.5-398.3 M = window client 379.8-380.5 M + session 17.6-17.9 M (wall best 260 ms own, 282 pair, NOT judged, load 12-14); idle pair 0 wakeups in 2 s on the session side, terminal client 0, a window client unmeasurable offscreen (SDL's offscreen driver polls ~920/s, the own window the same); tui core-test 858/1013 (155 skipped), shell-test 1053/1056, term 17/17, pane 183/184, kitty 45/45, behaviour 275/275 and --replay 275/275, process-test 0 of 144 failed, soaks --clients 5 and --bytes --clients 5 diverged 0 unequal 0 corpus 22, daemon.py plain, --far, --games, --window-clients, --gui and --upgrade both ways (the base built once, pfx-old) pass, gui unit-test 1650/1654 with the perf check's BaselineHarnessMismatch its one failure (loads 5-25) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* | integration: a session's first client over an inherited socket before its ↵Gabriel Schneider7 days
|\ \ | | | | | | | | | | | | | | | | | | first effects, the pair under PARDES_PAIR, and a session's last word, on the 9P run's fixes and the build's second pass: pardes-first-client (new --detach forks and returns; Options.pair and the join by fd; pardes FILE as a client and a session under the variable; ended CODE and left NAME: a client's own Detach exits 0 with its line again) and pardes-merge33, merged without a textual conflict; tui core-test 858/1013 (155 skipped), shell-test 1053/1056, the window builds; the coordinator's gate in the ledger (reorg/merge34) Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| * | last word: a session's last frame on a link says which of two things ↵Gabriel Schneider7 days
| |/ | | | | | | | | | | | | happened (wire `ended CODE` 0x0b and `left NAME` 0x0c, working names): a Detach typed in a client queues `left` and lets its writer end after it (Peers.detach, Peer.last), a session's end tells every client `ended` with its code before the links are let go (Peers.ended, from runtime/session.zig after the loop; refuseAll and it share the 200 ms flush); a client that typed Detach prints "pardes: detached from 'NAME', which is still running; come back with `pardes attach NAME`" and exits 0 again (the attach's regression to exit 1 and "let this client go" undone, for every client, no variable), a client whose session ended exits with the session's code quietly, a pair's client after reaping its session (EDITOR=pardes waits for the session's end); client.Ended a union (left, ended CODE); a Detach with no daemon is refused in a client too (tui.zig `detach`: the daemon checked first), since a pair with none ends with its last link; test/daemon.py: the client Detach expectations (0 and the line), a session's Exit (0, no let-go line), `pair` Exit 0 and the session reaped, `pair_rows` the rows of the design's tables 1.1 and 2.2 B (Detach said, exit 0, the session listed; a client ended by TERM with its terminal put back, by KILL and by its terminal's HUP: the session runs on; no daemon: Detach refused, the terminal closed ends the session; nothing left); docs/next-run.md and core/CHANGELOG.md say so (the CHANGELOG's `new --detach` line is the first change's); `kept` NOT built: no terminal behaviour turns on it while a hangup and a killed client are losses and Exit ends the session (see the report) Co-Authored-By: Claude Opus <[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
* client: a client's yank, paste and link are its own frontend's, through the ↵Gabriel Schneider8 days
| | | | | | | client loop (the reorganisation's runners, step 10b, its third part; the user's ruling: a client's yank fills the CLIENT's clipboard, always): since 12a the session's host no longer makes them for a view a client draws, and its view counts each request (View.yanks, pastes, links and the link), so until now a far client's yank, paste and link did nothing on either machine; after each settle the loop compares the view's three counts with those it has acted on (Link.yanks, pastes and links, from the joined dump's at each join, so a join does none again; only a count that moved forward, so a rollback that puts one back and makes it again is not a second) and its frontend acts on the machine it is shown on: copy (register `+`: the terminal's OSC 52 through vaxis, the window's SDL clipboard), paste (the terminal asks its clipboard and the answer comes back as a paste through the loop's input, the window sends the clipboard's text as a paste at once), open (look.openLink); three more frontend calls, the soak's frontend counting them (y/p/l in its stops line) and answering a paste with one; the soak types ClipYank and ClipPaste now and then; a test through the loop over a frontend that draws nothing (runtime/client.zig: a client's ClipYank, ClipPaste and Look of a URL each reach its frontend once, at once and not again when the session's unit confirms it, the link as typed, and the session's host is asked none of them). Gate: tui core-test 837/980 (143 skipped: the base's and the new test), shell-test 1015/1018, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's; headersweep, winch and lsp-client failed once and passed again in the run); gui unit-test 1613/1617 with the base's BaselineHarnessMismatch; the soak (--clients 5) diverged 0, unequal 0, deltas wrong 0, quiet checks 526/0, 550/0, 811/0, unlisted 0, the clients' frontends did 3 yanks and 9 pastes (2/3, 0/3, 1/3), stopped 41/72/71 of 1846/1727/2015, mispredicted 29/40/39 at rtt 30/80/207 (its random inputs changed: ClipYank and ClipPaste among them); daemon.py plain, --far, --games, --window-clients, --upgrade from pardes-tree's pfx-base to this and back; the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs; gate-w run3-3 against tree1 PASS: frames 77/77 byte-identical in Debug, unit-test 1613/1617 (no failure the base has not), the alternated windows' pictures identical in all 10 runs, corpus2x -0.105%, perfops 97 counts within 0.1% (largest image-frame on longline +0.026%) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* replicas: the soak runs THE client loop, the one the terminal and the window ↵Gabriel Schneider8 days
| | | | | | | run (the reorganisation's runners, step 10b, its second part; the user's rule: replica bugs caught by a soak that does what real use does, twice hidden by a hand-written imitation): each client of test/replicas.zig is runtime/client.zig's Loop over a frontend of the soak's own (a terminal's or a window's by turns: it draws no pixels but counts its frames and keeps the facts a window reads; a window's size posted from its own pass; a terminal holds a key already one pass in four, so no copy then; its wait is the delayed link's next message, a wake it asks for one timer at a time on the soak's clock), driven as a loop woken from outside (Loop.pass up to its wait, Loop.woken after what woke it), so its mirrors of the two loops are deleted (Client.draw, own, within, pass, and the quiet check imitated on the soak's clock: the link's own quietCheck now runs, its clock the soak's through Link.now as Echo.now is); its host has every entry (replica.everyEntry, which 12b's FullHost is now too: pty_resize, watch_file, watch_theme, open_link, pipe, search and the rest do nothing unless the soak's), and an input whose stop's name replica.may_wait does not list fails the run, said with its input (replica.mayWait; the soak's random inputs cannot be named as the walk names them, so by the name alone): the soak found seven names the list did not have, all a far client's by design, now rows with why (Search's rows, a session worker's: `search`; a +Preview's file, the session's disk: `preview`; a kind whose state is its own on the session, a PDF's, its search, a place in it, its word, its open and its close: five rows on a new pane kind `addon`, which the walk does not stand in and never judges stale); the stops by name, the wakes asked and the frames drawn are a line per rtt; the leftovers go (Stats.unspeculated and its column, Proc with enter and current: the distrusted list is the client's, the stale comment about config.tab_now); and a new check, the frame corpus through a client (corpusCase): the corpus's scenes (a wheel, a click, a jump, TaglineSize, a markdown file, three columns, a dirty pane, InactiveDim, WindowOpacity, ligatures, Zerox, a resize) typed into a session's own view drawn by its own pump and, the same, through the client loop into a client's view of a second session of the same files, the session's unit back at once; after each, the two frames a frontend draws from (cells, cursor, chrome, regions, the facts beside them, the placements) are the same: 22 scenes, 25 frames own and 24 through the client, every one the same. Gate: the soak on the shared loop (--clients 5, 4 seeds) diverged 0, unequal 0, deltas wrong 0, quiet checks 489/0, 556/0, 700/0, mispredicted 32/36/43, stopped 87/43/81 of 1784/1806/1977 at rtt 30/80/207 (pty_write 54/9/47, the kinds' 20/19/20, resolve 6/8/4, search 2/4/4, the authority's own state 3/2/3, close a terminal 0/0/3, kind 1/0/0, detach 1/1/0), unlisted 0, 216 s (the base's 230 s); tui core-test 836/979 (143 skipped), shell-test 1014/1017, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's); gui unit-test 1612/1616 with the base's BaselineHarnessMismatch; daemon.py plain, --far, --games, --window-clients, --upgrade from pardes-tree's pfx-base to this and back; the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs; gate-w run3-2 against tree1: frames 77/77 byte-identical in Debug, the alternated windows' pictures identical in all 10 runs, corpus2x -0.055% (PASS), perfops 97 counts within 0.1% (largest image-frame on large +0.031%); its unit-test 1608/1616: the gate was started in the background (`&`), so SIGINT was ignored down to its test shells and the four host_io tests whose Ctrl-C must end a foreground job failed; the same unit-test run detached but not so (setsid, no terminal) 1612/1616 with the base's BaselineHarnessMismatch only Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* client: one client loop, which the terminal's client and the window's both ↵Gabriel Schneider8 days
run (the reorganisation's runners, step 10b, its first part; the design round's rule L): runtime/client.zig holds the loop a replica client runs, its link and its replica inside it, over a frontend of ten calls, each for a reason the two loops had (own: the window's own work over the frame it shows before a pass, its size posted, its font, a touchpad's rows, the pointer, the timedemo, the test feed, whose end ends the loop; again: its own motion, the last frame presented again; deadline: when it wants waking for its own sake, 0 when it holds an input already; wait: until an input, a message or the deadline, inputs in through the loop's input and messages through its take; present and drawn: a frame shown or owed, what it wrote and whether it moves; start: a join's first inputs; said and ended: the session's stream from the reader's thread onto the frontend's own queue; drop: what the reader queued let go once the link ended), and what a client holds across its joins (client.Start: its allocators, the addons it distrusts, its frame timings, the blobs it keeps far, its joined replica), made the same for both; what differed between the two loops is one behaviour now or a value the frontend gives: the copy is taken whenever the wait is not 0 (the window's rule; the terminal's "an event is held already" is a deadline of 0), a frame owed is waited for a frame on in the window's deadline (a skipped swapchain image has nothing that wakes it; a terminal's held frame is answered by the terminal), the timedemo's and the latency trace's waits are the window's deadline, the terminal's capabilities and the window's title and blink are their wait's ends, the frame's record keeps what each wrote (bytes on the terminal, presented in the window) and whether its own motion goes on (the window's; the terminal's false, as before), the reader's queue is drained the terminal's way for both (until the reader has ended, then joined); the window's motion frames are counted in the stats line's `again` as the terminal's were (the one change, a counter); the two old loops, tui.zig runClient with its Client and linkReader and gui.zig's Client, clientReader and clientSession, are each that loop with their frontend now (dev/tui/tui.zig +174 -216 there, dev/gui/gui.zig +329 -334, runtime/client.zig +233 of which 30 are the calls' description; all told +577 -389). Gate: tui core-test 836/979 (143 skipped), shell-test 1014/1017, term-test 15/15, pane-test 183/184, kitty-test 45/45, behaviour-test 275/275 and --replay 275/275, process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's); gui unit-test 1612/1616 with the base's BaselineHarnessMismatch; replicas --clients 5 diverged 0, unequal 0, deltas wrong 0, quiet 470/0, 600/0, 764/0, stopped 78/64/78 (the base's, the soak not yet on the loop); daemon.py plain, --far, --games, --window-clients, --upgrade from pardes-tree's pfx-base to this and back; the macOS library for Linux and aarch64-macos and the FreeBSD tui configure; rollback-bench runs; gate-w run3-1 against tree1: frames 77/77 byte-identical in Debug, the alternated windows' pictures identical in all 10 runs, corpus2x +0.128% (PASS), perfops 97 counts within 0.1% (largest image-frame on large +0.029%); its unit-test 1608/1616: the gate was started in the background (`&`), so SIGINT was ignored down to its test shells and the host_io tests whose Ctrl-C must end a foreground job failed (they pass alone, and the whole unit-test passes 1612/1616 when SIGINT is not ignored) Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T