Repository navigation
perf(ui): shorten remote page loading waterfalls - #188922
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 changes before merge. What this changesThis PR shortens remote Board, Usage, and Appearance loading by overlapping module downloads and separating lightweight schema readers from validation. Example: Open Appearance over a 250 ms RTT, 3 Mbps connection.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this is useful, owner-directed performance work with one concrete test-ratchet failure to repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherControl UI route loaders select presentation modules, the schema traversal owner supplies structural readers, and Vite turns those dependencies into browser chunks and preload requests. flowchart LR
A[Page navigation] --> B[Route loader]
B --> C[Presentation modules]
C --> D[Schema traversal helpers]
E[Vite preload owner] --> F[Parallel script and style downloads]
F --> C
C --> G[Rendered page]
Technical reviewBest possible solution: Use the existing route, traversal, and Vite owners to overlap necessary downloads while preserving CSS evaluation order and optional loading. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the new mock-ratchet failure and the existing serial loading boundaries; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? The production approach is focused: it reuses existing owners, removes the analyzer's validator dependency, and preserves lazy rendering and stylesheet ordering. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 154cb5b28584. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +54, Tests +317, Docs +44, Other +205. Total +620 across 15 files. Added test files: 0. View PR surface stats
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 Reviewed October 30, 2026, 9:40 PM ET / October 31, 2026, 01:40 UTC. |
Keep the native input authoritative until its projected search commits. Cover immediate Escape and preserve paused cron detail expectations after current-main integration. Record settled renderer CPU for remote readiness comparisons.
|
Merged via squash.
|
…ker branch Co-authored-by: hannesrudolph <[email protected]>
* perf(ui): shorten remote page loading waterfalls * perf(ui): keep optional artwork outside route preloads * fix(ui): preserve search Escape during deferred updates Keep the native input authoritative until its projected search commits. Cover immediate Escape and preserve paused cron detail expectations after current-main integration. Record settled renderer CPU for remote readiness comparisons.
Integrate main through #188922 (0a9f3a6) to repair the observed cron detail and settings Escape CI failures. No conflicts or repository-authority owner changes. This pinned integration does not include the later schema39 migration. Co-authored-by: galiniliev <[email protected]>
Problem and change
First visits to Board, Usage, and Appearance wait through avoidable lazy-module discovery waves over remote Gateway connections. Appearance also acquires value-validation code although its display-only route does not validate values.
Start the two required Board presentation modules together at route activation, preload the measured page targets alongside their known dependency graphs, and group small Settings helpers already loaded together. The existing preload resolver uses Vite's chunk stylesheet metadata because Vite strips CSS before calling the dependency callback. Evaluation still follows Vite's stylesheet readiness; ordinary Chat, New Session, and optional artwork retain their existing lazy boundaries. Unchanged structural schema readers move to their traversal owner, leaving form edits with the existing validation owner.
No protocol, authorization, dependency, or configuration contract changes. The benchmark now distinguishes visible cached transcript, authoritative history, ready CPU, and CPU after its existing bounded settling tail.
Current-head evidence
Acceptance: Board improves by 22.0% at 100 ms RTT and 35.9% at 250 ms RTT; Appearance improves by 20.0% and 11.3%. Both improve locally too. Usage improves by 12.8% at 250 ms, with a measured 4.3% readiness cost at 100 ms; its settled task/script CPU changes there are +2.1%/+0.7%, within the 5% noise band. This is accepted as a small scheduling tradeoff, not described as a universal Usage win. No startup growth or additional network contract is required.
Warm-visible targets are met at both RTTs. Switch targets miss by 14.2 ms and 416.8 ms; the remaining mobile response-delay source is not localized. Reconnect median/paired results disagree and its p95 worsens, so no reconnect latency improvement is claimed. Its aggregate settled task/script CPU changes are +0.1%/+0.8% at 100 ms and +1.6%/−3.5% at 250 ms; observed probe/avatar paths and pending RPCs differ between samples. All sample and workload tables remain below.
Base:
18516599b1d417fee621b2fd2ceda21107bc038a. Candidate source:cf1eb27379e8f339f4b8fed32dc99c59efafaedc. Immutable bundles:current-base-uiandcurrent-head-ui. All current timing tables below come only fromcurrent-local,current-remote, andcurrent-mobile; earlier wins are not substituted.Twenty alternating base/head pairs per profile completed. Median paired change is the median of per-pair ratios, not the ratio of column medians. p95 uses nearest rank. All samples, including process-first samples and outliers, remain included. Both sides use the same current benchmark instrumentation copied into the baseline; baseline application source and its pinned production bundle are unchanged.
Host load is the sampled shared machine's one-minute load average, not per-process CPU utilization. Every measured action contributes one sample; ranges retain all outliers.
100 ms RTT / 10 Mbps: readiness (20/20 base, 20/20 head)
250 ms RTT / 3 Mbps: readiness (20/20 base, 20/20 head)
Local: readiness (20/20 base, 20/20 head)
Readiness means authoritative transcript plus composer for Chat/switch/reconnect, the draft composer for New Session, and the visible enabled target control for Board/Usage/Appearance. Reconnect additionally verifies a new handshake and canonical roster. Visible cached text is reported separately below.
Targets use candidate local medians and each profile's RTT; they concern visible transcript, not authoritative history.
Candidate remote-minus-local gap
Each Δ is the difference between complete candidate medians for the same milestone. Only warm visible text and this fixture's known-session switch have a fixed one-flight diagnostic. Their ε is gap minus one RTT, including transfer, backend/render work, overlap, and measurement noise; it can be negative. Other rows retain their dependency graph rather than inferring a hop count from elapsed time.
The mobile session-switch target remains unmet. All 20 candidate switches send one initial-history subscription, with 128,016 decoded bytes and about 10,674 wire bytes per reply. The variable delay falls before the proxy observes the response: median 358.9 ms from planned upstream delivery to response observation, versus 53.0 ms from browser decode to visible text. These stage medians are not additive. Proxy reads/backpressure, actual delivery scheduling, Gateway admission, and history I/O are not separately timed here; no additional mandatory protocol hop or safe production fix is established. Existing authority/replay/order guarantees remain intact.
CPU checkpoints and work comparability
Ready CPU stops at each readiness milestone, so faster rendering can move existing replies across that checkpoint. Settled CPU is recorded after the existing 750 ms tail and bounded HTTP network-idle wait; it is cumulative from the same action start. HTTP idle does not prove WebSocket quiescence. Both checkpoints remain descriptive unless the observed work census also matches. No uniform or equal-workload CPU win is inferred automatically.
100 ms RTT / 10 Mbps: ready and settled CPU, every flow (ms)
250 ms RTT / 3 Mbps: ready and settled CPU, every flow (ms)
Local: ready and settled CPU, every flow (ms)
Usage must be assessed at both checkpoints together with its HTTP and RPC censuses. HTTP completion alone is insufficient: a module loaded during the preceding action on one side but during this action on the other changes the work. If CPU windows include different HTTP request/state sets, observed bytes, replies, events, pending requests, or completion, the percentage cannot substantiate equal-workload improvement or regression. Even matched request/result counts do not establish equal RPC payloads.
Fresh current-base mobile A/A control
current-aa-mobilecompares18516599b1d417fee621b2fd2ceda21107bc038awith itself at 250 ms RTT / 3 Mbps. Both sides use the immutablecurrent-base-uibundle; this is a noise control, not a candidate comparison. Ten alternating pairs completed. It provides current mobile noise evidence and does not substitute for a current local or 100 ms A/A control.Recorded: 10/10 base and 10/10 identical-source control.
Fresh mobile A/A: ready and settled CPU, every flow (ms)
The A/A control uses the current mobile profile. Local and 100 ms results are candidate comparisons, not additional A/A controls.
Serial round-trip ledger
Dis the document request;Uis upgrade-to-challenge delivery (one observed flight, not an extra challenge round trip);His connect/hello;Sis the initial-history subscription;Qis conditional authoritative session resolution;Mis models.list;Lis the fresh primary roster.Aincludes each route's real asset dependency graph, CSS gates, transfer, connection-slot queues, and execution.Pis render/commit work. Independent branches combine with max. A response arriving before readiness does not make it a required dependency.Source anchors: warm cache admission and non-awaited config refresh in
ui/src/app/bootstrap.tsandsession-snapshot-prewarm.ts; conditional resolution inpages/chat/route-loader.ts; initial-history/approval ownership inapi/gateway-boot.tsandchat-history-subscription.ts; Usage's independent component/loader inpages/usage/route.tsx; display-only Settings inpages/config/route.ts; reconnect probe/replacement inapp/gateway-page-activation.ts, canonical roster gate inapp/control-ui-readiness.ts, and two-slot scheduling inapp/connection-bootstrap.ts.The early approval handoff is a real serial capability upgrade, but all 20 cold samples in the fresh mobile A/A control leave over 2.2 seconds between its completion and visible Chat. Removing it is not a demonstrated readiness win and would complicate approval replay ownership; this change retains that contract.
250 ms RTT / 3 Mbps / first-board, current pair 1
chat-sidebar-region.runtime-*.jsrequest → finishboard-view-*.jsrequest → finish250 ms RTT / 3 Mbps / first-usage, current pair 1
route-loader-*.jsrequest → finishusage-page-*.jsrequest → finish250 ms RTT / 3 Mbps / first-settings, current pair 1
settings-sidebar-shell-*.jsrequest → finishconfig-page-*.jsrequest → finish100 ms RTT / 10 Mbps / first-board, current pair 1
chat-sidebar-region.runtime-*.jsrequest → finishboard-view-*.jsrequest → finish100 ms RTT / 10 Mbps / first-usage, current pair 1
route-loader-*.jsrequest → finishusage-page-*.jsrequest → finish100 ms RTT / 10 Mbps / first-settings, current pair 1
settings-sidebar-shell-*.jsrequest → finishconfig-page-*.jsrequest → finishRepresentative traces describe individual complete pairs, not medians. Service-worker responses and zero page-observed bytes are not cache-hit evidence. In current mobile base pair 01, all 50 cold JavaScript resources, seven stylesheets, and the font carry one-year immutable caching. The warm reload serves those same resources from cache; its additional history-state chunk is a first fetch, not revalidation. The document remains no-store. No cache-policy change is warranted.
Validation and CI repairs
The Settings fix keeps the native input as the owner of in-progress text. It does not add synchronized state. The benchmark uses isolated real Gateways, two synthetic 120-message sessions, and headless Chromium at 1440×1000 without model/provider calls. The mobile profile changes network conditions, not viewport or CPU. TCP/TLS handshake latency, congestion, and loss are not simulated. HTTP bytes are page-observed lower bounds, excluding underlying service-worker transfers. Cancelled Dashboard navigation may retain downloaded modules; page state is created only when its view mounts.
LOC across 18 changed files: 8,249 → 8,912 (+663); includes benchmark/test coverage and CI repairs.
Raw Solid refactor census in touched production UI/build files: effects 1 → 1; memos 9 → 9; listeners 0 → 0; DOM queries 0 → 0; flush 0 → 0; owner calls 0 → 0. No additions in these categories.
Before / after
Synthetic current-comparison captures; the lead owns final full-image sanitation and source verification.