Skip to content

test(interaction-harness): each trackMarkers color may have a region - #10808

Merged
cixzhang merged 3 commits into
meta:mainfrom
vjeux:test/trackmarkers-color-regions
Nov 10, 2026
Merged

cixzhang merged 3 commits into
meta:mainfrom
vjeux:test/trackmarkers-color-regions

Conversation

@vjeux

@vjeux vjeux commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

A busy proof that tracks its marker with trackMarker and its control with trackControl decodes every cast frame twice.
trackControl searches only the control's strip, and trackMarkers took one region for every color, so the two could not share a decode.
Nine proofs decode one cast more than once through trackControl today, three of them three times.
This change adds the means; those proofs move to it in follow-ups.
On a loaded runner each decode pass over a cast takes seconds.

Intended invariant

A proof can track every color it needs from one decode of each frame, each color in its own search area.
Each color's track is the one a call for that color alone returns.

Change

  • trackMarkers takes a color as a MarkerColor, {rgb, region}, and searches that color only in its own region. Colors with the same area share one read of its pixels.
  • controlColor({ahead}) gives the control's color with the strip it crosses.
  • trackControl reads through trackMarkers with controlColor, and returns the same tracks.

Most of the diff in frames.ts re-indents the scan loop. git diff -w shows the change.

Evidence

  • Failure before the change: a proof could not find its marker and the control in its strip from one decode.
  • Success after the change: on a recorded cast in Chromium and WebKit, one decode finds the marker and both controls. Each track equals, frame for frame, what trackMarker and trackControl find. A drawn decoy outside the control's strip is found by the bare color and skipped by controlColor().
  • 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

Main's merge, 175b3d1, touches three of this PR's files: busy.ts, frames.ts and the harness README.
It leaves this PR's own lines unchanged.
At the merge, at the CI profile:

  • frames.trackMarkers.interaction.browser.spec.ts, one worker, three repeats: 9 of 9 runs in Chromium and 9 of 9 in WebKit.
  • The harness spec, four workers: 166 passed and 15 skipped in Chromium, and 152 passed and 29 skipped in WebKit.
  • Harness units: 302 of 302. The harness and core type checks pass.

A second merge, eec7cc0, brings main's lockfile and touch changes.
It touches none of this PR's files.
Its runs follow a fresh frozen install, at the CI profile.

  • frames.trackMarkers.interaction.browser.spec.ts, one worker, three repeats: 9 of 9 runs in Chromium and 9 of 9 in WebKit.
  • The harness spec, four workers: 166 passed and 15 skipped in Chromium, and 152 passed and 29 skipped in WebKit.
  • Harness units: 304 of 304. The harness and core type checks pass.

The figures below are from the head before the merges, ccc5e81, at the CI profile with one worker.

  • frames.trackMarkers.interaction.browser.spec.ts, five repeats: 15 of 15 runs in Chromium and 15 of 15 in WebKit. Each call there decodes its own copy of the frames.
  • Mutant, not for landing (fbe8c19): trackMarkers ignores a color's own region. The decoy test fails in both engines; the other two pass.
  • Old code against new, not for landing (8308472): main's trackMarkers, copied verbatim, reads one recorded cast per engine.
    Its marker and control tracks equal this head's trackMarker, trackControl and one-decode trackMarkers, frame for frame: 3 of 3 runs in each engine.
  • The harness spec in Chromium: 162 passed, 15 skipped. Its control tests in WebKit: 5 passed, 1 skipped.
  • Harness units: 243 of 243.
node_modules/.bin/playwright test --config playwright.interaction.config.ts --workers=1 \
  internal/interaction-harness/src/frames.trackMarkers.interaction.browser.spec.ts \
  internal/interaction-harness/src/harness.interaction.browser.spec.ts

Prettier, ESLint, the harness and core type checks and review:pre are clean at both merges.

A busy proof that tracked its marker and its control decoded each cast
frame twice. trackControl searches only the control's strip, and
trackMarkers took one region for every color. A color may now carry
its own region, and controlColor gives the control's color with its
strip, so one decode serves both. trackControl reads the same tracks.
@vercel

vercel Bot commented Nov 9, 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 10, 2026 5:37pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 10, 2026, 5:39 PM UTC

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

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · eec7cc0

Storybook · Sandbox · built from this PR's head

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: none in this pull request

Committed API report behind this build: cli 36 rows, core 36 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

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 9, 2026
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec ccc5e81

@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. The pull request is a draft and its branch is in a fork, so CI starts once it is marked ready for review and a maintainer adds the ci:run label.

Per-color regions keep one decode per frame, trackControl returns the same tracks as before, and the decoy test pins the new region behavior.

One optional fix:

  • The startBusyControl doc comment (busy.ts:110-114) now points every control at controlColor(), which searches only the top strip, but a control mounted within a moving dialog leaves that strip, so scope the sentence to a top-layer control as the README does.

[Automated review]

Comment on lines +112 to +114
* `busyWindowProof` as `control`. `trackMarkers` with the marker's colour and
* `controlColor()` finds both in one decode of each frame; `trackControl`
* reads the control alone.

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.

Non-blocking: this now sends every caller to controlColor(), which searches only the top strip. A control started with within moves with its dialog, and the README tracks that one over the whole frame. Someone who follows this text for a moving sheet loses the control once the sheet carries it out of the strip. Suggested wording:

 * `busyWindowProof` as `control`. For a top-layer control, `trackMarkers` with
 * the marker's colour and `controlColor()` finds both in one decode of each
 * frame; track a `within` control over the whole frame (`CONTROL_RGB`).

@vjeux
vjeux marked this pull request as ready for review November 9, 2026 15:38
@vjeux
vjeux marked this pull request as draft November 10, 2026 16:35
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 175b3d1

@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. The pull request is a draft, so CI starts once it is marked ready for review; it already carries the ci:run label.

Per-color regions keep one decode per frame, trackControl returns the same tracks as before, and the decoy test pins the new region behavior.

One optional fix, still open from the last review:

  • The startBusyControl doc comment (busy.ts:113-117) points every control at strip-only searches (controlColor() and trackControl), but a control mounted within a moving dialog leaves that strip, so scope the sentence to a top-layer control as the README does.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec eec7cc0

@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. The pull request is a draft, so CI starts once it is marked ready for review; it already carries the ci:run label.

This head only merges main, and the change itself is unchanged. Per-color regions keep one decode per frame, trackControl returns the same tracks as before, and the decoy test pins the new region behavior.

One optional fix, still open from the last review:

  • The startBusyControl doc comment (busy.ts:113-117) points every control at strip-only searches (controlColor() and trackControl), but a control mounted within a moving dialog leaves that strip, so scope the sentence to a top-layer control as the README does.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 10, 2026 17:56
@cixzhang
cixzhang merged commit fd5cf0d into meta:main Nov 10, 2026
125 checks passed
@vjeux
vjeux deleted the test/trackmarkers-color-regions branch November 10, 2026 18:18

This branch was successfully deployed

1 active deployment
Preview — eec7cc07 Deployed Nov 10, 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