Skip to content

perf(ci): share compiled workers across test groups - #146353

Merged
steipete merged 1 commit into
mainfrom
codex/ci-shared-worker-generation
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/ci-shared-worker-generation

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

CI jobs rebuild the same compiled worker graph for each Node test group. A measured seven-group job spent 33.404 seconds in seven preparations within a 426-second test step. Sharing preparation within the job reduced test execution by 6.09% in a controlled comparison.

Why This Change Was Made

The CI job owns one lazy generation and lends it through the existing bootstrap and IPC owners. Groups retain separate processes, selections, environments and worker limits, and each borrower verifies its artifacts. Compiler budgets derive from all effective group environments. Cancellation stays local to the requesting group; uncertain descendant completion retains artifacts.

Unsupported process-group platforms retain per-group ownership, and the named five-file frozen-release adapter remains lightweight. There is no new cache, configuration option, environment option, workflow, shard or runner.

User Impact

CI avoids repeated compilation while preserving test coverage and process isolation. Product runtime delta 0; tooling net +199 lines expresses cross-process lifetime ownership; tests/support net +593 across 12 files. One representative full-graph test remains, while other lifecycle scenarios use the existing controlled compiler fixture to avoid adding repeated expensive compilations.

Evidence

A baseline/candidate/reversal comparison ran the same seven groups, 12 files, eight native invocations and 122 passing cases per arm on one AWS m7i.large (two logical CPUs, 8.16 GB RAM), with Node 24.19.0 and pnpm 12.3.4 and fresh named caches per arm. Test times were 807.460/757.608/805.957 seconds: 6.09% lower against the controls' mean, with 0.19% control spread. Build plus tests improved 5.33%. Generations were 7/1/7; case multisets, worker limits, source maps, joins, cleanup and OOM checks passed. These measurements remain attributed to ec9260b/0bb0b7c/ec9260b; they are not a current Blacksmith wall-time forecast.

The comparison's final export exited 1 after its complete archive exceeded 24 MiB. All test and validation checks had passed. Canonical directory copy recovered the unchanged evidence; all 158 files/94.1 MB were independently hash-verified before the lease was stopped. The original export failure is retained; no tests were rerun or validation limits relaxed.

Original-red/fixed resource and readiness regressions passed, including 61 owner/shutdown cases. Coverage includes cancellation, disconnect, uncertain joins, budget intersection, portable delegation and the frozen-release boundary. Scoped types, lint, formatting, dead-export gates and independent P2 reviews passed. After the dependency refresh, the real concurrent compiler case passed in 13.957 seconds, proving two real borrowers share one verified generation and clean up; the inherited-filter timing regression also passed.

Exact-head CI 34726317274 passed on d30dd8f8ea5096a5cc28f938bd5db5937c6b458f: 76 successful jobs and 17 skipped. All 12 reviewed file bodies are unchanged by the final refresh onto repaired main. Earlier shared UI-budget failures are preserved and were resolved by independent main repairs. Latest exact-head ClawSweeper review has no actionable findings or before-merge moves. Native Windows performance is not claimed; required hosted platform checks passed.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 7:54 PM ET / 23:54 UTC (Revision 5).

ClawSweeper review

What this changes

Shares one lazily compiled worker generation across CI test groups while preserving separate test processes, group settings, verification, and cleanup.

Merge readiness

✅ Ready for maintainer review

The optimization remains useful: current main still prepares workers separately for each project-runner invocation. No actionable correctness or security finding was identified, and the rebase preserves every previously reviewed file.

Priority: P2
Reviewed head: d30dd8f8ea5096a5cc28f938bd5db5937c6b458f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent optimization with strong reported comparative evidence, meaningful lifecycle coverage, and no actionable review findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured AWS comparison exercises the CI group runner and reports one shared preparation with unchanged cases and cleanup; later real-compiler coverage exercises separate concurrent borrowers. The verified byte-identical rebase preserves the reviewed implementation. Historical benchmark attribution remains unchanged, and native Windows performance is not claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured AWS comparison exercises the CI group runner and reports one shared preparation with unchanged cases and cleanup; later real-compiler coverage exercises separate concurrent borrowers. The verified byte-identical rebase preserves the reviewed implementation. Historical benchmark attribution remains unchanged, and native Windows performance is not claimed.
Evidence reviewed 8 items Current main still uses per-invocation compilation: The current-main project runner calls createVitestWorkerRun(baseEnv), whose owner always creates a fresh generation directory; it does not accept a parent generation.
Latest-release comparison: GitHub returns the same shard-runner blob, 1b63b4c40155dcb9e167c7868ec617904c440403, for v2026.9.4 and fetched main. Neither contains this PR's shared worker context.
Review continuity verified: The complete GitHub tree for earlier reviewed head 8d80ff1 has identical blob IDs for all 12 introduced files compared with local HEAD. The earlier commit was unavailable locally, so GitHub tree records supplied the comparison. The prior review projection contains no findings or published rank-up moves.
Findings None None.
Security None None.

How this fits together

The CI shard runner turns test plans into separate project-runner processes. Those processes lend compiled subprocess code to Vitest, then join their descendants before releasing temporary artifacts.

flowchart TD
  A[Test group plans] --> B[CI shard runner]
  B --> C[Shared lazy compilation]
  B --> D[Separate project runners]
  C --> E[Verified worker artifacts]
  D --> F[Separate Vitest processes]
  E --> F
  F --> G[Join descendants]
  G --> H[Clean up or retain artifacts]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +593, Other +199. Total +792 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 631 38 +593
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 6 324 125 +199
Total 12 955 163 +792

Review metrics

Metric Value Why it matters
Controlled performance comparison 6.09% lower test time; preparations 7 → 1 The reported AWS reversal comparison demonstrates useful savings without claiming equivalent Blacksmith wall-time gains.
Production and test balance Product runtime 0; tooling net +199; tests/support net +593 lines Tooling growth implements shared lifetime ownership, while most growth covers cancellation, retention, and compatibility boundaries.

Technical review

Best possible solution:

Keep one job-owned lazy compilation with per-borrower verification, independent group execution, and deletion only after verified descendant completion.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction: this is a performance improvement, supported by the reported seven-group comparison and source showing repeated per-invocation preparation.

Is this the best way to solve the issue?

Yes. Extending the existing compilation owner avoids a competing cache or execution path while retaining group isolation and portable fallback.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against bf95f2b23c63.

Labels

Label justifications:

  • P2: This is a measured CI efficiency improvement with no reported product-runtime outage or urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured AWS comparison exercises the CI group runner and reports one shared preparation with unchanged cases and cleanup; later real-compiler coverage exercises separate concurrent borrowers. The verified byte-identical rebase preserves the reviewed implementation. Historical benchmark attribution remains unchanged, and native Windows performance is not claimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured AWS comparison exercises the CI group runner and reports one shared preparation with unchanged cases and cleanup; later real-compiler coverage exercises separate concurrent borrowers. The verified byte-identical rebase preserves the reviewed implementation. Historical benchmark attribution remains unchanged, and native Windows performance is not claimed.

Evidence

What I checked:

  • Current main still uses per-invocation compilation: The current-main project runner calls createVitestWorkerRun(baseEnv), whose owner always creates a fresh generation directory; it does not accept a parent generation. (scripts/lib/vitest-worker-run.mts:25, bf95f2b23c63)
  • Latest-release comparison: GitHub returns the same shard-runner blob, 1b63b4c40155dcb9e167c7868ec617904c440403, for v2026.9.4 and fetched main. Neither contains this PR's shared worker context. (scripts/ci-run-node-test-shard.mts, 3a9d69db306c)
  • Review continuity verified: The complete GitHub tree for earlier reviewed head 8d80ff1 has identical blob IDs for all 12 introduced files compared with local HEAD. The earlier commit was unavailable locally, so GitHub tree records supplied the comparison. The prior review projection contains no findings or published rank-up moves. (d30dd8f8ea50)
  • Ownership and cancellation: The shard runner uses owned child processes and rejects unverified descendant completion. Delegated generation owners cancel their upstream request on disposal but never delete the shared directory; the containing owner waits for borrowers and retains artifacts when joins are uncertain. (scripts/lib/vitest-worker-run.mts:155, d30dd8f8ea50)
  • Boundary regression coverage: Read the real two-group compilation case, serial reuse and portable delegation cases, sibling-survival retention case, frozen-checkout boundary cases, and shutdown scenarios. Controlled compiler fixtures retain real process owners and IPC; the concurrent compilation case retains the actual compiler. (test/scripts/vitest-worker-artifacts.ci.test.ts:120, d30dd8f8ea50)
  • Captured real behavior evidence: The complete supplied PR body reports a same-host AWS baseline/candidate/reversal run: seven groups, 122 passing cases per arm, preparation counts 7/1/7, and test durations 807.460/757.608/805.957 seconds. It reports preserved worker limits, case membership, source maps and cleanup, plus a later real concurrent compiler pass in 13.957 seconds. These are contributor-reported observations, not executions performed during this review; the benchmark remains attributed to its original compared revisions. Captured context sourceRevision: a65cfe156ae396f5a710303e38739ece76b5da0b50a667c2d551aee8127b10ea.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Doksanbir: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-12T19:22:43.115Z sha 0bb0b7c :: blocked before merge. :: none
  • reviewed 2026-09-12T21:25:17.054Z sha 0bb0b7c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T22:23:50.848Z sha 8d80ff1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T22:39:15.591Z sha 8d80ff1 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 12, 2026
@steipete
steipete force-pushed the codex/ci-shared-worker-generation branch from 0bb0b7c to 8d80ff1 Compare September 12, 2026 22:16
@steipete steipete changed the title improve: reuse compiled test workers across CI groups perf(ci): share compiled workers across test groups Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 22:17
@steipete
steipete force-pushed the codex/ci-shared-worker-generation branch from 8d80ff1 to d30dd8f Compare September 12, 2026 23:47
@steipete
steipete merged commit 94a56b2 into main Sep 13, 2026
144 checks passed
@steipete
steipete deleted the codex/ci-shared-worker-generation branch September 13, 2026 00:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
roboclaw-bot added a commit that referenced this pull request Sep 16, 2026
#150360)

Reuse the existing compiled-worker invocation, private bootstrap and IPC
borrower in the batch runner. Verify and dispose artifacts before reporting
completion or propagating signals; preserve live-source watch behavior.

Keep native flags, HOME admission, failure outcomes, and all memory/voice
provider choices and deadlines unchanged. Cover successful and failed
native batches with two projects sharing one prepared generation.

Related: #146353

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
openclaw#150360)

Reuse the existing compiled-worker invocation, private bootstrap and IPC
borrower in the batch runner. Verify and dispose artifacts before reporting
completion or propagating signals; preserve live-source watch behavior.

Keep native flags, HOME admission, failure outcomes, and all memory/voice
provider choices and deadlines unchanged. Cover successful and failed
native batches with two projects sharing one prepared generation.

Related: openclaw#146353

Co-authored-by: steipete <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant