Skip to content

test(interaction-harness): a traced Paint names the node it painted - #10486

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:test/harness-trace-event-args
Nov 7, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:test/harness-trace-event-args

Conversation

@vjeux

@vjeux vjeux commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

traceRendering counts the rendering events in a window, but it kept only each event's name and time. A proof that finds one extra Paint in its window can't tell whether the page ran its own animation's frame late, as a starved runner does, or painted another element. The trace already holds both facts with its current categories: each Paint names the node it painted, and each UpdateLayoutTree counts the elements it restyled.

Intended invariant

Every counted Paint in RenderingTrace.events carries the trace's node name, and every counted UpdateLayoutTree carries its element count. No other event carries either field, and the trace's categories don't change.

Change

  • trace.ts: a RenderingEvent type with optional node and elements, which traceRendering fills from each event's args.data.nodeName and args.elementCount.
  • A harness self-test traces a page that restyles five spans in one frame and repaints a composited patch in a later one.
  • README: one sentence in "No Layout / Paint".

Evidence

  • Failure before the change: the self-test against main's trace.ts (4ce3cbe, NOT FOR LANDING) fails with "Expected value: 5, Received array: [undefined, undefined]".
  • With the change it passes 3 of 3 runs, and 12 of 12 at four workers. The trace reads 5 restyled elements and then 1, and Paints that name #document, HTML, then DIV id='patch'.
  • Harness spec in Chromium: 139 passed, 4 skipped. Harness unit tests: 177 of 177.
  • Overhead: the trace's categories and the events it collects are unchanged. The harness reads two fields of events it already holds.
  • Product/runtime behavior verified unchanged: test harness only.
  • CI impact (for a change to workflows, actions or CI scripts): none.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Prettier: clean. ESLint: 0. pnpm review:pre: 0 findings, merge into main clean.

traceRendering kept only each counted event's name and time. Its trace
already names the node each Paint painted, and counts the elements each
UpdateLayoutTree restyled, with its current categories. The counted
events now carry both, as `node` and `elements`. A proof can then tell
a late frame of its own animation from another element's paint.
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 7, 2026 3:14pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 7, 2026
@astracat-bot

astracat-bot Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 7, 2026, 3:26 PM UTC

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4a05620

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 21 rows, core 25 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet. This is a draft from a fork, so once it is marked ready for review, a maintainer adds the ci:run label so CI runs.

traceRendering now keeps each Paint's node name and each style recalculation's element count. The new Chromium self-test fails against main's trace.ts with the message the description quotes, and passes on this head. No changes requested.

[Automated review]

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 7, 2026
@vjeux
vjeux marked this pull request as ready for review November 7, 2026 11:39
@cixzhang

cixzhang commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 4a05620

@cixzhang
cixzhang merged commit 07cc0fd into meta:main Nov 7, 2026
69 checks passed
@vjeux
vjeux deleted the test/harness-trace-event-args branch November 7, 2026 15:37

This branch was successfully deployed

1 active deployment
Preview — 4a056200 Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants