Repository navigation
Isolate known retirement failure from pin restoration checks - #1695
Merged
Merged
Conversation
Retain the retirement marker and every restoration and geometry assertion as hard checks. Save only the verified-main insertion visibility failure until all round trips complete, and preserve its original assertion under --runxfail.
leaf-agent
approved these changes
Oct 4, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 6, 2026
…1901) A decided suggestion could keep showing its retired words: the slot carried `data-lf-retired`, the `state.css` rule applied, and Chromium still computed `display: inline`. The style was stale. The operation that left it stale was a forced style read inside a hidden tab panel, made by `bounds.js` from a MutationObserver. ## Cause On every content change of a bounded block (`data-lf-bound`), `hold.sync` found the block's scroller by calling `getComputedStyle` on every box inside it (`scrollerOf`). The feature gallery's "Page & layout" tab holds bounded logs, and an inactive tab panel is `hidden="until-found"`, which is `content-visibility: hidden`. Each read forced Chromium to style that skipped subtree. A Chrome invalidation-tracking trace of a failing run shows the sequence: - a row is added to a log in the hidden panel, and `:has()` invalidation marks `#bg-gallery-tabs` for a subtree restyle and `main` for a local one; - in the same task, `declaresBound` reads style inside the panel, which forces a display-lock style update (1011 such reads in a failing run, against 1 in a passing one); - that update restyles neither `main` nor `#bg-gallery-tabs` and clears the dirty bits above them, so `#bg-gallery-tabs` stays dirty with nothing pointing at it; - every later write under it is never restyled, including the reject's `data-lf-retired` on `#bg-insert lf-new`. `#bg-gallery-tabs` is never resolved again for the rest of the run. The forced pass orphaning a dirty ancestor is a Chromium defect. I could not reduce it to a page without Leaf. ## Fix - `bounds.js`: `sync` asks `skipped(bounded)` first, as geometry.js's other readers of skipped content do. A skipped block keeps the scroller it had, or stands as its own, and renews its size observation. The first delivery after the block is drawn syncs again, so an `end` log that grew while hidden opens on its newest entry. - `reach.js`: `paintReadingReach` and `paintSidewaysReach` check `unpainted` themselves. Review found that a bounded block arriving in a hidden panel registered as a reading region and had its downward cue painted at once, reading `overflow-y` and scroll extents in skipped content from the same MutationObserver. ## Evidence - Issue journey (`test_a_decision_undone_leaves_every_suggestion_pin_where_it_stood`), on macOS Chromium 153: at 0e52b1b it failed 25 of 32 copies, and 0 of 20 with the `bounds.js` change applied there. - Main stopped reproducing after #1880 removed a non-subject `:has()` rule (bisected over the 18 commits from 0e52b1b). That rule supplied the pending subtree invalidation. Adding a no-op rule of the same shape back to `chrome.css` (`.lf-zz-a:has(> .lf-zz-b) * {}`) fails 8 of 10 copies on main, and 0 of 20 with this change. - New test `test_logs_in_a_hidden_tab_open_on_their_newest_entries` grows one bounded log in a hidden tab, adds a second, and checks that neither has its style or scroll extents read while the tab is hidden, then that both open at their newest entry, twice. It fails without the `bounds.js` change, without the `reach.js` change, and without the renewed size observation. - The tests that exercise bounded blocks, reading regions, and reach cues (71 cases) pass, as does `npm run test:runtime`. `test_render_controls.py::test_each_sampled_focus_ring_is_shown_whole_in_its_surface` fails on current main without this change too. ## A more underlying fix? Unverified. Other runtime readers still force style or layout in hidden panels: `shownParts` for target paint (deliberate, per geometry.js's header), `readingPosture` in `recordRegions` and `scrollersSettled`, `margin-layout.js`'s `scrollFollows`, and `user-view.js`'s `seenRect`. With this change and the provoking `:has()` rule, the issue journey stopped failing (0 of 20), so none of them was seen to leave style stale. The run that would settle it is a journey that makes one of them read a hidden panel while an ancestor holds a pending `:has()` subtree invalidation. Its candidate fix is for those primitives to answer skipped content themselves (a last-seen scroller, an empty shown set) instead of each caller asking `skipped` first. History read: `notes/margin-stuck-style.md` (#1506, #1695, #1719), #1834 and #1880. Fixes #1868 > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[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.
The gallery pin test's retirement assertion fails intermittently on main 0859381: the rejected insertion can retain native visibility despite its retired marker. Raw Chromium captures reproduce this stale-style defect, whose triggering interaction remains unresolved.
The test now saves only that visibility failure, completes every original pin restoration and geometry check, then reports the known retirement failure as expected. The retirement marker remains a hard assertion, and
--runxfailre-raises the original visibility failure after the round trips. The existing investigation records the new evidence.Validation: 18 concurrent journeys on integrated main complete all pin checks, with three passes and fifteen expected retirement failures. A native 60px pin displacement still fails its original geometry assertion even with retirement failure recorded; a retirement-only fault under
--runxfailexposes the original hidden assertion. Both controls retain clean browser health guards. The everyday Python gate passes 2,064 tests with one platform-specific skip; all 195 runtime tests and full pre-commit pass. Independent review is clean.