Repository navigation
perf(workspace): trim redundant writer request payloads - #187076
Conversation
Publish only prepared manifest root fields to the writer and send the existing digest-backed source-path placeholder. Keep full checkpoint and admitted-path data for durable recovery and host publication. Real-store byte-budget regression fails on main and passes with the fix. Synthetic owner workload reduces request bytes by 64.8%; sampled main-thread allocation is neutral and timing varies with host load.
|
🦞👀 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 sends compact workspace publication requests while retaining complete source paths and checkpoint documents for recovery. Example: A workspace checkpoint contains 1,000 admitted build-input paths.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR removes verified redundant writer payloads, and review found no actionable correctness or security defects. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway workspace store prepares content-addressed inventories, submits mutations to the SQLite writer, and reconstructs acknowledged projections for synchronization and recovery. flowchart LR
A[Workspace reconciliation] --> B[Local workspace store]
B --> C[Content preparation]
C --> D[SQLite writer]
B --> E[Compact publication request]
E --> D
D --> F[Commit receipt and host projection]
Technical reviewBest possible solution: Keep compact request construction in the existing workspace store and preserve complete host publication and durable recovery data. Do we have a high-confidence way to reproduce the issue? Source shows complete checkpoints and source-path JSON entering writer requests despite prepared content; the supplied regression reports base failure and candidate success, but this read-only review executed no target code. Is this the best way to solve the issue? The patch removes redundant data at its existing producer while preserving the writer, preparation, receipt reconstruction, compression, and recovery owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a2a1962d9ca. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +25, Tests +59, Other +322. Total +406 across 3 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 28, 2026, 7:24 PM ET / 23:24 UTC. |
) Publish only prepared manifest root fields to the writer and send the existing digest-backed source-path placeholder. Keep full checkpoint and admitted-path data for durable recovery and host publication. Real-store byte-budget regression fails on main and passes with the fix. Synthetic owner workload reduces request bytes by 64.8%; sampled main-thread allocation is neutral and timing varies with host load.
What Problem This Solves
Local sandbox workspace admission and checkpoint settlement resend expanded inventories to the SQLite writer after their content is already prepared.
User Impact
No storage format or reconciliation behavior changes. Workspace writes send less data between the host and writer; full checkpoint documents remain durable for recovery.
Why This Change Was Made
The workspace store now sends only the manifest root publication fields consumed by the writer. A checkpoint also contains recovery documents and build-input arrays, which previously crossed this boundary because its structural type fits the mutation interface. Source-path creation and updates send the existing
[]storage placeholder after content-addressed preparation, while the original mutation retains the complete JSON for host publication and lost-reply recovery.No schema, durability, FIFO ordering, authorization, revision, or lease checks change. Production delta: +25 lines (31 added, 6 removed). The added projection preserves the separate contracts: full host receipt reconstruction and compact writer input; it adds no cache or alternate persistence path.
Evidence
The new real-store regression fails on main
9cd97293eb93e0d445481a08ccbe94d5ae52ce63: create 48,009 B, settlement 53,824 B, both over the 2,048 B request budget. It passes with this change and verifies exact durable readback and retained checkpoint content.Synthetic workload: 16 retained workspace rows, 1,000 admitted build-input paths, prepared roots differing in one file, source admission, checkpoint reservation, settlement, and cleanup through the real store and SQLite broker. Byte measurements use 32 cycles; MB/min below uses a declared 30 cycles/minute, not benchmark throughput or a claim about production operation mix.
64.8% fewer request bytes. Source-admission mutation: 47,354 → 401 B/request. Settlement: 47,618 → 642 B/request. Create setup: 48,086 → 1,138 B/request. Content preparation and saved checkpoint traffic are unchanged.
Rerun instructions are in
scripts/perf/local-workspace-request-bytes-measure.ts.--revision <base-sha>substitutes only the old store owner. Byte-count instrumentation is disabled during timing and allocation measurements.Owner measurements use 2,048 cycles per arm, AB/BA order, with timing and allocation collected separately. Mixed-sign initial CPU pairs triggered one predeclared extra untraced pair.
This demonstrates a request-byte reduction, not a CPU or V8-heap allocation win. CPU pair differences were −110.28, +441.78, and +125.14 µs/cycle. Wall-time differences were +5.32%, +44.48%, and +1.89%; host/runtime drift was large. No rejection is inferred from these mixed measurements. The main-thread heap sampler does not account for all external serialization backing buffers or worker allocations.
Per-arm context (A = base, B = candidate)
Traced-pass CPU averages +27.68%; this instrumentation pass is context, not the untraced timing verdict. RSS/heap are endpoint observations, not post-GC retention proof.
Validation:
pnpm tsgo:test:root, the matching Gateway test typecheck, changed-file lint/format, export collision guard, and diff whitespace checks passed. Store, manifest-scan, and projection files passed 83 tests, with two environment-dependent skips (required Podman and invalid-UTF-8 filesystem support). Wall time 156 seconds including worker compilation; regression test time is under one second. Test-lines ratchet passed: 6,312,380 / 6,320,000. The two required import/source-closure files passed 38 tests (57 seconds). Independent subagent review (autoreview route unavailable) found no P0–P2 findings; the configured autoreview route was refused before inference, and operator configuration was left unchanged.Scope: owner-boundary proof, not whole-Gateway performance. No live service was stressed. Under this lane's bounded-transport fast-path protocol, no ten-minute Gateway campaign was run; server handler latency, event-loop tails, whole-Gateway GC/CPU, and production MB/min remain unmeasured.
Exact-head CI is green on
dcffa652538461751755f6721d94c6fc44aa38ee: CI run. Hosted review and security checks passed. This PR is ready and intentionally left unmerged for maintainer review.