Repository navigation
feat(control-ui): report source-mapped benchmark CPU attribution - #174756
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. What this changesThis PR adds opt-in source-mapped CPU reports and baseline comparisons for benchmark reload, live-event, and streaming phases. Example: Run the benchmark with --cpu-profile --live-events --untraced.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this useful maintainer-owned experiment open and honor its explicit do-not-merge hold; no definite introduced correctness defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe developer benchmark drives production Control UI assets against a synthetic Gateway, then converts Chromium CPU samples and adjacent source maps into terminal tables and JSON artifacts. flowchart LR
A[Benchmark options] --> B[Production UI and synthetic Gateway]
B --> C[Chromium CDP profiler]
C --> D[Existing source map decoder]
D --> E[CPU accounting and medians]
E --> F[Terminal tables and JSON reports]
Technical reviewBest possible solution: Retain the experiment for its owner to validate phase attribution and decide when it is ready. Do we have a high-confidence way to reproduce the issue? This is a tooling capability addition; source inspection establishes the previous reporting limitation without requiring a product-bug reproduction. Is this the best way to solve the issue? Extending the existing CDP profiler and source-map owner is a focused solution, with profiling overhead explicitly separated from performance comparisons. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 009f93170ec1. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +76, Docs +22, Other +225. Total +323 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 6:31 PM ET / 22:31 UTC. |
d2229c4 to
a9a2fe5
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9a2fe5386
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ae63093 to
4c974b9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c974b96f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e5d3563 to
fc5bb9b
Compare
|
L131 coordination: I’m improving the Team-scale query/cron/plugin fixtures, warm sidebar + trimmed v8 snapshot preparation, Online setup, and a bench-versus-sanitized-live fidelity report. I will not duplicate or modify the CPU flag/profiler implementation in this PR. While this remains unmerged, the fidelity report will reuse the campaign’s existing cpuprof2.py analyzer against raw captures; after landing it can consume your complete CPU tables. The bench edits will overlap setup/settle and fixture bindings only. |
fc5bb9b to
9425b0b
Compare
|
@clawsweeper re-review Final-head CPU attribution and comparison proof, focused tests, full UI results, and matching main evidence for both inherited UI failures are now documented in the PR body. Independent review is clean through P2. The campaign lead owns landing; this request is for review only. |
|
🦞👀 Re-review progress:
|
…ch (openclaw#174756) Several reload-performance experiments failed because the bench never executed the live hot path, which was only discovered after implementing a fix. Live Team profiling now uses DevTools CPU profiles mapped through the release's source maps; this brings the same attribution into the bench. `--cpu-profile` records CPU profiles for the measured reload, live-event and streaming phases, maps frames through the built UI's source maps, and prints per-run and median tables (self time, inclusive by source file, inclusive by source function) plus cpu-profile.json; `--cpu-profile-compare <baseline>` diffs a run against a saved report. Default timing runs are unaffected, and profiled timings must not be mixed with unprofiled pairs. ui/AGENTS.md now says to prove the bench executes the live hot function before measuring a fix. Tooling only: +276 non-test LOC, no application runtime change. Fourteen AWS c7a.4xlarge captures contained all six live hot functions; comparison, streaming and warm-snapshot checks pass. 15 unit + 2 browser tests pass; exact-head CI green; the two full-UI failures reproduce on main.
What Problem This Solves
Cold-load benchmark results could not establish whether a proposed fix exercised live rendering or session reconciliation before measuring it. Campaign evidence recorded 14 visible states over roughly 15 seconds during a signed-in reload of a dashboard deep link. This tooling makes hot-path reproduction reviewable without publishing private captures.
User Impact
Developer tooling only. The previous report exposed 20 reload self-time rows;
--cpu-profilenow preserves complete source-mapped reload, live-event replay, and optional streaming tables, per run and as medians.--cpu-profile-compare <baseline.json>prints candidate-minus-baseline function deltas.Use profiling to prove reproduction, then measure application speed in separate unprofiled interleaved runs. Profiling inflates timing; this PR claims no application speedup.
Why This Change Was Made
Extend the existing CDP profiler and source-map owner using Node's existing decoder, with no new dependency. Reports include self time, inclusive function time, and inclusive source-file time. Recursive functions/files count once per sample; missing functions count as zero in medians. Complete phase sets are validated before browser startup.
Function keys exclude runtime-only IDs and normalize filesystem source paths relative to the repository. Identical builds at different output depths therefore compare correctly. Unmapped generated lines retain their original frames instead of borrowing a preceding line's source attribution. Real esbuild-emitted maps cover both path normalization and the unmapped-footer regression.
CPU mode uses the existing
ownerProbes: falsepath, and live capture shares one profiler lifecycle with the default raw capture. Default measurement instrumentation and warm-snapshot metrics remain intact. The script header, benchmark guide, and UI reload-performance instructions document the mode and profiling overhead.Evidence
Final head:
9425b0b132ede8f9fc28507269a9912af55b2e3c. Independent autoreview is clean through P2, all actionable review findings are resolved, and exact-head CI is green.AWS
c7a.4xlarge, 16 CPUs / 30 GiB, leasecbx_d9151ef1c787; repository Playwright Chromium, synthetic board-dashboard fixture. Fourteen diagnostic reload/live captures produced all six requested source functions, each at one canonical source location. These are sampled inclusive times, not an application before/after speed comparison; IQR is the 25th–75th percentile interval.IconSvgprepareTimestampparseSessionChangedEventreconcileSessionChangedRowreconcileChangedEventreconcileResultValidation:
OPENCLAW_VITEST_RUNTIME=node pnpm test test/scripts/control-ui-cold-load-trace.test.ts --maxWorkers=1: 15 passed, 3.67 s wall. The unmapped-footer case fails before the correction under Node and passes afterward.OPENCLAW_VITEST_RUNTIME=node pnpm test ui/src/test-helpers/control-ui-cold-load-probes.browser.test.ts --maxWorkers=1: 2 passed, 5.66 s wall. Scoped lint passed.--cpu-profile --live-events --untraced --runs 14, one fresh-build--cpu-profile-compare, traced/default live capture, streaming capture, and mismatched-phase rejection passed. Comparison matched functions across different output depths and emitted 6,635 reload / 4,181 live function rows. Run:run_46c6763b85b4a70678a3259af5cd978a.--cpu-profile --warm-reload --large-snapshot --probe-dir … --untraced --runs 1passed: an 80-message / 190,988-byte saved snapshot and 2,834 CPU function rows. Run:run_43b4e9b940230d45cf5ba36c3146c3da. Earlier warm smoke attempts stopped at missing-probe setup; the complete three-probe payload passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.tscompleted in 6,206.76 s (103m27s): 817 files passed, 2 failed, 1 skipped; 3,543 cases passed, 2 failed, 1 skipped. Run:run_47662a667bf639f89b8be2f3e8a7cb15.Both full-suite failures reproduce on main:
ui/src/e2e/guest-session-controls.e2e.test.tspress("End"), then times out at line 212.6052c9a788df, third bounded attempt after two passes; 37.99 s wall. Runrun_f54a2f3ad21717cf556828aeb27998cc. The PR head also passes in isolation; no passing replay is claimed as a fix.extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsPrivate mutation boundary is writable by another POSIX principal.98375d4b6245: 1 failed / 1 passed, 304.56 s wall. Runrun_43b4e9b940230d45cf5ba36c3146c3da.The skipped file is
ui/src/e2e/desktop-resize.real-gateway.e2e.test.ts. The complete 820-file pass/fail list and logs are retained with the lane's proof. No unrelated CI rerun or update-branch was used to chase these failures.Scope and Release Context
Six files:
scripts/bench-control-ui-cold-load.ts, its Markdown guide,scripts/lib/control-ui-cold-load-trace.ts, its unit test,ui/src/test-helpers/control-ui-cold-load-probes.browser.test.ts, andui/AGENTS.md.Requested non-test diff: +330/−27, net +303 including documentation. Tooling TypeScript: +276; application runtime: 0. Growth supplies the requested report/compare contract while reusing the profiler, decoder, and probe switch. The shared mapper cuts over from the extrapolating
findOriginlookup tofindEntry; no competing decoder or profiler owner is added.Release-note context: cold-load tooling can prove that a hot path runs before a performance comparison. The campaign lead reviews and lands this PR; this lane does not merge it.