Repository navigation
fix(ui): make Control UI E2E captures repeat byte-for-byte - #166414
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 12:38 AM ET / 04:38 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +2, Docs 0. Total +2 across 2 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
55e9b05 to
9488de6
Compare
|
Merged via squash.
|
…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.
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-rasterizationalongside 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=1still differs, so the cause is not raster scheduling.--disable-skia-graphiteis 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-gpuis exact but broader still.Re-enabling
CDPScreenshotNewSurfacewas 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 10with 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):
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.
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:uipassed (118 s);pnpm tsgo:test:uipassed (66 s on the final head).git diff --checkare 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.