From f8e9b68309f657ce2cd3de0d2070fb70dc525339 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 19 Nov 2026 17:33:23 -0300 Subject: replicas: a markdown text's tables are the whole text's, read at once by whoever asks first, never a reading under way that a frame moved (the audit of what a frame writes and a step reads, after Pane.notices): a step read a big text's table pads (a click's byte, a `j` over a table, through File.geometry -> Tables.ensure) from `File.State.tables`, which is derived (in no digest, no dump) yet carried a reading's progress: the first look read 4096 lines, the session's ticks read on 4 ms at a time, and an edit after a look took the short way past the read point; so a core that drew a frame before an edit (the frame's geometry made the first look at that revision) read on past line 4096 where one that had not drew began again and stopped there, and a client joined from a dump began from nothing where its session had read the text whole (then its tick asked the tape for a budget its session never read); the test `tables: a click on a big text's table is the same state whichever frame this process drew last` (a session that drew once and a replica joined from its dump that drew nothing, the same paste and a click on each cell of a table at line 5001) failed on the base (`expected 4, found 5`: the click put the caret on another byte) and passes; the fix reads the whole text at once in `Tables.ensure` (an edit still reflows only its block), deleting the budgeted reading (`pending`, `step`, `busy`, `frame_ns`, `first_lines`, the tick's call and `nextWake`'s, the key's word): its cost is the read at open, measured in ReleaseFast at 40 ns a line of prose and 18 ms for 2.7 MB of 2000 tables (docs/next-tables.md's stress text, generated), where it was 4096 lines then 4 ms a frame; and the class is kept closed two ways: `root.zig`'s `kept_out` names every `.local` and `.derived` field of core/ (68) with who writes it and why a step's read of it is the step's, a test failing on a new one not listed, and `draw.zig`'s `a frame changes nothing a step reads` steps a core that draws after every input (each frame at its own later time, and `presented`) and one joined from its dump that never draws through 600 random keys, clicks, wheels, pastes, commands, ticks and disk changes over a 4500-line markdown text with a table and a second pane, their digests equal after every step (16 seeds of 3000 steps agree); the audit's table is in the report (.scratch/sketch/reports/pardes-draw-2.md); the gates on this change: tui core-test 841/984 (143 skipped), shell-test 1020/1023, term 15/15, pane 183/184, kitty 45/45, behaviour-test 275/275 and --replay 275/275, process-test the base's two (lspcomplete, lspcompletemoved), gui unit-test 1618/1622 + BaselineHarnessMismatch (the base's); replicas --clients 5, the session drawing after every pump: diverged 0/0/0, unequal 0/0/0, deltas checked/wrong 2113/0, 1773/0, 1775/0, quiet checks 800/0, 794/0, 893/0, stops not on may_wait 0/0/0 (rtt 30/80/207), corpus through a client 22/22; daemon.py plain, --far, --games, --window-clients, --upgrade both ways (against pardes-tree/pfx-base) pass; cross_replay 28 digests agree each; macOS lib and FreeBSD rc 0; the frame and perf gate ran on the three changes together (d2-i3): frames 77/77 byte-identical, corpus2x +0.005% (noise 0.044%, bar 0.4%), the 97 per-operation counts within 0.1% (largest +0.031%) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- docs/next-tables.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/next-tables.md b/docs/next-tables.md index 121b345a..9aab2ba9 100644 --- a/docs/next-tables.md +++ b/docs/next-tables.md @@ -71,7 +71,6 @@ and 10-30 rows, fences every 50 tables. Debug build, 160x50, each step |---|---|---| | a whole read of the tables (once, blocking, for comparison) | 127 ms | - | | the first frame | 27 ms | 18 ms | -| frames until every table is read (4 ms a frame from the top) | 24 | - | | `j` and its frame, in a table | 1.0 ms (worst 1.5) | 0.6 ms (0.9) | | a letter typed in a cell and its frame | 3.2 ms (worst 8.5) | 2.0 ms (6.8) | @@ -84,10 +83,12 @@ Two changes the numbers forced, both Places' patterns: in what it replaced, reads everything (a fence changes every line after it). A random 1500-edit test checks every result against a whole read; more than 1000 took the short way. -- **Opening reads from the top a frame's budget at a time** (`Tables.frame_ns`, - `Pardes.nextWake` while `busy`): rows below the read point are drawn as - source until it gets there (a quarter second on this file). An edit past - the read point changes nothing read; one before it starts the read again. +- **Opening reads the whole text at once** (18 ms in ReleaseFast on this + file). It was read a frame's budget at a time from the top, but how far a + reading had got is no core's state (the tables are derived: in no digest, + no dump), and a frame read them too: a core that drew before an edit, or + one joined from a dump since, found other pads than the session's, so a + click or a `j` over a table did otherwise in a client (2026-11-19). ## GUI and tty @@ -169,8 +170,8 @@ byte's cell maps back to it, and every pad cell to the byte after it`; `...is drawn aligned, its bytes in order, the caret and a click on each byte's cell` (also the look); `...typing in a cell re-aligns the table live, and j/k keep the column shown`; `...an edit's tables, shifted and found again around it, -are the whole text's` (1500 random edits); `...a big text's tables are read -a frame's budget at a time`; `...wider than a wrapping pane is shown as its +are the whole text's` (1500 random edits); `...a click on a big text's +table is the same state whichever frame this process drew last`; `...wider than a wrapping pane is shown as its source`; `tables are the pipe_tables tree-sitter finds` (syntax.zig); `a box-drawing rule reaches its cell's edges` (gui.zig); `zz tables timings` (skipped without `TABLES_TIMES`). No layout change, so no rects invariant. -- cgit v1.3