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: needs real behavior proof before merge. What this changesThis PR reduces temporary allocations in child-controller lookup and descendant counting while extending the existing benchmark. Example: Present agent:main:subagent:child while agent:main:parent controls its live run.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open as a maintainer-authored performance experiment under an explicit do-not-merge hold; no definite introduced bug was identified. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe process-local subagent registry supplies current controller identities and descendant counts to Gateway session presentation and session-send admission. flowchart TD
A[Registry row publications] --> B[Registry array buckets]
C[Executor and scheduler ownership] --> D[Controller selection]
B --> D
A --> E[Descendant topology]
D --> F[Gateway session presentation]
E --> F
D --> G[Session send admission]
G --> H[Guarded agent dispatch]
Technical reviewBest possible solution: Keep controller selection and descendant counting in the existing registry owners, retaining only allocation reductions that meet the declared performance gates without changing communication authority. Do we have a high-confidence way to reproduce the issue? Current main visibly allocates lookup keys, predicates, iterators, and active-count options on the affected paths; the reported allocation magnitude was not independently reproduced. Is this the best way to solve the issue? The diff uses existing registry owners, preserves live ownership checks, and avoids the earlier experiment's controller cache; measurements must determine whether array maintenance and repeated settled-descendant scans deliver a net benefit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a14fa613c678. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +51, Tests +214, Other +266. Total +531 across 9 files. Added test files: 1. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 25, 2026, 11:45 PM ET / October 26, 2026, 03:45 UTC. |
f38236d to
05902aa
Compare
Maintain the newest matching live controller in the registry and refresh it when executor or scheduler ownership changes. Remove row-time run scans while preserving generation ordering, partial session identities, foreign control, and durable parent navigation. Release-note context: reduce session-list and Control UI row-presentation allocation without changing controller or parent relationships.
Share the existing execution ownership checks through a state-bound adapter, retain the controller scan negative control, and prepare runtime config before benchmark projection startup.
Match the Team harness 100-row list request while retaining the full 10,800-row fixture and all-row owner workload. This keeps setup within the existing exact-row preparation budget.
05902aa to
a8a0011
Compare
Continued in #184698. GitHub refused to reopen this closed experiment after the branch rewrite; this PR retains the historical
a8a00117head. The replacement carries the reduced change rebased onto main after #184566. Neither PR has been merged.What Problem This Solves
Repeated session presentation allocates temporary objects while resolving child controllers and counting active descendants. A settled profile attributed 3.41 MB per 30 seconds to child-run lookup and 4.73 MB to descendant counting. The broader campaign observed 14 intermediate states during a signed-in reload of a dashboard deep link; this change targets server allocation and makes no first-paint claim.
Why This Change Was Made
Registry buckets use arrays and their final element supplies the existing last-published lookup, deleting the redundant latest-insertion map. Presentation reads the existing child bucket without the old iterator, matching closure, composite lookup key, or parent-comparison array. Live executor/reservation authority, agent ownership, incarnation matching, and generation ordering stay at the owner. The read remains O(runs in the child's bucket), usually a singleton; array replacement is linear in bucket size.
Descendant reads share active-only options and index the existing topology. Entirely ended sets return zero without filling a fresh count map with zero entries; unended work retains its existing window-specific memo and clock semantics. Existing owner-tuple cache hits already reuse their result; legitimate misses remain.
User Impact
The intended result is less allocation during repeated list presentation with equivalent controller, parent, and navigation results. This experiment is stopped without a landing recommendation: final-head performance and Gateway gates could not be completed on the required hardware.
Evidence
Preserved head:
a8a001173cdd94ccfaa5130e1836d988e55374c1. Frozen base:92415c1e5fe71a311d6a3f72cf66b139d6d2df26. Closed as an experiment; not merged.Runtime-only delta is +53 LOC across five files (113 insertions, 60 deletions), within the +60 limit. Preserving live authority and incarnation/generation matching in a direct owner query requires the growth; the gateway predicate and redundant latest-insertion map are deleted. Requested non-test/non-doc stat: 460 insertions, 140 deletions, +320 net, including +267 benchmark LOC.
Final gate status
The final benchmark samples separate temporal descendant-read and owner-resolution regions, counting every profile byte, including boundary/caller overhead. The owner region includes its existing argument spreads and CPU bookkeeping. Timing and whole-list global allocation are unchanged. This replaces frame-name attribution: a qualification run proved V8 could inline away the candidate helper and yield a misleading zero. Those frame-derived family figures are not valid final proof and are not used below.
The revised probe has a clean independent P2 review with the complete source. Its payload independently verifies raw profile sums, 240 epochs per region, 518,400 descendant queries, and 2,592,000 owner reads. The ≥80%/≥9-of-11 region gates, ≥9-of-11 whole-list allocation gate, and CPU non-regression rule remain unchanged. The revised probe has not completed remote validation or the final 11-pair comparison. The canonical Gateway timing AB pass has not run.
cbx_b60f2ddb0068cbx_f85c8411fa44cbx_2e4f981e5370Every confirmed provisioned lease from this lane has been released. No Gateway was started. The final queued-create acknowledgement remains an explicit control-plane cleanup uncertainty; no unconfirmed release is claimed.
Valid earlier diagnostic, not final-head proof
AWS c7a.4xlarge lease
cbx_b43d31a82240completed 11 alternating pairs on baseline845c3613ffa9c360c821d9fdff322d8fefa82261and candidatef38236d4bc0ec41d560bcae6caeedea64dbf0dc1. Whole-list totals do not depend on frame attribution, so those diagnostic totals remain usable. They do not satisfy the final-head gate after the benchmark correction and rebase. The following values cover a real 100-row list page over the 10,800-session synthetic fixture, with fixed registry churn; no Mac timing results are used.Diagnostic per-pair deltas, candidate − baseline
Whole-list allocation (MB/pass): -0.235850, -0.048575, -0.153186, -0.375387, -0.178603, -0.155704, -0.122056, -0.210187, -0.199374, -0.203769, +0.051374
List resolution CPU (ms/pass): -0.132250, -0.322833, +1.660722, -0.410917, -1.861056, -1.179306, +0.240833, -1.461278, -0.991111, -1.031667, -0.001528
Whole-list CPU including updates (ms/pass): -0.154972, -0.347583, +1.513611, -0.481889, -1.920472, -1.184806, +0.212528, -1.433361, -1.128250, -0.954694, -0.066806
Correctness and validation
All 12 focused owner/consumer files and both full builds passed on head
05902aac8a7d6d16c905d8ecee3064762332e51ain AWS leasecbx_14b1226b7fae. The five modified runtime files have identical contents in the preserved final head. Complete changed-file validation took 929.49 s: all types, lint, format, and other guards passed; the only failure was 46 dead-export findings reproduced identically on untouched frozen main, with zero candidate-only findings. That lease's provider connection later failed during timing; its partial timings are excluded. Release is confirmed.The three changed test files were repeated on AWS c7a.4xlarge lease
cbx_4c22d29ea3be; all 67 tests passed and their logs were saved before cleanup. Each command waspnpm test <file> --maxWorkers=1:src/gateway/session-child-controller.test.tssrc/agents/tools/sessions-send-communication.test.tssrc/agents/subagents/registry/subagent-registry-queries.test.tsThe controller property compares the original owner-scoped scan with the direct query across 240 seeded operations and 12 rows, including generation replacement, status changes, executor withdrawal, queued reservations, incarnation changes, and agent-ID mismatch. Descendant properties cover nested/cyclic roots and finite/nonfinite completion timestamps. Both builds also passed on that lease; attribution qualification then stopped before paired runs because the helper frame disappeared. Release is confirmed.
Exact-head GitHub state at closeout: draft automation completed; broad CI was skipped while the experiment remained draft. This is not a broad-CI pass. No UI files change, and no visual claim is made.
Remaining work for the lead: confirm cancellation of the queued-create request if the broker later materializes it, obtain a qualified c7a.4xlarge lease, run the preserved final-head temporal comparison and canonical Gateway timing pass, then mark ready and obtain exact-head broad CI. The source branch is preserved; no merge was attempted.
Cleanup update: explicit AWS status by ID and slug and authoritative provider inspection all return
404 not_foundforcbx_2e4f981e5370; there is no matching lease available to release. All subsequently provisioned validation leases have been released.