Repository navigation
Conversation
|
🦞👀 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 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. |
…zation Preserve visible-state suppression through source-owned projection memos and explicit plugin publication revisions. Remove per-frame row copies and full-presentation JSON allocation. Extend the renderer benchmark with collected-object allocation sampling and publication/render counters.
54ecad4 to
b21130c
Compare
|
@clawsweeper re-review The repaired head is |
|
🦞👀 Re-review progress:
|
…nclaw#179134) * perf(ui): publish sidebar presentation revisions without full serialization Preserve visible-state suppression through source-owned projection memos and explicit plugin publication revisions. Remove per-frame row copies and full-presentation JSON allocation. Extend the renderer benchmark with collected-object allocation sampling and publication/render counters. * test(ui): publish sidebar fixture snapshots through their owners * fix(ui): keep sidebar comparisons and probe fixtures type safe
What Problem This Solves
The Control UI sidebar allocated a full presentation JSON string on every admitted update, including updates that left the screen unchanged.
User Impact
Busy sessions incur less sidebar allocation work while retaining the same notification suppression and visible updates. No configuration or migration is required.
Why This Change Was Made
The existing projection memos now expose visible revisions. They replace their snapshots when sources change, but only advance the revision when the visible result changes. The publication gate consumes those revisions and shared metadata instead of serializing the whole presentation and copying every row. Keeping the latest snapshot also avoids retaining obsolete hidden children after an equivalent replacement.
Plugin navigation retains its public mutation contract:
host.ui.invalidate()advances an internal plugin revision, and navigation is fingerprinted once per plugin publication. Gateway hello retains its handshake identity; its presentation snapshot changes with the capability publication.Evidence
Acceptance, written before implementation: run the committed renderer workload separately with sidebar live churn and session event churn; substantially reduce sampled allocated bytes/event while publication/render counts stay unchanged or lower and user-facing latency does not regress by more than 20%. Five concurrent matched baseline/candidate pairs per scenario swap their two 16-CPU halves. Compare paired differences; report median and p95. Allocation samples include objects collected by minor and major GC. Cold readiness and the warm live window are separate.
All ten allocation pairs completed successfully. The owner-level reduction is about one-third; whole-renderer savings are smaller but consistent in every pair. Values below are sampled allocated bytes/event, including collected objects. Each scenario has five concurrent pairs; p95 uses nearest rank (the maximum at n=5). Paired deltas are candidate minus baseline within each pair, not differences between the two marginal medians.
Sidebar gate bytes/admission fell from 1,125,968 / 1,179,947 median/p95 to 751,474 / 762,116. Session-event gate bytes/admission equal bytes/event because every event reached the gate. Whole-renderer paired reductions ranged from 1.79–4.96% for sidebar churn and 3.89–7.43% for session events.
These counts are exact in every pair. The session workload still suppresses 230 of 240 admitted events. Final synthetic sidebar state and layout match in both scenarios.
Timing: allocation-profiled paired median ScriptDuration changes were +1.72% / +1.01%, and TaskDuration +3.36% / +3.93%, for sidebar/session churn respectively. Persisted-snapshot reload readiness, measured before allocation sampling, changed by paired medians -3.47% / +4.04%. One sidebar pair increased p95 event-delivery lateness by 10.1 ms and long-task blocking by 17 ms. Two additional swapped, non-allocation sidebar pairs retained all counts and had zero long tasks on both sides. Their delivery-lateness p95 fell in both pairs (median 37.20 → 36.95 ms); ScriptDuration changed by paired median +1.87% and TaskDuration +3.00%. The sustained p95/long-task signal did not reproduce, although one maximum-delivery outlier remained +10.5 ms. These two diagnostic pairs do not establish a general latency distribution or per-event DOM settlement.
The exclusive measurement lock covered all pairs, with baseline and candidate running concurrently on separate 16-CPU halves, swapped each pair. Recorded CPU busy averages across the selected 32 CPUs ranged from 2.86–38.46% over live windows; this includes the benchmark and outside work and is context, not an exclusion rule.
Measurement identity: baseline source
ef6d500b534062f352aa6d7ceef01c97d907c511; candidate is that same source plus the final lane production change. This is a controlled source comparison, not a complete build of the later rebased PR head. The comparator/projection remained byte-identical through rebase; exact-head PR CI validates the integrated change. Bundle SHA256: baseline090c4e15c60614d90b4ec30cc3831e17e46e26e93f42f63557e912b442982ebe, candidate5dde253e2c5059ab3e5651b9239095473b28c072cae329872d730431ac0aaeb8(digest of sorted relative paths and file-content hashes).Allocation/render acceptance passes: a substantial gate allocation reduction, consistent whole-renderer reduction, and no extra publications or renders. Per-event time to settled/painted DOM was not instrumented, so the original additional >20% user-facing latency guard remains unproven. Event-delivery lateness and aggregate CPU are proxies, not settlement latency; the fixed drain window is not used as a response-time metric.
Focused validation: 142 tests passed across eleven focused UI/browser files covering projection, memoization, plugin runtime, chat replacement fixtures, presence, catalog events, session events, narration retries, row/facepile rendering, plugin Pages identity, and serialized browser-probe restoration. After the final revision cutover, the two projection files passed again (34 tests).
pnpm tsgo:ui, changed-file formatting, and changed-file lint passed. Exact-head CI run 39557024421 passed onb21130c0c87bf2647b48293926fe5abc2d0823a5, includingopenclaw/ci-gate; all 57 PR checks passed. No Testbox lease or local build/dev server was used.Focused proof commands
The committed workload is
node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts --runs 1 --allocations --untraced --live-events --fixture-now-ms 1792569600000 --live-start-at-ms <shared-epoch-ms>, with--sidebar-live-churnand--session-event-churnin separate runs, separate--bundle-dir/--outputpaths and isolated loopback ports. Diagnostic pairs omit--allocations. This exercises the production renderer bundle with synthetic transport; it does not establish real Gateway transport performance or native/other-isolate allocations. The optional real-transport cross-check was not run.Production UI delta: +125 lines (189 added, 64 removed). The retained growth preserves semantic suppression across equivalent replacements and the mutable plugin boundary while reusing the existing memo owner. Benchmark instrumentation adds 73 lines; tests add 70 lines. No new source module, dependency, schema, configuration option, or fallback path.
Initial CI caught two fixtures mutating readonly rows, a plugin registry fixture that did not advance its revision, a browser-probe fixture missing the publication-gate method, and two object-index type assertions. The fixtures now follow their owner contracts, the assertions are removed, and the affected tests passed locally with their original behavior assertions preserved. The plugin-removal failure was reproduced locally before its repair.
Independent Codex review: scoped clean at P0–P2 on the complete implementation and fixture repair, and the final comparator/probe repair. All reviews returned no actionable findings.
Before and after the same synthetic sidebar live-event workload (baseline, then candidate). The final visible sidebar state and layout are preserved.