Repository navigation
test(commandbar): judge CB-22's budgets on the best of up to three rounds - #17
Conversation
…unds (D46) Gate runs share a 16-core machine with other agents' test runs, at load averages of 25-50. Other work there can only add delay, and CB-22's budget tests failed full runs often enough to need a rerun in most gates. The e2e test now measures in rounds of four opens with a typed query each. A round that misses any budget is measured again in the same app, up to three rounds, and the test passes on the first round that meets them all. The bar keeps only its last 100 timings, so each round clears them first. The unit ranking benchmark does the same with up to three runs. The budgets are unchanged. Checked with main kept busy 40 ms in every 50 (scratch variants, removed): - the old e2e test fails when main is busy during its one measurement (p95 to results 48.2 ms against 30); - the new one passes when only its first round is slowed (46.6 ms, then 11.2 ms); - it fails when every round is slowed (48.1, 45.7, 48.0 ms). The unit test passes with a slow first run and fails after three slow runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 46cd1ffa-fc6e-4d5d-92bb-b2af6d881fcd) |
No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 679936bc-9b75-4efe-99a6-315c59b6cfc7) |
… (D51) The stack's gate on PR #19's head (42c9819) failed this bench. At a load average of 39, beside vitest's other workers, all three runs missed the 30 ms p95 in wall time (54.5, 30.3 and 51.6 ms; medians 9-17 ms). Alone it passed 4 of 4. Ranking is synchronous and never waits, so its cost is its thread's CPU time; wall time on a loaded machine also counts the turns other processes get. The bench now times each keystroke with process.threadCpuUsage() and logs the wall p95 of the same samples beside it. The e2e CB-22 test still times the app in wall time, and the best of up to three runs stays (D46). Alone and in three full unit runs at load 27-31: CPU p95 6.3-8.8 ms (p50 4.0 ms), while the same samples' wall p95 was 15.7-26.3 ms; 435 of 435 each time. With a scratch 35 ms of CPU added to rank() for queries of 14 or more characters, all three runs fail at a CPU p95 of 39.3 ms ("expected 39.285 to be less than or equal to 30"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ead/harness2 No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 3ecb2667-75b3-4eef-a3b1-84249970ea57) |
No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ound is a first use (PR #17 review M1) Review M1: a retry in the same app measured a warmer app. Round 1 is the bar's first use after launch; rounds 2 and 3 ran on caches and JIT that round 1 had warmed, so a slowdown confined to the first use after launch passed on round 2. A user meets that first use after every launch. Each retry now closes Orbit, launches it again on the same seeded profile (500 tabs, 10,000 history entries), waits for history and the idle warm-up, and measures. The test's timeout is 120 s for the relaunches. Positive control (scratch, not committed): main busy 40 ms in every 50 during the first round after each launch. With this change all three rounds miss (p95 to results 50.3, 51.8, 47.0 ms against 30) and the test fails. Without it the test passes on round 2 (round 1 52.3 ms, round 2 13.4 ms). Without the scratch, at load 26-37, the test passed 3 of 3; one run needed a retry (round 1 painted 50.3 ms against 50), which passed in its fresh launch (41.7 ms). Review F3-F5, the unit bench: falls back to process.cpuUsage() on a Node before 23.9, which lacks process.threadCpuUsage() (engines allows Node 22), and notes what CPU time can't see (a blocking wait, work on another thread) and that it moves in 1 ms ticks here. D46 and D51 are updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: a74761b5-f428-41c2-a8c0-2191cd499786) |
One conflict, in tests/e2e/core.spec.ts: both sides added a test after TB-22's quit-timer test. Kept both: PR #16's cancelled-quit test first, beside the other quit test, then this branch's evaluate test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D51) Timing budgets that one sample judged now take the best of up to three rounds, as the command bar's CB-22 test already did (D46): other work on this shared machine can only add delay. Each round is logged, so a slow machine shows in the output rather than in a failure. - archive: the Library's first open, and its open and search at 10,000 entries; media: the floating player's open, and with reduced motion its open, glide and return; Peek's open and close; Settings' appearance switch; SV-13's long tasks while dragging a divider. - CB-22's first open after a launch is judged on its own, and the rest by their upper median (PR #17 review F2); the typing test judges the median keystroke, leaving the worst to the budget tests. - SV-26's growth also needs its settle within budget for a round to count. - SV-17 waits until the shell has drawn the close before comparing views and panes; SV-13's mid-drag wait says, when it stalls, whether the pane card stopped too and whether the divider held the pointer. - The archive search unit test times each search in thread CPU time (D51). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CB-22's budget tests fail full runs on the shared test machine often enough to need a rerun in most merge gates. This PR judges them on the best of up to three measuring rounds (D46), and times the ranking bench in its thread's CPU time (D51). The budgets themselves don't change. It's stacked on PR #16 and changes test code only.
Why
mainfail it 7 of 9 times on this machine.What
commandbar.spec.ts, "[CB-22][CB-07][FL-17] at 500 tabs and 10,000 history entries…":2c9e366, review M1). The test closes Orbit, launches it again on the same 500 tabs and 10,000 history entries, and waits for history and the idle warm-up. Every round is then the bar's first use after a launch, as a user meets it. The test's timeout is 120 s.commandbar.test.ts, "[CB-07][CB-22] ranks 500 tabs and 10,000 history entries in ≤ 30 ms per keystroke":process.threadCpuUsage()), and the same samples' wall p95 is logged beside it (D51,9d9c314). Ranking never waits, so its CPU time is its whole cost; wall time on a loaded machine also counts other processes' turns. The e2e test still times the app in wall time.threadCpuUsage, the bench uses the process's CPU time instead (enginesallows Node 22). Its comment notes what CPU time can't see: a blocking wait, or work on another thread. It also notes that the clock moves in 1 ms ticks here (review F3–F5).Test
Scratch variants (removed) kept main busy 40 ms in every 50:
Review M1. The review found that a retry in the same app measured a warmer app. With nothing injected, round 1 was slower than round 2 in 6 of 6 runs, so a slowdown confined to the first use after launch passed on round 2. The positive control for the fix keeps main busy 40 ms in every 50 during the first round after each launch:
2c9e366)Without anything injected, at load 26–37, the fixed test passed 3 of 3. One run needed a retry: round 1 painted at 50.3 ms against 50, and round 2 passed in its fresh launch at 41.7 ms.
9d9c314):42c9819failed the wall-time bench in all three runs at load 39 (p95 54.5, 30.3 and 51.6 ms). Alone it then passed 4 of 4.rank()for queries of 14 or more characters, all three runs fail at a CPU p95 of 39.3 ms.commandbar.spec.ts: 36 passed.commandbar.test.ts: 30 passed. Lint and typecheck: exit 0.Merge gate (D42)
Run locally on the Linux VPS on this PR's head,
581dbb1. It contains PR #16's heade4486e4, and mergingmainafter #16 lands won't change its tree:Build, typecheck and lint: exit 0. Unit: 375 of 375 in 39 files.
E2E at 1440×900, one worker, no retries: 267 passed, 0 failed, 2 skipped, exit 0, in 12.6 min (06:52–07:04 UTC, load average 9–27). The two skipped are media's
test.fixmeframe tests (MD-01, MD-09). CB-22's test met its budgets in round 1 (p95 10.6 ms to results, 34.8 ms painted, open median 19.8 ms).Main logged no uncaught exception, and no quit was killed.
macOS: unverified. The macOS e2e run needs a Mac. The change is test code only.
Update, 07:50 UTC:
mainmoved to60da889(settings, PR Settings window, appearance, onboarding and updates #15). It was merged into PR test(e2e): ask Orbit to quit from a task of its own #16's branch, and that into this one, with no conflicts (head728fc45), then into PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19.Update, 08:16 UTC: under D50 the gate reran once, on PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19's head
42c9819, which contained728fc45:That bench now runs in CPU time (
9d9c314, D51). This head is now9d9c314, and PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19's is7be3b2b.7be3b2bdiffers from the gated42c9819only intests/unit/commandbar.test.ts, so build, typecheck, lint and unit reran on it (exit 0; 435 of 435), and the e2e result carries over (D50). Details are in PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19.Update after the review: this branch's fix (
2c9e366) changes the e2e test, so the gate reran in full on PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19's new head4345e72, which contains it: build, typecheck and lint exit 0; unit 435 of 435; e2e 306 passed, 0 failed, 2 skipped, exit 0, in 16.2 min (10:25–10:41 UTC, load average 9–34). CB-22's e2e test met its budgets in round 1 of its first launch (p95 11.5 ms to results, 33.2 ms painted, open median 24.4 ms). Details are in PR test: harness follow-ups from PR #10's review (no DNS lookups, deferred evaluateHandle, SV-25/SV-26, perf) #19.Review
reviews/lead-budgets.md): approve with 1 must-fix.2c9e366, with F3–F5. D46 and D51 were updated to match.4345e72, which contains this branch.🤖 Generated with Claude Code
Note
Low Risk
Test-only changes to measurement and retry logic; no production command bar or ranking behavior is modified.
Overview
Stabilizes CB-22 performance gates on shared CI without changing the 30 ms / 50 ms budgets.
The e2e
[CB-22][CB-07][FL-17]test now runs up to three measurement rounds (four bar opens + typing each). A round that misses any budget is retried after a fresh Orbit launch on the same seeded profile (500 tabs, 10k history), withlaunch/settlehelpers and per-round clearing of__orbitCommandBartimings. The test passes on the first round that meets all budgets, otherwise fails on the last round; timeout is raised to 120s.The unit ranking bench for 500 tabs / 10k history now asserts on thread CPU time (
process.threadCpuUsage, withprocess.cpuUsagefallback) instead of wall clock, logs CPU and wall p95 per run, and re-runs up to three times if CPU p95 exceeds 30 ms.Reviewed by Cursor Bugbot for commit 2c9e366. Bugbot is set up for automated code reviews on this repo. Configure here.