Skip to content

Leave root attributes a revision does not change where they stand - #1370

Merged
max-sixty merged 2 commits into
mainfrom
benchmarks-survey
Sep 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
benchmarks-survey

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Activating a revision took every authored attribute, class token and inline declaration off html and body and put the arriving revision's back on, including the ones both revisions write. A class taken off body and put back restyles the whole document, so every corpus revision paid a full restyle for attributes that hadn't changed. This came out of re-profiling revisions after the recent performance PRs (#1321, #1324, #1334).

replaceAuthoredAttributes now takes off only what the outgoing revision wrote and the arriving one doesn't, and writes only what differs, through the layer's identical-write rule (keeps). Declarations are compared by name, so an empty custom property (--x: ;, which reads back as "") stays, and a newly declared empty one is written as the single space that parses to it, since setProperty with "" removes; the old code dropped both. Runtime-owned attributes and inline properties survive, as before; the existing live-revision test covers adding, retiring and the runtime-owned --lf-thread-panel-width.

Measured on the corpus with scripts/profile_page.py corpus revision (3 runs each, current main, load ~20):

main this branch
style per revision 149.5 ms 54.6 ms
install task 313–357 ms 160–188 ms

Most of what's left in that task is reachScrollers, which #1340 takes down separately; the two together bring style per revision to about 15 ms.

New test: a revision that changes only the title makes no authored attribute write on either root. It fails on the old code.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

Activating a revision took every authored attribute, class token and inline
declaration off `html` and `body` and put the arriving revision's back on,
including the ones both revisions write. A class taken off `body` and put
back restyles the whole document, so every corpus revision paid a full
restyle for attributes that had not changed: about 150 ms of style and a
63 ms attribute pass per revision, measured with scripts/profile_page.py
(install task 313-357 ms before, 160-188 ms after, 3 runs each).

replaceAuthoredAttributes now takes off only what the outgoing revision
wrote and the arriving one does not, and writes only what differs, through
the layer's identical-write rule (`keeps`). Runtime-owned attributes and
inline properties still survive, as before. New test: a revision that
changes only the title makes no authored attribute write on either root.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An unchanged empty CSS custom property is removed during revision activation; the inline suggestion checks whether the property is declared.

Comment thread skills/leaf/assets/runtime/version.js Resolved
An empty custom property (--x: ;) reads back as "", so the removal pass took
an unchanged one for undeclared, and setProperty with "" removes rather than
declares, so a newly declared one never went on (as before this branch).
Declarations are now compared by name, and an empty one is written as the
single space that parses to it. The root-attribute test covers both.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit b645772 into main Sep 27, 2026
6 checks passed
@max-sixty
max-sixty deleted the benchmarks-survey branch September 27, 2026 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants