Skip to content

Spike: how often real pages truncate the observation, leaving clicks the stale-point guard can't check #299

Closed

Description

@SSFSKIM

Problem

#296's stale-point guard cannot check a point the observation couldn't record. The design session ruled this a stated limit (1ea561bc 0a14b51f). Two cases:

  • (a) unrecordedDescendant. The clicked control lies inside a recorded container whose children the walk did not all record. The walk stops at its width rule, depth cap, node or byte budget, or deadline. The guard checks the container only: same identity, its frame still containing the point, its title matching. Anything inside it is pressed or posted unchecked.
  • (b) unrecorded. The point lies in no recorded node, so nothing is checked.

How often real pages hit these budgets is unmeasured. If large pages hit them often, the guard's protection is thinner there than the false-positive table suggests.

Intent

Measure how often real observations truncate and where: which budget fires, at what depth, and what share of a page's clickable area ends up in an unrecorded or truncated region. Use a set of real, large pages:

  • a long news page;
  • a web app such as a mail client or a board;
  • a long table.

Then decide whether the budgets, or the guard's handling of truncated regions, should change.

Constraints

Success criteria

  • A table of truncation frequency and clickable-area share per page.
  • A recommendation: leave it, raise a budget, or guard truncated regions differently.

Activity

  1. added
    status:ready-for-implementer
    priority:P3
    spike
    on Nov 6, 2026
  2. added 2 commits that reference this issue on Nov 6, 2026
  3. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 6, 2026
  4. SSFSKIM commented on Nov 6, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Taken by cursor235 (design session e249dc50): hosted measurement of observation truncation on real large pages

  5. SSFSKIM commented on Nov 6, 2026

    @SSFSKIM
    OwnerAuthor

    Findings: spike #299 (hosted macOS, 2 reps, main c4057c3)

    Run: https://github.com/SSFSKIM/cua/actions/runs/42202647390 (8 jobs, green). Kit probe/299-hosted at 7c92f7b, with offline simulators at d771345. Runner: macOS 26.6.2, Chrome for Testing 156.0.8078.47, Safari 26.6.2. No clicks were posted. The classifier rebuilds the guard's screenshotNodes from the observation and applies stalePointVerdict's container rule against a live hit-test at every clickable point on a 20-pt grid.

    The answer.

    • The 4,000-node budget (maxObservedNodes, Walk.swift:13, cua's own) is the only limit that cuts the record.
    • How it cuts: the walk spends the budget depth-first from the top of the document. On long pages, a viewport scrolled to 25% or more lies past where the budget runs out.
    • The effect at the guard: every clickable point there reads unrecordedDescendant (container-only).
    • What never fired:
      • unrecorded: 0 points;
      • depth: at most 25 of 200;
      • bytes: at most 3.1 of 6 MiB;
      • deadline: at most 3.7 of 10 s.
    • The width rule: its visible subset left 0% unchecked on Finder and Safari. Its omitted branch (more than 499 children, no visible subset) cut Safari's HN thread to the table container.

    Share of clickable points the guard checks on main:

    Target Top, 1 and 2 screens down 25% / 50% / 90% down
    Chrome, Wikipedia "United States" (32.6k nodes in full) 96–97% 19 / 30 / 15%
    Chrome, Wikipedia population table (13.6k) 91–94% 89 / 24 / 15%
    Chrome, local 3,000-row table (over 40k) 84–94% 34 / 32 / 32%
    Chrome, HN "Who is hiring" thread (over 48k) 86–91% 40 / 52 / 41–45%
    Chrome, HN front page, GitHub issues, repo tree, code view 100% 100% (the code view is virtualized)
    Safari, Wikipedia 100% 13–36% at 20 and 60 screens
    Safari, HN thread (width rule, omitted branch) 45 / 52 / 71% –
    Safari, local table; Finder on a big folder; TextEdit with 20k lines 100% 100%

    Raising the budget does not pay.

    • Cost: about 0.40 ms (p50) and 0.61 ms (p95) of walk per node, and about 758 bytes per node.
    • The byte budget would therefore fire at about 8.3k nodes.
    • The full Wikipedia tree takes 12–16 s and 25 MB.
    • At 16k nodes in preorder, Wikipedia at 90% is still only 44% checked.

    Choosing which 4,000 nodes to keep does pay. This was simulated offline over the wide engine's full trees. The simulator reproduces main's readings exactly at 4,000 in preorder.

    • Frame-ordered (visible first): gives 100% on Safari, even at 2,000 nodes.
    • Chrome frames can't order the walk: offscreen boxes are clamped to 1-pt strips at the viewport edge, and collapsed containers report strips.
    • Chrome, seeded by hit-test chains: seeding the kept set with the hit-test ancestor chains of about 100 points (an 80-pt grid) gives 100% on every Chrome tree the wide engine read in full, at 4,000 and at 2,000 nodes. The seeding costs about 1.5–4 ms per point, about 150–400 ms per observation.
    • Trees too big for the wide engine: where even it was cut (the local table, the HN thread), visible-first reaches 90–94%, except the HN thread at 90%, which lies past 40k entirely.

    A re-read at click time alone is weak. There is nothing recorded to compare it with, so it can only refuse or pass. It costs p95 4 ms on Chrome but up to 1.1 s on Safari's wide tables.

    Recommendation, for the design session's ruling:

    1. Spend the node budget visible first: frame-ordered on WebKit and native, seeded by hit-test chains on Chromium. Print the kept nodes in document order.
      • This also fixes the model's own tree: on a deep page today, the tree lacks what the screenshot shows.
      • The budget is cua's own, so there is no vendor-parity cost.
    2. Give the width rule's omitted branch the visible-subset treatment, in the guard's record only, so the vendor's tree is unchanged.

    Raw data: the runner's artifacts (compact.md, report.md and simulate-final.txt in the run).

  6. removed
    status:in-progress
    on Nov 6, 2026
  7. SSFSKIM commented on Nov 6, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Spike complete: findings comment 6683886367 is the deliverable; ruling aed3f041 spawned the build ticket.

  8. added 2 commits that reference this issue on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:P3spike

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions