Repository navigation
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 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds GC promotion accounting, history/diff allocation capture, and describe/connect/reconnect benchmark scenarios. Example: Forty clients reconnect with starts staggered by 125 ms.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it adds useful measurement capabilities, and the prior type-safety finding is resolved; no new actionable code defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherRepository benchmark drivers send synthetic WebSocket workloads to an isolated Gateway and combine responses, private profiler IPC, and GC traces into measurement reports. flowchart LR
Fixture[Synthetic fixture] --> Driver[Benchmark driver]
Driver --> Gateway[Isolated Gateway]
Driver --> Profiler[Profiler preload]
Gateway --> Responses[WebSocket responses]
Profiler --> Traces[Profiles and GC traces]
Responses --> Report[Measurement report]
Traces --> Report
Technical reviewBest possible solution: Retain the shared profiler and existing benchmark drivers as the owners of the added measurements and response validation. Do we have a high-confidence way to reproduce the issue? This is a benchmark capability addition; source inspection confirms the missing measurements on current main, and no target code was executed during this read-only review. Is this the best way to solve the issue? Extending the existing profiler and workload drivers is appropriate: isolate identification, capture markers, bounded concurrency, and reconnect assertions serve distinct measurement requirements without introducing another framework. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb54f49633be. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +73, Docs +37, Other +470. Total +580 across 7 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 HistoryReview history (1 earlier review cycle)
Reviewed October 20, 2026, 1:39 AM ET / 05:39 UTC (Revision 2). |
cc9d68f to
a942f0e
Compare
|
Addressed the indexed-client finding with bounded iteration over actual clients and a max/min reconnect-start calculation. The targeted scripts typecheck now passes. The PR body also records completed live runs of all seven scenarios, including describe/connect/reconnect, and their allocation/promotion/GC results and limitations. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged at f5b87c5 using the authorized inherited-failure exception. Exact-head run 39375437350 passed all selected jobs except core test-types and its aggregate gate. The sole diagnostic is TS2367 in ui/src/e2e/session-scoped-delivery.e2e.test.ts:103, introduced by #178074. The file has identical blob f9099f96aea18071dbf00f1ebb7e627c48e338e9 in the PR and its main base, and an unchanged base-file compile reproduced that exact diagnostic in the sandbox. Details and limitations are in the PR body; CI is not being described as green. Focused profile/diagnostics tests, closure guards, scripts typecheck, changed-file format/lint, independent review, and real synthetic-Gateway runs of all seven scenarios passed. This lands the measurement infrastructure; no runtime performance improvement is claimed yet. |
…penclaw#178075) * test(perf): measure RPC allocation promotion and reconnect recovery * fix(perf): isolate captured GC traces and bound RPC clients
What Problem This Solves
Gateway allocation comparisons currently report sampled bytes and total GC without promoted bytes or a major/minor split. That can make a change look cheaper while it creates more old-generation garbage. The existing RPC driver also cannot isolate describe and reconnect costs.
User Impact
No production behavior changes. Maintainers can compare allocation, promotion, GC, transport latency, and response bytes together before choosing a performance fix.
Why This Change Was Made
Extend the existing benchmark owners instead of adding another stress framework. The shared profiler identifies the main isolate before Gateway startup and bounds each capture with synchronous trace markers; worker collections and profiler setup/teardown are excluded from promotion. Existing history/diff workloads gain opt-in allocation capture. The transcript driver gains bounded RPC concurrency, describe, connect, and staggered reconnect scenarios with sidebar recovery checks.
This is the measurement stage of the RPC performance work. Production runtime LOC delta is zero; benchmark/test growth supplies missing measurements and response checks. There is no performance-improvement claim in this change.
Evidence
Focused profile/diagnostics tests pass. The profile test exercises real V8 allocation/GC traces and rejects worker, foreign-process, out-of-window, malformed, and incomplete accounting. Changed-file formatting/lint, export collision guard, and both required import-closure test files pass (22 closure tests). Independent review identified missing child-membership, hello-payload, and message-subscription acknowledgment assertions; all were strengthened. The final independent review is clean at P0–P2.
Runtime build and independent 5,000-session / 6,000-run fixture generation passed on the authorized sandbox. All seven scenarios completed through real loopback Gateways on runtime base
de3473171a22ad4c062f65f4b1ff3dccf462419f, using concurrent paired runs and swapped 16-core halves. No Testbox/Crabbox lease was allocated.Baseline medians across four samples (decimal units; this PR does not claim a before/after speedup):
List p99 was 34–48 ms at concurrency 8 (100 sidebar rows, 99,257 response bytes/call); describe 5.3–6.4 ms; history 88–120 ms and diff 46–52 ms at concurrency 40. Forty reconnecting clients recovered their sidebars in about 4,892 ms with starts spread over about 4,873 ms. Connect handshake p99 varied from 63–299 ms. These are protocol clients, not rendered UI/native-app measurements. Pure RPC scenarios have no background traffic; the broadcast scenario includes list polling. Broadcast-normalized costs describe the whole measured workload, not isolated encode/send cost.
The first CI run found unchecked client indexing in the new harness. Bounded scheduling now consumes actual client objects through a shared iterator; the targeted
pnpm tsgo:scriptslane passes. A live run also exposed malformed worker-startup trace lines outside the capture; those are now excluded before parsing, while malformed captured main-isolate data remains an error. The revised profile tests pass (9/9), changed-file format/lint pass, and the repair received another clean independent review. PR CI supplies the broad gates.Measurement contract: 5,000 sessions / 6,000 retained runs, 40 operator sockets; matched request shapes and completed-operation denominators. A/B comparisons run concurrently on separate 16-core halves under the measurement lock, swapping halves on the next pair. Compare paired differences, sampled bytes, promoted bytes, major/minor GC, RPC p50/p99, CPU, and event-loop delay together. A lower byte sample with worse GC is not a win. The initial 64 MiB transcript fixture preserves roster/run shape but does not reproduce multi-GB page-cache pressure.
Exact-head CI and inherited failure
On head
a942f0e9c2ce6e69b63ffcf693700a3a182f3fcc, CI run 39375437350 passed the changed tests, scripts typecheck, production types, lint, guards, and other selected jobs. The sole non-aggregate failure ischeck-test-types-core-1:ui/src/e2e/session-scoped-delivery.e2e.test.ts:103, TS2367 ("preview-on" | "roster"compared with"preview-off"). The CI gate consequently remains red.This unchanged main-file error was introduced by #178074, after the scheduled main run used by automatic classification. Its blob is identical in the PR and base
d97b12486899e964e39593db8055682010f5bd83:f9099f96aea18071dbf00f1ebb7e627c48e338e9. Compiling an unmodified copy of that base file in the sandbox, with a temporary config extendingtest/tsconfig/tsconfig.core.test.ui-e2e.jsonand selecting only that file, reproduced exactly TS2367 at line 103 (exit 2). Existing sandbox dependencies/import closure were used; this was a single-file attribution check, not another broad CI run. No production or UI source is changed by this PR. Landing uses the authorized inherited-failure exception; the failure is not reported as green.