Repository navigation
Re-derive and repaint only the widgets a gesture changed - #6070
Merged
Merged
Conversation
… per fold Admitting an event read the whole log three times: once in the sender's vocabulary for the contract gates, and once on each side of the append in the active vocabulary to decide whether the event needs the agent's attention. An event made against the newest revision has the same vocabulary for both, so the log before it was read twice. Admission now reuses the first reading there. Each reading's fold (`state_projection`) also rebuilt and deep-copied a widget verb's current state definition for every event, though the definition depends only on the widget and the verb. It is now built once per widget verb per fold. `leaf-dev bench --read server --sizes 128,512,1024 --rounds 3`, base then head, least CPU of 3, ms at 1,024 events: | Page | append | state | | --- | --- | --- | | events | 74.6 → 38.3 | 41.5 → 32.7 | | widgets | 132.7 → 98.3 | 65.5 → 66.3 | | cards | 187.9 → 159.6 | 133.1 → 121.1 | A click's server paths (append, then state) at 512 events: events 58.7 → 33.6, widgets 97.6 → 87.9, cards 129.4 → 110.3. The model tier (`uv run pytest tests/model`, 3,161) passes. > _This was written by Claude Code on behalf of max-sixty_
A click on one option made every widget's records again on each publication, and painted the projection's marks by reading the whole page: - The obligations step rebuilt every widget obligation's record whenever any widget's state moved, and the On Me, On <agent> and done lists rebuilt every row, so the publisher compared each one with the last by its contents. Each record and row is now kept while what it reads holds still (kept.js). - A selection whose derivation answered the same reading it kept had its contents compared again with the shared copy, which is another object. Every widget's selection did this on every publication. A selection now takes the same answer as no change (snapshot.js, `select`). - The projection's chrome found the elements wearing its origin and restatement marks with three queries of the whole page on each paint, and said each one's quiet word again. It now keeps the elements it marked, and says the quiet words of those alone (`sayQuietFacts`). On a click at 1,024 sections, the values the publisher compared fell from 4,166 to 2,124, and its comparing from 28.4 to 10.8 ms (instrumented, under load). `leaf-dev bench asks --input click --input comment --input resolve --sizes 64,1024 --rounds 3 --base`, interleaved, lowest of 3, at 1,024 sections, base → head: | Input | CPU (ms) | Server's reading shown (ms) | | --- | --- | --- | | click | 83.3 → 71.1 | 121.2 → 91.3 | | comment | 154.7 → 155.5 | 178.9 → 158.6 | | resolve | 140.5 → 131.4 | 133.8 → 128.8 | At 64 sections each reading is within a few ms of base. The browser tests of origin marks and quiet words (10), obligations and the On Me lists (26), sends and the obligation walk (17), and widget state and revisions (69 of 70) pass, as do `pnpm run check:browser` and `pnpm run test:runtime` (982). The other one, `test_a_control_a_widget_built_is_told_from_a_label_it_wrote`, fails the same way on main on this Mac. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
approved these changes
Nov 15, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 15, 2026
…per pass for each (#6078) Comments only. After #6052 and #6070, a click on the 1,024-section page `leaf-dev bench` generates shows the server's reading within the 100 ms budget, but sending a comment (159 ms) and resolving a thread (129 ms) still don't. Each remaining whole-page cost now has a note at the code that pays it, saying what it costs there and what change would make it cost what the gesture changed: - `collectEntries` (annotation-inventory.js): rebuilds and re-sorts every group each collection, about 10 ms, twice per send. - `markerName` (margin-projection.js): every marker's name carries its place and distance down, so one new marker renames them all and reads every target's box, about 9 ms per send. Changing it changes what a screen reader hears, so it is the maintainer's call. - `layoutMountedRows` (margin-layout.js): seats every row each pass, kept ones included, about 8 ms a pass. - snapshot.js header: publication knows which members it shared, but readers still diff whole collections. - `admitted_event` (event_contracts.py): `after` and the state read fold the whole log again. - `read_events` (event_log.py): every request parses the whole log, a fifth to a quarter of a request on the cards page at 1,024 events. - event_meaning.py: each move records its container's whole authored order, so the cards log grows with the square of its moves. Asked for by max-sixty. Pre-commit passes on the changed files. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
added a commit
that referenced
this pull request
Nov 16, 2026
…and a deleted theme section (#6125) Brings seven comments and docstrings in line with code that changed in the last day. No code changes. - **Draft carrying (#6060).** #6060 removed `carry` from `openComposer`, so a new target opens its own draft and earlier words stay with their passage. It also dropped the word "Draft" from Threads' row status. Four comments still described the old behavior: - `composing/surface.js`'s header said `commentOnTarget` carries an unsent draft to the new target. - `composing/aim.js` said an ⌥ press moves the draft onto another target. - `composing/selection.js` said an explicit Comment gesture can carry user text. - `floating-panel.js` said a drafted Threads row says "Draft". - **Other pages (#6068).** The served `others` list became `/api/pages`, but `server.py`'s docstring for the machine key still named the `others` menu. - **Theme tokens (#6025).** `tests/browser/test_render_anchors.py` cited `package-themes.md`'s "Theme colors" section, which #6025 replaced with "Theme tokens". - **`renderQuiet` (#6070).** Its new comment said it runs as a message's markup arrives. `paintDeclaredWords` also runs it on the page at upgrade and on a revision's roots. Found by the nightly review of the commits since the last run. Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A click on one option made every widget's records again on each publication, and painted the projection's marks by reading the whole page. Three changes make that work follow what the gesture changed:
kept.js), so the publisher no longer compares every one of them by contents.snapshot.js,select). Every widget's selection kept its reading, but had its contents compared again with the shared copy on every publication.sayQuietFacts).At 1,024 sections (
leaf-dev bench asks --base, interleaved, lowest of 3), base → head:At 64 sections each reading is within a few ms of base.
Where to look: the
selectchange relies on a derivation never changing a value it has returned, which the module header already asks of derivations; a derivation that mutated a reading it kept would now go unseen rather than compared. The one derivation that keeps a reading between calls, each widget's (selectWidget), never changes it once returned.The browser tests of origin marks (10), obligations and the On Me lists (26), sends and the obligation walk (17), and widget state and revisions (69 of 70) pass, as do
pnpm run check:browserandpnpm run test:runtime. The other one,test_a_control_a_widget_built_is_told_from_a_label_it_wrote, fails the same way on main on this Mac. max-sixty asked for this as part of removing whole-page work from each gesture's path; they haven't read it yet.