Skip to content

Engine: a wide list's shown children are read first, so the stale-point guard checks what follows it (#304, #309) - #311

Merged
SSFSKIM merged 11 commits into
mainfrom
fix/304-wide-list
Nov 7, 2026
Merged

SSFSKIM merged 11 commits into
mainfrom
fix/304-wide-list

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

When cua's 4,000-node budget cut a window's tree, a long list or table used up the budget before the walk reached what came after it in the document. The stale-point guard then checked those clicks only against their container. It now checks them fully: 100% on every affected page, up from as low as 38%.

The same change fixes #309, a bug in #301's record-only bisection. On Safari's docs.python.org it left the guard's record empty under most of the page, though nothing was cut.

Closes #304
Closes #309

What #304's spike found (main f20a25e, 234 observations, 57,836 clickable points)

  • Hole 2: a wide list starves its later siblings. 37 observations, 1,684 points.
    • Chrome answers AXVisibleChildren on an AXTable with every row, so the width rule kept and charged all of them.
    • Each AXColumn relists every cell, adding 818–2,042 more offscreen charges.
    • Container-only: IANA's media-types page reached 48.7% checked, and a local 6,000-row table 38%.
    • Chrome's own toolbar and tab strip went unread, and the guard would refuse 20–22 toolbar points on still pages.
  • Stale-point guard: the record's bisection finds no shown children when a list's end child is framed at its parent's origin (Safari) #309. The record's bisection compares the first and last framed children to find the axis. Safari's body ends with a group framed at its own origin, so minY and minX tie and the function returned nothing: 36.6–91.1% checked.
  • Hole 1: collapsed-frame containers. 0 points. Chrome gives collapsed wrappers their descendants' union bounds.

The rules (design session rulings 7b2a5a70, f1a7589f and 0092b8c7; Decision Log entry for #304 and #309)

  • A. The record's axis is chosen past end children that tie or overlap the first (Stale-point guard: the record's bisection finds no shown children when a list's end child is framed at its parent's origin (Safari) #309).
  • B. A list of more than 100 children reads its shown children first. The rest wait unread in the deferred queue, in document order.
    • 512 children or fewer: every child is judged by its own frame, so a two-column list's two shown runs are both read.
    • More than 512: the shown run is found by bisection, then checked against 32 children at each end and 32 in the middle.
      • A shown end child is read with the run, which covers fixed and sticky heads and tails.
      • A middle sample out of place makes that list fall back to main's behaviour.
  • C. An AXColumn's cells wait until everything else is read. Chrome reaches the same cells through their rows.
  • Two parents, the earlier place. An already-read element met again at an earlier place, while its children still wait, moves there. Nothing is read or charged.
  • Descriptions are settled at each element's preorder place, in one pass after selection, within the deadline.

The invariant: B never leaves unread a shown child that main would have read before the cut. A walk nothing cuts reads and emits exactly what main does.

Limits

  • (i) Hole 1 stays a stated limit, measured at 0 points.
  • (ii) A wide list whose shown run, together with what precedes it, takes the whole budget still starves what follows. The 6,000-row table is not this case, and it now reaches 100%.
  • (iii) In a list of more than 512 children, a shown child in the middle that the samples miss waits with its neighbours.
  • (iv) The move to an earlier place happens only if the walk reaches that place before the cut.

The cost

Paired walk time B − A on the final A/B:

Rule B's own frame reads come to 8–10 ms per table (about 117 reads at 0.06–0.09 ms). The rest of the table cost is B reading the AXColumn elements: their frames span the table, so they count as shown, and each lists 6,001 cells. Follow-up: #310 lets the column elements wait too, with the invariant exemption that needs as an open question in its body.

Live proof (GitHub-hosted macOS, main f20a25e against the branch, 2 reps)

Evidence is in docs/evidence/2026-11-07-wide-list/.

Check Main Branch
Hole-2 pages: iana-media, 3,000-row, barred and 6,000-row tables 38–94% checked 100%
Safari docs.python.org (#309) 36.6–84.7% 100%
Wikipedia's two-column lists at 90% (regressed on the first rule B) 100% 100%
/fixedtail, a fixed toolbar after 2,500 paragraphs 0 refused 0 refused
Toolbar points refused on still pages, barred and 6,000-row tables 20–22 0
Uncut trees, guard records and descriptions – identical on every static page, apart from #309's intended record growth
#305's still-page sweep 0 refused 0 refused
#296's stale suite (90 cells) every stale cell refused every stale cell refused
  • chrome/shared-reread/swap/0.1s is noise. It answers nodeGone or sameElement-then-backgroundClickRefused on both heads: A 3 of 18, B 1 of 18. That depends on how late after Chrome's launch the cell is observed.
  • The final A/B ran on aab236f. The head, 2e5d63e, only narrows a column shortcut, and the replays below cover the difference.

Runs:

Tests and review

  • Engine: 899 tests (1 skipped: the gated replay). WideListTests has 10, WideListInvariantTests 13.

    • A 33-case mutation script removes each rule, bound, sample check and pass, one at a time. Each removal fails at least one test.
  • The invariant check runs the real TreeWalk with the rules off and on over the recorded trees, and fails on any loss:

    • the 52 full child-list trees of the table pages: all verified, 0 losses;
    • the spike's 282 trees: 154 fully verified, 0 losses. The other 128 are alias-incomplete, because their dumps hold each shared table cell under one parent only. The 52 full-dump table trees cover them;
    • the first rule B fails the same check with at least 1,141 losses.
  • reviewer-high ran 8 rounds over f20a25e..2e5d63e. Each finding was fixed and re-reviewed, and the last two rounds were CORRECT with no findings. The findings covered:

    • descriptions for elements two parents list;
    • the deadline;
    • the check's exception and its loader;
    • the column shortcut.
  • One residue is in tech-debt-tracker.md: a shared element's settable flag follows the parent it was read through.

  • CI:

    The head adds only the evidence folder.

Plugin 0.27.2.

Sminos-Session: cursor235#b93055dd (cua on macbook)

… until last, and the record's bisection passes an end child that overlaps the first (refs #304, refs #309)

Ruling 7b2a5a70. Rule A (#309): ChildFrames.axis takes vertical from a later top edge (main's rule), horizontal only when an end child lies wholly right of the first, and passes an end child that says neither, over 32 from the last; shared by recordedChildPositions and the new shownChildRun. Rule B (#304 hole 2): of an element taken up in the tree's selection with more than 100 children, the run that shows is found by two bisections on frames (uncharged, a 1-pt Chromium strip counting as outside) and read first; the children before and after it wait unread in deferred, in the document's order. Rule C: an AXColumn's children wait in their own queue, taken up once deferred is empty. A walk nothing cuts still emits the plain preorder's payload and record (WideListTests).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…ndment notes on #301's entries (refs #304, refs #309)

The three rules of ruling 7b2a5a70 with the spike's numbers, the limits (hole 1 stays stated, measured at none in 234 observations; a shown run that with what precedes it takes the whole budget still starves what follows; the run is contiguous, so a child that shows out of order beside it waits), the offline proof and what the hosted A/B must measure.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…d again at the earlier place the selection meets it (refs #304)

The review of f20a25e..13805b8: deferring a column read a cell its column listed before its row through the row, so describe kept the row's later answer and the column's place was skipped, unlike the plain preorder. The selection now passes an already-read element met at another place to describe with that place's order (describeAgain), which asks again only where it precedes the cached answer's. It covers rule B's alias too (a wide list's row outside its run that a later sibling lists). Both cases join the uncut equality test, each failing without the fix.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…r place in one pass after selection, within the deadline (refs #304)

The re-review of 13805b8..0198ebe: describeAgain judged only a re-met root, missing its subtree (a child under a cell the column lists before its row), and queried the system before the deadline check. It is replaced by describeAtPreorderPlaces: once the tree's selection is done, a pass in emission's preorder re-asks, through describe and its byte-budget rule, only an element whose preorder place differs from the place it was read at and only for an answer cached from a later place; it makes no query past the deadline and marks the walk cut by it. The selection's loop again asks nothing at a repeated place. Tests: the nested alias in the uncut equality test, and slow repeated queries against a 100-ms deadline.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… read through (refs #304)

Sminos-Session: cursor235#b93055dd (cua on macbook)
…each child's frame up to 512 and checking the bisected run against samples above, with the invariant as a check (refs #304)

Ruling f1a7589f on the hosted A/B of f20a25e against 566e361, which found the single bisected run losing shown children main read: Wikipedia's two-column reference list (wiki-article 90% 100 -> 70.9%, wiki-table 90% 100 -> ~63%) and /fixedtail's fixed toolbar as a long body's last child. shownChildPositions: up to 512 children every child is judged by its own frame (frameless counts as shown); above, the bisected run is checked against the first and last 32 children (an end sample that shows is read with the run) and 32 spread between (one not where its place says falls back to main for that list). WideListInvariantTests walks each tree with the rules off (wideListRules, test-only) and on and fails on any shown child main read that the rules left unread: the regression shapes, the earlier tables, and, given CUA_304_TREES, the spike's 282 trees (0 violations; 1,141 with the first build's rule).

Sminos-Session: cursor235#b93055dd (cua on macbook)
…-alias limit, and reports dumps that lost alias edges as alias-incomplete (refs #304)

The review of 566e361..bc4d395: the check's excuse (an element read but not taken up) passed a loss rule B caused, and the loader, rebuilding each parent from the element's one emitted place, dropped other parents' references. The excuse is gone: any shown child main read that the rules left unread is a loss. testTheRulesCanPostponeAWaitingElementTwoParentsList pins the stated limit as measured (main reads the shown child at 620 nodes, the rules do not). The loader counts each rebuilt list short of its recorded count; such a tree is alias-incomplete, never verified, and a round trip of the limit's shape shows why. The spike's 282 trees: 154 verified, 128 alias-incomplete (863 lists, all in tables), 0 losses. Decision Log text updated.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…s children wait, takes that place, so its children wait in main's order (refs #304)

Ruling 0092b8c7 on the review of 566e361..bc4d395: rule B left a wide list's offscreen child waiting, a later visible parent read it, and its children then waited behind whatever lay between the two places, so a cut main passed took its shown child. placeEarlier: when the selection meets an already-read element at an earlier document place while its children still wait, the element takes that place (path, depth, clip) and its waiting entry moves there in the document's order; one that shows there is taken up at once; a column's entry moves within lastly. Nothing is read or charged. Descriptions keep judging against the place it was read at (readPath). The move is one of the wide-list rules, so the invariant check's baseline stays main. Tests: the two parents' case passing with no loss at 620 nodes, the element emitted once at its preorder place, the move charging nothing, an element shown at the earlier place taken up at once, and the uncut walk over a waiting alias. Replay: 154 verified, 128 alias-incomplete, 0 losses.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…olumns taken up last go unjudged, and the rule's frame reads are counted apart (refs #304)

The loader reads the full dumps' chosenIds (run 42352124120), shared children in every parent's list, a never-emitted child loaded as an unreadable element: 52 trees, 52 verified, 0 losses (the 282 stay 154 verified, 128 alias-incomplete, 0 losses). The cost trace over those dumps finds each judged list reading what the rule states (118 frames on the 6,000-row table, 114-117 on the 3,000-row one, every child up to 512), gaps pushed and frames cached, so the A/B's widthMs excess is the live price per read on Chromium's large tables, not the count. A column taken up from lastly, once nothing else waits, is no longer judged; the walk counts frameReads, wideLists, wideListFrames and wideListMs so the next run can price the rule's reads. Test: a 6,000-row list within its stated reads uncut and cut, its columns unjudged.

Sminos-Session: cursor235#b93055dd (cua on macbook)
… it is already read (refs #304)

The review of dc4b5f3..aab236f: reaching lastly shows only that nothing else waits, not that the column's children were read through rows, so a column of its own children (250, items 200-234 in view) behind a visible group of 100 lost its shown items at 250 nodes, which main read. The shortcut now holds only when every child is already selected; otherwise the column is judged as any list. Test: that shape through the invariant check; the relisting table's frame-read bound stays.

Sminos-Session: cursor235#b93055dd (cua on macbook)
…refs #304, refs #309)

Sminos-Session: cursor235#b93055dd (cua on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T12:32:11.813596Z 99b45b1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit 51b473f into main Nov 7, 2026
5 checks passed
SSFSKIM added a commit that referenced this pull request Nov 7, 2026
… Firefox and VS Code, brought to main; the kit stays on probe/287-hosted (refs #287)

Sminos-Session: cursor235#b93055dd (cua on macbook)
SSFSKIM added a commit that referenced this pull request Nov 7, 2026
…i claim corrected (#287) (#319)

* Evidence: #287's run of the #282-#311 chain on stable Chrome, Safari, Firefox and VS Code, brought to main; the kit stays on probe/287-hosted (refs #287)

Sminos-Session: cursor235#b93055dd (cua on macbook)

* Spec: #287's Decision Log entry (the measured set, the divergences' tickets #312-#318, the stated limits) and #282's item 11 amended: Safari never answers clickUnconfirmed, Firefox does (refs #287)

Sminos-Session: cursor235#b93055dd (cua on macbook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant