Skip to content

fix(ui): make Control UI E2E captures repeat byte-for-byte - #166414

Merged
steipete merged 2 commits into
mainfrom
fix/ui-capture-raster-determinism
Oct 7, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/ui-capture-raster-determinism

Conversation

@steipete

@steipete steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Control UI E2E screenshot captures still differed by a few edge pixels between runs after #165353. The cause was the paint history that came before the capture, which made exact pixel gates intermittently flag unchanged source.

User Impact

There is no user-visible change. For maintainers, shared Control UI E2E captures now repeat byte-for-byte on macOS, so exact pixel gates can tell real visual changes from renderer noise.

Why This Change Was Made

#165353 removed the harness-level nondeterminism. It left one residual at the Chromium raster level: sparse anti-aliased edge pixels on rounded catalog cards (3–16 px) and on the fractional top/bottom rows of the Telegram modal header (5–21 px, max channel delta 1). Same-page recaptures were always exact. A fresh navigation or modal reopen, with identical final geometry, could rasterize those edges differently. The cause is GPU tile rasterization depending on prior paint history, not layout, animation, hover, or the capture helper. Non-capturing geometry/computed-style diagnostics showed stable boxes, no transforms, no will-change, and no active animation on the affected elements.

The shared suite now launches Chromium with --disable-gpu-rasterization alongside the existing --disable-partial-raster, in both server/browser launch orders. Caller arguments still come last. Browser diagnostics on the fixed launch confirm the change is narrow. Tile rasterization becomes software, while GPU composition (Graphite/Dawn/Metal), WebGL, WebGPU, 2D canvas, and video stay hardware-accelerated. Rasterization is the only feature that switches to software. The duplicated launch call is folded into one helper.

Variants that were tried and rejected:

  • --num-raster-threads=1 still differs, so the cause is not raster scheduling.
  • --disable-skia-graphite is exact, but on Chrome 153/macOS it falls back to software raster and composition, because there is no hardware GL fallback on Mac. That is broader than needed.
  • --disable-gpu is exact but broader still.

Re-enabling CDPScreenshotNewSurface was excluded as redundant, because Playwright 1.63 already enables it.

The previously reported LayerTree observer effect has a source explanation. Enabling layer debug info forces a full paint invalidation (LocalFrameView::PaintTree), which hid the history dependence in every instrumented run. The exact upstream Skia defect is not identified. Also note that CPU and GPU raster anti-alias differently, so captures taken before this change will not match captures taken after it. No reference images are committed; the contract is exact repetition with one renderer.

Evidence

All comparisons are exact decoded RGBA plus PNG bytes over every pixel of every target, with no tolerance, masks, exclusions, skipped targets, or retries of differing images. Runs used macOS on an Apple M4 Max with Chrome 153.0.8010.12 and Playwright 1.63.0, under nice -n 10 with load recorded per run (the host was heavily shared, load 40–400).

Proof inputs. The four lane-owned parity specs (l357-{pages,settings,chat,panel}-parity) and their two helpers were recovered byte-exact from session logs and verified against their historical SHA-256 receipt. No current-main adjustments were needed. The set has 150 targets in 32 scenarios, with 40 element crops. None of it is committed.

Focused repro (both residual surfaces; each fresh browser captures initial + 2 settled recaptures + 2 reopen/renavigation per surface):

Variant Fresh browsers Catalog mismatches Telegram mismatches
Interleaved control (unchanged) 13 39/60 cross-run, 16/26 reopen 8/60 cross-run, 26/26 reopen
One raster thread 2 4/5 1/5
CPU tile raster (this PR) 25 0/120 cross-run, 0/50 reopen 0/120 cross-run, 0/50 reopen

The control and fixed launches were interleaved (B,F,F). An independent audit of the raw images certified the result (certified=true, error_count=0).

Full parity proof on the fixed head: a fresh reference plus three back-to-back passes. Every run completed 32/32 scenarios with the complete equal-dimension 150-target inventory, and 40/40 element crops matched their own page frame.

Pair Exact RGBA Exact PNG bytes
Reference–Pass 1 150/150 150/150
Reference–Pass 2 150/150 150/150
Reference–Pass 3 150/150 150/150
Pass 1–Pass 2 150/150 150/150
Pass 1–Pass 3 150/150 150/150
Pass 2–Pass 3 150/150 150/150

For comparison, #165353's final head reached 150/150 pass-vs-pass but only 149/150 against its reference.

Gates (local macOS, --maxWorkers=1):

  • pnpm tsgo:ui passed (118 s); pnpm tsgo:test:ui passed (66 s on the final head).
  • Scoped oxlint/oxfmt and git diff --check are clean.
  • ui/src/test-helpers/control-ui-e2e-suite.test.ts: 20/20 (142 s on the final head).
  • initial-connect-splash.e2e.test.ts + chat-flow.messaging.e2e.test.ts: 31/31 (125 s on the final head).

Codex autoreview is clean through P2.

Refs #165353.

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:38 AM ET / 04:38 UTC (Revision 2).

ClawSweeper review

What this changes

The shared Control UI browser-test harness disables GPU tile rasterization, shares launch options between both startup orders, and documents the capture contract.

Merge readiness

✅ Ready for maintainer review

This PR still addresses a documented residual that current main leaves unresolved. The introduced changes are focused, the reported browser comparisons exercise the changed behavior, and no blocking defect was found.

Priority: P2
Reviewed head: 9488de6d91859613680df995620861558df9c1d6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable patch supported by unusually thorough reported browser comparisons and relevant final-head checks.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured PR body reports real macOS Chromium runs through the changed shared-suite launch boundary, with interleaved failing controls and zero fixed capture mismatches on both residual surfaces plus complete 150-target parity. This proves rendering behavior despite mocked Gateway data; raw images were not independently inspected. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR body reports real macOS Chromium runs through the changed shared-suite launch boundary, with interleaved failing controls and zero fixed capture mismatches on both residual surfaces plus complete 150-target parity. This proves rendering behavior despite mocked Gateway data; raw images were not independently inspected. No stored-data contract changes.
Evidence reviewed 7 items Introduced change: The pinned introduction delta adds GPU-rasterization disabling and consolidates the two launch calls without changing server ordering, cancellation checks, caller argument placement, or executable selection.
Still necessary on current main: Fetched main still launches both paths with only --disable-partial-raster. The earlier merged #165353 explicitly documented remaining catalog and modal edge-pixel differences; it does not supersede this follow-up.
Real browser capture evidence: The complete captured PR body reports macOS M4 Max, Chrome 153.0.8010.12, and Playwright 1.63.0 runs through the shared suite: 25 fixed browser launches yielded zero cross-run or reopen mismatches on both residual surfaces, while 13 interleaved controls reproduced differences. A reference and three passes matched all 150 targets in decoded RGBA and PNG bytes across six pairings. These are browser-rendering observations, not mocked raster results. Raw images were retained by the author and were not supplied in the review scratch directory; this review assessed the reported results rather than independently auditing those files.
Findings None None.
Security None None.

How this fits together

The Control UI E2E harness launches Chromium and the test app for browser scenarios. Its renderer settings affect screenshots used to distinguish visual changes from capture noise.

flowchart TD
  A[Browser test scenarios] --> B[Shared suite setup]
  C[Caller launch options] --> B
  B --> D[Chromium with CPU tile rasterization]
  D --> E[Rendered Control UI]
  E --> F[Page frames and element crops]
  F --> G[Exact image comparisons]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +2, Docs 0. Total +2 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 13 11 +2
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 14 12 +2

Review metrics

Metric Value Why it matters
Reported capture repetition 25 fixed launches; 150 targets exact across 6 pairings The browser comparisons directly cover the residual raster noise rather than relying on passing lifecycle tests.

Technical review

Best possible solution:

Keep rasterization policy in the shared launch owner and compare captures produced with the same renderer, without masking pixel differences.

Do we have a high-confidence way to reproduce the issue?

Yes, the reported interleaved fresh-browser experiment provides a concrete reproduction path for the catalog and modal edge differences. This read-only review did not independently execute it.

Is this the best way to solve the issue?

Yes, the shared launch owner is the narrowest place to address renderer-dependent capture noise, and the reported experiments favor disabling tile GPU rasterization over disabling GPU composition or masking differences.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 078ca8950dbc.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This improves visual-validation reliability with no shipped user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured PR body reports real macOS Chromium runs through the changed shared-suite launch boundary, with interleaved failing controls and zero fixed capture mismatches on both residual surfaces plus complete 150-target parity. This proves rendering behavior despite mocked Gateway data; raw images were not independently inspected. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body reports real macOS Chromium runs through the changed shared-suite launch boundary, with interleaved failing controls and zero fixed capture mismatches on both residual surfaces plus complete 150-target parity. This proves rendering behavior despite mocked Gateway data; raw images were not independently inspected. No stored-data contract changes.

Evidence

What I checked:

  • Introduced change: The pinned introduction delta adds GPU-rasterization disabling and consolidates the two launch calls without changing server ordering, cancellation checks, caller argument placement, or executable selection. (ui/src/e2e/control-ui-e2e-suite.test-support.ts:526, 9488de6d9185)
  • Still necessary on current main: Fetched main still launches both paths with only --disable-partial-raster. The earlier merged test(ui): make Control UI E2E captures byte-reproducible #165353 explicitly documented remaining catalog and modal edge-pixel differences; it does not supersede this follow-up. (ui/src/e2e/control-ui-e2e-suite.test-support.ts:537, 078ca8950dbc)
  • Real browser capture evidence: The complete captured PR body reports macOS M4 Max, Chrome 153.0.8010.12, and Playwright 1.63.0 runs through the shared suite: 25 fixed browser launches yielded zero cross-run or reopen mismatches on both residual surfaces, while 13 interleaved controls reproduced differences. A reference and three passes matched all 150 targets in decoded RGBA and PNG bytes across six pairings. These are browser-rendering observations, not mocked raster results. Raw images were retained by the author and were not supplied in the review scratch directory; this review assessed the reported results rather than independently auditing those files. (9488de6d9185)
  • Renderer tradeoff and validation: The PR explicitly records that CPU and GPU anti-aliasing differ, so comparisons must use the same renderer; no committed reference images require migration. It reports retained GPU composition and browser capabilities, 20 lifecycle tests, 31 focused browser tests, and both UI typechecks passing on the final head. The inspected capture helpers retain their readiness and single-frame crop checks. (.agents/skills/control-ui-e2e/SKILL.md:76, 9488de6d9185)
  • Verified merge scope: The test-merge object's raw parents are the pinned base followed by the exact PR head. Its delta against that base affects only the two introduced paths; the three base-only files are not removed by this PR. (9d666cb7e1fe)
  • Merged area history: Current-main history lists repeated shared-harness work by Peter Steinberger. GitHub verifies steipete as the author of the earlier merged capture fix, whose patch added partial-raster disabling to both launch paths. (ui/src/e2e/control-ui-e2e-suite.test-support.ts:531, d73a255ebf33)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-07T03:13:18.240Z sha 55e9b05 :: needs maintainer review before merge. :: none

Use CPU tile rasterization while retaining GPU composition and browser
capabilities. GPU rasterization kept different fractional-edge pixels after
otherwise identical layouts and modal reopen histories.

Add --disable-gpu-rasterization in both shared suite launch orders and
document the capture contract, retaining caller arguments and full-tile
rasterization. The audited A/B sample has 25 fixed launches with zero RGBA
or PNG-byte mismatches and 13 interleaved controls that reproduce the noise.

Validation: UI production/test typechecks, scoped lint and formatting,
20 lifecycle tests, 31 focused E2E tests, and independent Codex review.
Refs #165353.
Both server/browser launch orders now call one helper, so the capture
determinism flags cannot drift between them. Behavior is unchanged.
@steipete
steipete force-pushed the fix/ui-capture-raster-determinism branch from 55e9b05 to 9488de6 Compare October 7, 2026 04:32
@steipete
steipete merged commit f28f55f into main Oct 7, 2026
87 checks passed
@steipete
steipete deleted the fix/ui-capture-raster-determinism branch October 7, 2026 04:56
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…166414)

* test(ui): make screenshot rasterization reproducible

Use CPU tile rasterization while retaining GPU composition and browser
capabilities. GPU rasterization kept different fractional-edge pixels after
otherwise identical layouts and modal reopen histories.

Add --disable-gpu-rasterization in both shared suite launch orders and
document the capture contract, retaining caller arguments and full-tile
rasterization. The audited A/B sample has 25 fixed launches with zero RGBA
or PNG-byte mismatches and 13 interleaved controls that reproduce the noise.

Validation: UI production/test typechecks, scoped lint and formatting,
20 lifecycle tests, 31 focused E2E tests, and independent Codex review.
Refs openclaw#165353.

* refactor(ui): share the E2E suite browser launch options

Both server/browser launch orders now call one helper, so the capture
determinism flags cannot drift between them. Behavior is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant