Repository navigation
chore(ui): measure concurrent-session responsiveness - #194892
Conversation
…ctions Add a protocol-grounded event workload to the existing engine harness and avoid preparing unchanged sections as tools arrive. Focused regression, type checks, lint, and independent review pass. Performance acceptance remains pending the full paired matrix and Chat bundle budget reconciliation.
Build one dependency array per rendered part and keep its context and status helpers with the render guard. Preserve the exact invalidation inputs and the existing frame lifecycle while fitting the projection line cap and Chat boot budget. Use native keyboard activation for unmeasured event-load disclosure setup and keep live-output and final-state assertions. Extend only the default load safety ceiling; event rates and the foreground workload stay unchanged.
Discard the retained-section rendering candidate after twenty rotated triplets found worse Firefox session switching and WebKit scroll p95. Keep the protocol-grounded workload and canonical mock state for the remaining load census. Admit the two-tool workload at scroll entry without changing the nominal schedule for larger first waves.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Codex Review Summary: ✅ CompletedThis 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: c643b9ee13
ℹ️ 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".
Retire mock message interests with the socket and carry lastMessageAt in terminal row patches. Correct benchmark formatting and annotate closure-only fixture methods.
Allocate the exact 47 net test/helper lines for the canonical row regression, event-load fixture support and settled read-coalescing assertion. Keep the shared scalar unchanged and do not absorb the comparison base’s 65-line debt.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf(ui): measure concurrent session load and retain unchanged run sections Add a protocol-grounded event workload to the existing engine harness and avoid preparing unchanged sections as tools arrive. Focused regression, type checks, lint, and independent review pass. Performance acceptance remains pending the full paired matrix and Chat bundle budget reconciliation. * perf(ui): bound event-load probes and skip transcript allocations * test(ui): bracket event-load CPU counters with receipt bounds * perf(ui): build retained transcript dependencies once Build one dependency array per rendered part and keep its context and status helpers with the render guard. Preserve the exact invalidation inputs and the existing frame lifecycle while fitting the projection line cap and Chat boot budget. Use native keyboard activation for unmeasured event-load disclosure setup and keep live-output and final-state assertions. Extend only the default load safety ceiling; event rates and the foreground workload stay unchanged. * test(ui): honor the declared event-load drain window * test(ui): isolate typing samples and expose burst overlap * test(ui): keep event-load recovery on canonical session state * test(ui): capture geometry for blank event-load frames * test(ui): publish event-load terminal messages faithfully * test(ui): inspect event-load gaps after render delivery * test(ui): align event-load waves with native actions * test(ui): preserve event-load tool chronology under backlog * test(ui): retain event-load benchmarks without renderer change Discard the retained-section rendering candidate after twenty rotated triplets found worse Firefox session switching and WebKit scroll p95. Keep the protocol-grounded workload and canonical mock state for the remaining load census. Admit the two-tool workload at scroll entry without changing the nominal schedule for larger first waves. * test(ui): correct event-load reconnect and terminal deltas Retire mock message interests with the socket and carry lastMessageAt in terminal row patches. Correct benchmark formatting and annotate closure-only fixture methods. * test(ui): scope read coalescing to the settled phase * test(ui): budget concurrent-session regression coverage Allocate the exact 47 net test/helper lines for the canonical row regression, event-load fixture support and settled read-coalescing assertion. Keep the shared scalar unchanged and do not absorb the comparison base’s 65-line debt.
What Problem This Solves
Control UI benchmarks previously covered quiet UI and one foreground reply, without measuring a tool-heavy turn alongside many active background sessions.
User Impact
Developers can now measure unloaded, foreground-only, and 5/20/100-background workloads with the existing cross-engine harness. No production UI behavior, protocol, dependency, or production size ceiling changes.
Why This Change Was Made
The fixture holds the inventory at 1,000 sessions and runs 200 foreground tools with live output. It measures native typing, scroll-frame gaps, session/route switching, idle renderer CPU where available, producer lag, and received wire frames/bytes. Actual application subscription calls govern detailed delivery. The shared mock now serves event/list/describe/history/mutation state from its canonical row owner, scopes subscription interests and row-delta baselines to each socket, and includes
lastMessageAtin terminal deltas. A focused read-coalescing test counts its controlled burst from the existing settled boundary.A real isolated Gateway grounded the event families and body-suppression rules: three concurrent agent runs, six actual read calls, nine loopback model requests. Full, narration, and broad-only audiences received respectively 48/41/14 frames and 59,131/55,036/18,976 JSON bytes. Broad-only durable receipts contained no message body. This is a small protocol observation, not a production-capacity measurement. The recurring stress rate—two logical durable receipts per second per background session—is synthetic; periodic usage invalidation was absent from the capture and is not invented in the mix.
A structural retained-section renderer candidate was removed after 20 rotated base/head/base triplets in each engine at desktop100. Chromium renderer CPU improved by paired median 10.8%, but Firefox session switching regressed by a paired median 30.3% and WebKit scroll-frame p95 by a paired median 8.9% (cell p95 +6.2%). A/A controls and all failed observations were retained. The cross-engine bar was not met, so this PR makes no production performance-improvement claim.
Evidence
The descriptive census uses the frozen application at
23f2cd68e9d38bbffe561bada8eab5a72b9af110, bundle SHA256ba629719ce791ef32c151b84c8b63b5b7c8305d592fa6fb6bda078ca149adca8. It is not a measurement of subsequent main commits. All local browser runs were headless. Mobile means a mobile viewport on the same Mac, not physical mobile hardware; scroll gaps come from the scripted scroll loop, not touch/wheel delivery.The completed baseline census contains 490 observations across 43 source/slot cells and 40 engine/viewport/throttle/load combinations: 476 passed, 14 failed, none incomplete. It includes 120 reused desktop100 baseline/control observations; the 60 rejected-candidate observations are excluded. Ingestion/contract audit found no issues. The full 20-triplet candidate experiment has 180 observations and remains a separate comparison.
Responsiveness is not established at 100 sessions. The foreground-only 200-tool turn already produces large frame gaps. At 1×, 100-background scroll-frame-p95 medians are about 133 ms in Chromium/Firefox and 194–212 ms in WebKit, versus roughly 17–25 ms unloaded. Firefox's whole-window producer averages reach only 61–87 of the nominal 200 logical receipts/s. At 4×, the producer falls short even at five backgrounds; at 100 it averages 63.24/200 on desktop and 145.47/200 on mobile. Completed 4×100 session switches have medians of 3.07/1.84 seconds (desktop/mobile, n=8 each), with cell p95 values of 12.28/13.30 seconds. Route-switch cell p95 reaches 17.57/32.45 seconds. Similar or lower frame-gap numbers under a missed offering are not evidence of improved scaling.
The 14 retained failures are six ResizeObserver errors, one foreground-production-overlap guard, three post-typing query timeouts, three session-switch wait timeouts, and one terminal-reply-visibility timeout. Post-typing screenshots show the expected draft intact, but the predicate timed out. Switch-timeout screenshots show the target transcript/checkpoints, but cannot establish which key/checkpoint predicate failed. Final correctness remains unverified for interrupted paths; no dropped final state is inferred. Available metrics remain in inclusive distributions, with missing metric counts preserved; passed-only distributions remain in the local detailed report.
Median scroll-frame p95 in ms, desktop / mobile. A range at desktop100 displays separate base/control medians, not a pooled estimate.
Full timing matrix
Times are median / cell p95 in milliseconds. Input-to-frame is a compound native-input sequence, not isolated handler CPU. Scroll is each observation’s frame-gap p95. Counts are passed / observed; partial and failed observations retain available metrics. Desktop100 B/C are separate baseline/control slots from the 20-triplet experiment; they are not pooled.
CPU and event-rate diagnostics
CPU below is the incremental idle-window renderer CPU per received background wire frame, after a noncontemporaneous foreground-only control. It includes mock production/delivery and application work. Ranges bound receipt-counter windows only; they are not confidence intervals or bounds on host noise. Chromium is the only engine with this CPU instrumentation.
Interpretation and limits
These are descriptive baseline cells, not randomized treatment comparisons. Different load cells ran at different times on a shared host. The producer executes in the measured renderer, so its work is included in CPU and it may fail to sustain the offered rate. Whole-window average logical throughput does not prove prompt steady socket delivery. Scheduler lag is producer lateness, not a directly measured status-indicator latency. The workload starts with one foreground pane; it does not quantify multiple previously visited hidden streaming panes or an independent total-server-inventory axis.
The ownership audit found no
sessions.listRPC per event. Broad receipts still cause row decoding, held-query admission, shared row/descriptor reconciliation, and ordering beyond visible DOM rows. Sidebar narration is bounded to six background interests, but retained mounted Chat panes keep their full exact subscriptions. A redesign of those owner/provenance boundaries, a worker move, and Gateway/protocol changes were not attempted. No isolated handler-cost or universal scaling-floor claim follows from this census.Correctness and merge proof
Final CI 42436023226, attempt 1, tested head
1ab8b5c5351833d5c15a0feb64b476906616bdc0in mergea5434b258eaee4615bc5c16194935e307b05a481, with parentsb97bc15cd7afd6eea35c68c6dfb0cc07706a8671and that head. Its tree matches an independent merge. Only the test-line ratchet and downstream aggregate failed: 6,571,207 against 6,571,142, a residual 65 lines. The exact base-only reproduction has the same 65-line debt. This PR allocates exactly its own 47 new test/helper lines; it does not allocate baseline debt or change the shared scalar. Native confirmed-cancelled replacement/admin recovery accepted the inherited-failure evidence and merged asbd1fc681705bd0ba42f53a50a21a2687ace55db3. The ratchet is not described as green.The inspected image below contains only the synthetic fixture. It illustrates the 200-tool workload at completion; production appearance did not change. Raw real-Gateway captures remain local because they contain incidental host identity. Reports and generated measurement artifacts are not committed.
Reproduction uses the existing event-load harness documentation:
scripts/bench-control-ui-engines.tswith a pinned--bundle-dir,--steps event-load-unloaded,event-load-0,event-load-5,event-load-20,event-load-100,--event-load-duration-ms 240000, and--pairs 10. Run Chromium, WebKit and Firefox at 1× for both viewports; run the same Chromium cells with--cpu-throttle 4. The rejected candidate used 20 rotated base/head/base triplets per engine at desktop100. Keep host load, source hashes, failed observations, and received/produced rates with any comparison.