diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-29 23:14:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-29 23:59:54 -0300 |
| commit | bce88593014a4078dc9259855944f9ddbc19fe54 (patch) | |
| tree | 9be0950d36a63cec15552dccec3cd29550b2f26c /docs | |
| parent | c02ab55482c055c57146b9ea9a5a78c20bcdf122 (diff) | |
| download | pardes-bce88593014a4078dc9259855944f9ddbc19fe54.tar.gz pardes-bce88593014a4078dc9259855944f9ddbc19fe54.zip | |
views and the rollback copy: a live view's slot keeps no pointer into what the live core owns; a register's texts and a file's location rows are pinned, not copied
views.zig: when a view goes live (to, close, drawOthers putting the live one back, only), its parked share is emptied (`emptied`): it was left holding copies of the pointers it handed the live fields (a column tag's text, a chord's argument, the presentation's), stale until it parked again. The rollback copy walks every slot: a stale pointer whose memory the live view had freed and another taken saved that other's bytes and put them back. A pane's share holds no pointer but its selections, which `unpark` already hands over. The test fails without it: a tag's text freed under view 0's stale slot, its memory taken by an allocation the copy has no business with, written under a held copy, and the copy put back.
Registers.zig, locations.zig, rollback.zig: a register's values and joined text, and a file's location rows (the dropped ones, a query's saved), are replaced whole and never written, so the copy pins them as it does a file's text, freed raw (a safe build's free would write over one a copy still holds); rows pin whole with what each owns (`pinnedDeep`). In the harness at 30 ms the big copies were a file's location rows, 5-6 MB after the flood, not the register. ReleaseFast, 20 seeds, three clients, p99: copy 5.1 -> 0.22 ms at 30 ms (0.19-0.20 at 80 and 207); rollback 14.9 -> 9.5 ms at 30 ms (1.3-1.4 at 80 and 207), what is left being the replay's digests (half the harness's CPU is Wyhash over the whole core per replayed unit). Tests: a 2 MB register and 500 location rows pinned, not saved, and whole after a speculation drops them and the copy is put back. docs/next-daemon.md: the follow-ups.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/next-daemon.md | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/docs/next-daemon.md b/docs/next-daemon.md index 00f66cf8..55921027 100644 --- a/docs/next-daemon.md +++ b/docs/next-daemon.md @@ -1743,7 +1743,7 @@ cores (ReleaseFast). the copy's p99 is 7.8 ms and a rollback's 17 ms: a register holding a terminal's whole grid (`%` then `y` in a shell's text, 2 MB after the flood) is copied whole by every speculation. Registers could be pinned - as file texts are; left as found. + as file texts are. (Done since: the follow-ups below.) - **No local regression.** `pardes-perf-live --live`, A and the new tty interleaved A B A ... A (4 runs of the new one, 5 of A) on the perf cores; the median of the runs' p50s, new/A, present and core: @@ -1782,12 +1782,8 @@ Not done, and why: - Text reads outside `buildRows` (a pointer selection's copy in tty mode, 9P's screen reads) do not ask for the rows; 9P's are the authority's anyway. -- **A hazard for part A, not fixed here.** The rollback copy follows a - view's stale slot (above). If a stale pointer lands on a live allocation - that a speculation then writes in place, the rollback puts the old bytes - back over that allocation's new owner. Emptying a slot's pointers when - its view goes live (views.zig `unpark`) would end it; the copy skipping - the live slot instead diverged, so part of it is still read. +- **A hazard for part A** (fixed since, below): the rollback copy followed + a view's stale slot. - Echo prediction (phase 6): a key into a terminal waits a round trip. - A replica steps every output step of the authority's (bytes-less), about 2000 a second under a flood, each a core step. @@ -1796,6 +1792,40 @@ Not done, and why: - The other agent wires it in: the tty and GUI hosts, `Screens` per attached peer, and a replica frontend drawing after `screen`. +Follow-ups (2026-10-29): +- **A live view's slot keeps no pointer.** When a view goes live (`to`, + `close`, `only`, and `drawOthers` putting the live one back), its parked + share is emptied (views.zig `emptied`): it held the pointers it handed + the live fields (a column tag's text, a chord's argument, the + presentation's) until it parked again, and the copy, walking every + slot, saved and put back whatever memory had since taken their place. + A pane's share holds no pointer but its selections, which `unpark` + already hands over. A test frees a tag's text under the stale slot, + hands its memory to another allocation, writes it under a held copy and + puts the copy back: it fails without the fix. +- **Registers and location rows are pinned, not copied.** A register's + values and joined text, and a file's location rows (with the ones an + edit dropped and a query's saved), are replaced whole and never written, + so the copy pins them as it does a file's text, freed raw. Rows pin + whole with what each owns (its path, its colours: `pinnedDeep`). In the + harness at 30 ms the big copies were not the register but a file's + location rows, 5 to 6 MB after the flood. ReleaseFast, 20 seeds, three + clients, p99: copy 5.1 ms to 0.22 ms at 30 ms (0.19 to 0.20 ms at 80 and + 207); rollback 14.9 to 9.5 ms at 30 ms (1.3 to 1.4 ms at 80 and 207). + What is left of a rollback's tail is the replay's digests: half the + harness's CPU is Wyhash over the whole core at every replayed unit, the + pinned blobs included (part A's digest). Hashing a pinned blob once, + while it lives, would take most of it. +- **The live perf harness ends what it starts.** Every process a live run + starts inherits its private runtime directory: after each cell, and in + the cleanup every path takes, the harness sends TERM, then KILL, to each + whose environment names it (`liveSweep`). With a wrapper that leaves a + daemon-kept detached session (as the remote agent's client-live.sh + does), the old harness left three sessions and their daemon a run; this + one leaves none. The gate's baselines are recorded again from base (main + and the new perf.zig), and .scratch/daemon/base/pardes-perf-live rebuilt + from it. + ## Phase 6: upgrade notes Built 2026-10-29 (`src/upgrade.zig`, the tty and GUI hosts, `daemon.zig`, |
