Skip to content

test(ui): hold interactions to counted work budgets - #1569

Merged
kvlonge merged 1 commit into
mainfrom
test/ui-work-budgets
Nov 18, 2026
Merged

kvlonge merged 1 commit into
mainfrom
test/ui-work-budgets

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Why

The UI's speed guards time interactions, so they can't block merges on hosted runners whose speed varies. This adds guards that count work instead. A regression that re-renders on every frame, draws every row or reads twice gives the same numbers on any machine, so the check can be required.

Changes

  • ui/e2e/budgets.spec.ts runs fixed gestures on the large mock project: wheel zoom and drag-pan on the large group and the Lineage overview, reopening Checks with thousands of checks and scrolling its list, switching plan sections, and Show more. For each gesture it counts Chrome's layouts and style recalculations, DOM mutation records, DOM nodes, rows or cards drawn, and mock client reads, and checks them against a budget. Each budget has a comment saying where its count comes from.
  • Headroom: while a gesture is counted, the graph canvas's settle timer is held and runs once at the end, and interval ticks are skipped. This makes DOM changes and reads exact on every run, so they get +2. Layouts and style recalculations still move by a few, because Chrome batches them per frame. They get the highest count seen, plus the spread seen, plus 2.
  • The mock client counts calls per method. A new ?still option stops mock runs from advancing on their own.
  • A new budgets Playwright project runs as a required step in the UI job.

Verification

  • 10 runs each at 1× and 6× CPU: reads and graph DOM changes were identical across runs, plan sections were identical in every metric, and the remaining metrics stayed inside their spread.
  • A deliberate regression fails each budget: windowing off (5,000 rows drawn instead of 20) fails both Checks budgets, one extra attribute write per frame (+35 to +45 DOM changes) fails all four graph budgets, and a duplicate page read (2 reads instead of 1) fails three plan budgets.
  • npm run check, npm test, and the layout project.

Count what each interaction costs instead of timing it: layouts, style
recalculations, DOM mutations, DOM nodes, rows or cards drawn, and mock
client reads, for graph pan and zoom, Checks, and plan sections on the
large mock project. The graph's settle timer is held while a gesture is
counted, so DOM changes and reads are the same on every run. Each budget
notes where its count comes from, and the budgets run as a required step
in the UI job.
@kvlonge
kvlonge marked this pull request as ready for review November 18, 2026 09:01
@kvlonge
kvlonge enabled auto-merge November 18, 2026 09:03
@kvlonge
kvlonge added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 222ba1e Nov 18, 2026
64 checks passed
@kvlonge
kvlonge deleted the test/ui-work-budgets branch November 18, 2026 09:58
kvlonge added a commit that referenced this pull request Nov 18, 2026
…rk budgets

The 10K wall-time checks for Ack and going back to the Overview sat at their
budgets and failed under ordinary load. Following #1569, the required budgets
project now counts layouts, style recalculations, DOM changes, nodes, rows
drawn and mock reads for each interaction the timing test covers: opening the
folder view, expand all, opening one folder, scrolling the opened tree, going
back to the Overview and acknowledging nodes out of date. The wall-time test
stays as it was, in the non-required UI timings job, which reports it.

Acknowledging holds back the Overview's read that follows (the mock client's
reply timer) and requires the item to have left the list already, so the
settling that moves it at once is checked without timing it.

Budgets come from 10 runs each at 1x and 6x CPU, with #1569's headroom. Both
regressions tried are caught: with the folder tree's windowing off, expand all
draws 4,480 rows against 28; with settling off, the item stays listed while the
read is held, and styles go over budget.
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.

1 participant