Repository navigation
idle-chats bench: name the shown renderer's idle work, and count a footprint read as 0 as unread - #34155
Conversation
…e, by call site The idle-chats bench reads the shown agent page's renderer at 5.27% CPU with nothing streaming. debug.agent_pane idle_probe counts that page's animation frames, timeouts, intervals, DOM mutations, running animations and long animation frames by call site for a window; bench_power.py idle-chats runs it after the measured window and keeps it in the JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
… unread The page host's script call ends at 5 s, so a 10 s probe timed out. A display run read 0 MB for 24 of 46 live renderers and summed them as 0: the role total said 7.3 GB where the same host now reads 12.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
…t idle debug.agent_pane devtools runs a DevTools method on the chat's Chromium page. The idle-chats bench uses it after the measured window: Performance metrics per second and a 10 s V8 profile by function, so the renderer's idle main-thread time has a name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
The focused chat read 0 ms of tasks in 10 s while a shown agent renderer sat at 2.6%: the busy page is another one. debug.cef_page_devtools runs a DevTools method on one of cmux's own pages by browser id, and debug.cef_pages gives a cmux page's path, so the bench profiles each shown page in one window and names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
Every shown cmux page read 0 ms of tasks and an idle V8 profile in 10 s while renderer-client-id=6's main thread still took 2.5%: the work is native. The bench samples each renderer over 1% for 8 s after the window and keeps its main thread's call tree and heaviest frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
…efore the window The native samples after the window found every busy renderer's main thread waiting: the idle cost may be work that ends by then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
|
Review (codex, router-review): SHIP at 7dd177d Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 3. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at 7dd177d
All 12 bench tests pass with macOS libraries stubbed. Native compilation was unavailable. Follow-ups:
|
The idle probe loads on demand like the other debug fixtures (#33740). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a Passes: CI passes on CI passes on Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base be63d3b; does not block Shipped in:
|
…32 is an input error A probe that started while another ran saved the first one's wrappers and put them back for good; it is now refused. debug.cef_page_devtools read the browser id with Int32(_:), which traps past Int32's range. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-cb01117327fc358e9ba1
|
Review (codex, router-review): SHIP at 77ff2e9 Reviewer: codex gpt-6.1-sol xhigh, fast tier. Follow-ups: 3. Each lands as an issue in this repo that links this receipt; the lane that opened the PR fixes it forward. SHIP at 77ff2e9 Visual verdict: no images; Leo tries the build
Follow-ups:
|
|
Found 12 test failures on Blacksmith runners: Failures
...and 2 more test failures. View all on Blacksmith: run 41710422941, run 41710423137
|
A newer verdict blocks a217cf2 (no independent SHIP at the head).
teamleaderleo
left a comment
There was a problem hiding this comment.
Review (codex gpt-6-astra high, next-review, since=20261103T202138Z): SHIP at a217cf2
SHIP at a217cf2
Visual verdict: unchanged by this diff
- [P2] [follow-up] idleProbe.ts:52: The default 10-second probe exceeds
callPageScript’s 5-second Chromium DevTools timeout. Callingdebug.agent_pane {"action":"idle_probe"}therefore returns a timeout instead of diagnostics; explicit windows above 5 seconds also fail. Use a shorter default and supported maximum, or extend the bridge timeout to cover the requested window.
Follow-ups:
- Align the probe duration and Chromium bridge timeout.
|
Review (codex gpt-6-astra high, sweep, via the review router; full diff from merge base be63d3b to this head): BLOCK at a217cf2 [P1] [blocking] Packages/macOS/CmuxNext/Sources/CmuxNextApp/Control/DebugCEFPages.swift:34 - |
…t, not a sleep (#34259) #34155 (755e54b) added webviews/test/agent-pane-idle-probe.test.ts, whose two window.setTimeout(() => undefined, 5) calls are what idleProbe counts. The gate read them as sleep-then-assert and turned 'Validate test determinism gate' red on feat-cmux-next. Agent-Session: https://cmux.com/deeplink/agent?id=aid-d750cf10922c785efa64 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Stop condition (perf coordinator): "cmux NIGHTLY idles under 5% CPU per process with about 40 chats open, measured with the shared perf harness". Data: manaflow-ai/cmuxterm-hq#6338 (comment 6604253564).
The shared idle bench (
perf-idle-power.sh,idle-chats, display worker) read the shown agent page's renderer at 5.27% CPU at c004201, and the tree's footprint at 7.3 GB before and 13.8 GB after. This PR gives the bench what it needed to name both, and fixes the footprint read that made the memory jump look real.What the bench now records (after the measured window, so the window is unchanged)
idle_probe: for 3.5 s, what the shown chat's page asks for, by call site: animation frames, timeouts, intervals, DOM mutations, running animations, long animation frames (debug.agent_pane idle_probe,webviews/src/agent-session/acpmux/idleProbe.ts). The wrappers are restored when the window ends.idle_profile: for each shown cmux page, Chromium's page metrics per second (task, script, style, layout) and a 10 s V8 CPU profile by function, throughdebug.cef_page_devtools {browser, method, params}(new, bench and DEBUG builds only, cmux's own pages only; browser tabs are refused).debug.cef_pagesnow also gives a cmux page's path.native_samples:sampleof each renderer over 1% CPU (main-thread call tree and heaviest frames).Noneand counted infootprint_unread. Before this change it was summed as 0.What it found
mach_msgfor all 8 s. The 2-5% the window reads is work right after the 40-chat load that stops on its own: atsettle=420instead of 60, the shown agent renderer is at 0.05%. So there is no loop to stop in the pane code.settle=420, once acpmux has hibernated the idle agents (2 min) and their hidden chat pages have gone, the whole tree is at 2.6 GB.Performance
Same harness,
perf-idle-power.sh --arg=scenarios=idle-chats --arg=config=bench --display, 40 local chats, 120 s window, two Apple M4 Pro (Mac16,11) display workers, at ef35ed9 (this branch plus a diagnostic profile before the window, since dropped):And the footprint read on the 6500d46/c004201 pair (one host, before this fix):
Stop and cleanup: no timer, observer or loop is added to the app.
idleProberestoresrequestAnimationFrame,setTimeoutandsetInterval, disconnects its MutationObserver and PerformanceObserver when its window ends (at most 30 s), and runs only when the debug socket asks. The bench turns off the Profiler and Performance domains after its window.Red/green
python3 -m unittest scripts/cmux-next/tests/test_bench_power_loaded.py(macOS; on Linux with libproc stubbed):test_footprint_read_as_zero_is_unread_not_zero: at baseAssertionError: 0.0 is not None; passes at head.test_profile_summary_self_time_by_function: at baseAttributeError: module 'bench_power' has no attribute 'profile_summary'; passes at head.All 12 tests in the file pass at head.
bun test test/agent-pane-idle-probe.test.ts(webviews): "a second probe while one runs is refused and the first still restores" fails on the probe before the review fix (the second probe ran and returned a result) and passes at head; "a probe counts timeouts by call site and restores the page's functions" passes.Review follow-ups from the first Codex receipt, fixed here: a probe started while another runs is refused (it used to keep the first one's wrappers installed), and
debug.cef_page_devtoolsreads the browser id withInt32(exactly:)instead of trapping.Risk: low. The Swift adds two debug socket methods under
#if DEBUG || CMUX_BENCH_HOOKS(debug.cef_page_devtools,debug.agent_pane idle_probe) and apathfield indebug.cef_pages, given only forcmux-page://pages. Shipped builds have none of them. The bench spends about 35 s more after its window. A Release build's page includesidleProbe.ts, but nothing calls it.Observed / Not run
settle=420at the final tree, the bench unit tests (red at base, green at head), CmuxNext compile checks at 687f2e7 and the final head,scripts/web-lint.sh(the only failure ischeck:design-tokensonchief-web.css, which is red on base b0b87e8 too).settle=420pair at 6500d46 and c004201 on one host (queued; numbers go on Align cmux Codex CLI hook setup with current event surface #6338). A NIGHTLY with Leo's real chats: his 95% readings need long transcripts, remote peers and browser tabs, which this load lacks.Changelog
Agent session: agent session
🤖 Generated with Claude Code