Skip to content

ci: reuse verified test workers across jobs - #154095

Merged
steipete merged 1 commit into
mainfrom
ci-burden/o1-job-overhead
Sep 20, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/o1-job-overhead

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

CI repeatedly compiles the same test workers in separate jobs and uploads build archives that no repository job consumes.

Related: #153558.

User Impact

This reduces CI preparation work without changing test selection, worker limits, runner placement, or deadlines. There is no product behavior change. The first PR run is cold: shared reuse becomes available only after the protected warmer publishes this new cache namespace.

Why This Change Was Made

Source-only Linux Node 24 shards restore the existing content-validated worker cache. The protected warmer prepares and joins one generation before SDK/runtime builds change package resolution, then publishes it through the existing Actions cache mechanism. PR consumers remain restore-only. Missing seeds keep normal fresh compilation; incompatible source, dependencies, compiler, environment, resolution topology, workspace paths, or output bytes cause a local rebuild. The existing owner retains exclusive slot reservation, borrower verification, and joined cleanup.

Remove the unused dist-runtime-build and bundled-plugin-assets packing/uploads. Built CLI smoke, generated asset checks, all built-artifact verifiers, and diagnostic/proof uploads remain. Runtime-building shards retain their own qaRuntime preparation: depending on the full artifact job would add SDK/UI/check work to their critical path, and private QA uses a different output variant. Checkout already fetches depth-one selected source; history readers retain their explicit prerequisites. Sampled dependency/store keys hit, so this change does not churn those keys. Docker/desktop proof steps were unselected in the baselines and are not treated as removable overhead.

Evidence

Both job pages were fetched explicitly for each baseline and checked against total_count. Skipped steps are excluded; successful zero-second steps remain. Median is the arithmetic median; p90 is nearest rank. API timing resolution is one second. Composite Node setup includes runtime, pnpm/dependency restore/install, and compile-cache preparation. Worker compilation is inside the Node test step, not a separate API step. The critical worker below is the last finishing active non-gate job; run wall includes admission/dependency/final-gate delay.

Baseline main: 35520044205, head 814c3c1ae9650edc8c38ed306da8df4681144c4b, 72 active/90 total jobs, 16m45s wall, 412.42 machine-minutes. Critical worker checks-node-compact-large-10 took 907s; checkout/setup consumed 74s (8.16%).

Main step (top 10 by total) Count Median s P90 s Total min Critical-worker wall share
Run Node test shard 46 380.5 672 304.78 90.63%
Run check shard 7 203 419 21.90 0%
Setup Node environment 69 13 22 17.33 4.74%
Checkout 71 9 27 13.30 3.42%
Run hosted core lint stripe 2 384.5 398 12.82 0%
Run additional check shard 5 105 170 8.78 0%
Run hosted core test-types stripe 2 236 252 7.87 0%
Run channel contract shard 1 220 220 3.67 0%
Build Node test runtime 5 38 39 3.10 0%
Run built artifact checks 1 151 151 2.52 0%

Baseline PR: 35456568835, head 3d4234216e859be9a2a1e3b81af81db8381e90e6, 152 active/168 total jobs, 26m25s wall, 754.13 machine-minutes. Critical worker checks-node-compact-large-19 took 1,327s; checkout/setup consumed 47s (3.54%). This inventory differs from main and the candidate; aggregate wall differences are not a paired causal benchmark.

PR step (top 10 by total) Count Median s P90 s Total min Critical-worker wall share
Run Node test shard 120 205 532 541.83 95.86%
Checkout 151 8 44 49.78 2.49%
Setup Node environment 147 13 15 32.40 1.06%
Run hosted core lint stripe 5 405 459 31.22 0%
Run check shard 7 138 312 14.80 0%
Build Node test runtime 20 37 39 12.32 0%
Run test-2 (node) 1 739 739 12.32 0%
Run hosted core test-types stripe 2 282 324 9.40 0%
Run test-1 (node) 1 561 561 9.35 0%
Run additional check shard 5 102 174 7.05 0%

The five exposed fixed costs are checkout, Node setup, runtime builds, runner setup, and dist build. Main/PR runtime builds consumed 3.10/12.32 minutes; dist build took 81/80s. Sampled exact-dependency/store restores hit; cold worker compilation was 7.149–21.746s. No desktop/Docker timing claim is possible from these skipped lanes.

Linux Testbox tbx_01m309pm522sbfeja1v3jr36b4 (provisioning run) used 4 CPUs, 15.4 GiB RAM, Node 24.19.0. A paired preparation probe, including owner disposal, measured fresh 8.43/9.44s versus archive-restored 3.21/3.17s. A 30 MiB archive was packed, removed, and extracted before the first reuse. Peak process RSS was 2.59–2.66 GiB fresh versus 0.55 GiB restored; cold seed production took 9.38s. Gross midpoint improvement is 5.75s per matching consumer before transport. For 41 source-only main shards, the upper-bound gross saving is 3.93 machine-minutes/run, or 2.36 machine-hours per eight hours at 36 runs; subtract seed production, transport and misses. This is a forecast, not a measured workflow saving. Removing unused uploads saves the measured 5–6s runtime upload plus packing/plugin-asset upload on the artifact job, which was not either baseline's final bottleneck.

The initial remote cache/slot run caught a fixture inheriting the new opt-in while asserting default CI behavior. The fixture now pins default CI explicitly and independently covers cached-CI slot reuse; no assertion or deadline was relaxed.

Validation completed before publication:

  • Workflow guard file: 625 passed, 12 platform skips; 436.01s wall on one worker. The new restore/authority guard took 30ms; its focused rerun passed after extending producer-order checks.
  • Planner files: 332 passed, 394.52s wall on one worker. Planner sources, weights, and packing were not edited.
  • Linux cache/lifecycle/slot files: 29 passed, 2.59s wrapper wall. The real warmer command also restored successfully in 3.21s. The task-owned Testbox was stopped.
  • Cache file cost: pnpm test test/scripts/vitest-worker-cache.test.ts --maxWorkers=1 passed 24 tests, 7.55s wall (3.2s test body). The slot file passed four cases in 4.39s wrapper wall.
  • node scripts/check-changed.mjs, workflow audit (zizmor and generated checkout checks), oxfmt --check, docs inventory, 14,232 internal links, touched-page anchors, and git diff --check passed.
  • P2 precommit and committed-branch autoreviews: scoped-clean, no actionable findings. Candidate head: 8d8ab7b216f0ae423b09af2b6267d185c2e1989e. The first candidate CI run passed, including the aggregate gate; the completed comparison follows below.

The removed packing/upload steps totaled 7s on main / 8s on the PR (packing rounded to zero at API resolution, runtime upload 5/6s, plugin assets 2s). These are artifact-job savings, not measured workflow-wall reductions.

First PR run: measured result

CI run 35539043850 passed on 8d8ab7b216f0ae423b09af2b6267d185c2e1989e: 17m26s wall, 67 active / 76 total jobs, 282.30 machine-minutes. All PR check-rollup entries are successful, neutral, or intentionally skipped. The PR remains open and unmerged.

The raw differences from the baseline PR are −8m59s workflow wall and −471.83 machine-minutes. They are not attributable savings: the candidate selected 14 Node shards rather than 120, and selected browser/Docker coverage absent from that baseline. Compared with the main baseline, wall is +41s. No measured critical-path improvement is established by this cold run.

Step Count Median s P90 s Total min Critical job s (% wall)
Test Control UI end-to-end 12 273 351 58.67 0 (0.00%)
Checkout 66 22 36 23.53 21 (2.39%)
Run Node test shard 14 69 197 22.60 0 (0.00%)
Run check shard 7 198 437 21.50 0 (0.00%)
Setup Node environment 62 14 29 17.25 0 (0.00%)
Run test-2 (node) 1 808 808 13.47 808 (92.13%)
Run hosted core lint stripe 2 380.5 399 12.68 0 (0.00%)
Run test-1 (node) 1 681 681 11.35 0 (0.00%)
Test Control UI 3 256 264 11.25 0 (0.00%)
Run changed Docker seed owner lanes 1 636 636 10.60 0 (0.00%)

The finishing worker was checks-windows-node-test-2: 877s wall, beginning 164s after workflow creation. Its test step took 808s (92.13%); checkout was 21s (2.39%) and dependency installation 28s (3.19%). It does not use the Linux worker cache.

Comparable preparation metric Main baseline PR baseline Candidate PR
Node shard checkout median / p90 8 / 9s 8 / 36s 9 / 20s
Node shard setup median / p90 13 / 15s 13 / 15s 14 / 16s
Explicit Node runtime build median (count) 38s (5) 37s (20) Not selected (0)
Build dist 81s 80s 90s
Removed packing + uploads 7s 8s 0s

Both inspected candidate Node logs confirmed a miss in the new worker-cache namespace. Lookup took 0.114/0.141s; fresh compilation remained in use. Warm CI transfer time and production hit rate remain unmeasured until the protected main warmer rolls out. The native 5.75s gross per-hit saving is therefore a forecast input, not a claimed PR-wide saving.

The selected Docker owner proof took 636s, the real-Gateway runtime/UI build 102s, desktop resize proof 79s, and each of the two desktop proof uploads 2s. Those are retained coverage/proof work, not unused outputs.

CI reported case-duration sums of 129.639s for the workflow guard file, 1.315s for the cache file, and 0.559s for the slot file. These are verbose-case sums, not full file walls. The new workflow admission case took 20ms, the cache opt-in case 0ms at reporter resolution, and the cached-CI slot case 63ms. The first candidate run was green without rerunning any job.

@clawsweeper

clawsweeper Bot commented Sep 20, 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 docs Improvements or additions to documentation scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 20, 2026
@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 6:12 PM ET / 22:12 UTC (Revision 2).

ClawSweeper review

What this changes

Eligible Linux CI jobs restore verified compiled test workers from the existing cache warmer, while unused build-archive uploads are removed.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful CI optimization absent from current main. The pinned patch has no actionable correctness findings, and the supplied evidence distinguishes demonstrated worker reuse from unmeasured workflow savings.

Priority: P2
Reviewed head: 8d8ab7b216f0ae423b09af2b6267d185c2e1989e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with relevant production-path measurements, passing hosted validation, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Linux Testbox observations exercise the production worker owner and warmer entrypoint after archive restoration, including successful reuse and joined cleanup; hosted CI independently confirms the cold fallback. Warm Actions transport and hit-rate savings remain explicitly unclaimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Linux Testbox observations exercise the production worker owner and warmer entrypoint after archive restoration, including successful reuse and joined cleanup; hosted CI independently confirms the cold fallback. Warm Actions transport and hit-rate savings remain explicitly unclaimed.
Evidence reviewed 9 items Pinned introduction reviewed: Reviewed the merge-base-to-head diff across workflows, setup action, worker tooling, tests, and documentation. The earlier completed review examined this same head and retained no findings or rank-up moves.
Current main still lacks CI reuse: Current main's worker-cache policy rejects CI unconditionally. Its warmer and the v2026.9.5 warmer lack compiled-worker preparation/publication, so neither the inspected main nor latest release subsumes this change.
Release comparison: The inspected latest-release warmer has existing dependency/build/transform caches but no compiled-worker cache publication.
Findings None None.
Security None None.

How this fits together

OpenClaw's CI prepares compiled workers before running selected tests. The shared cache supplies candidate compiler outputs; the existing worker owner validates them and either reuses them or compiles fresh outputs.

flowchart TD
  A[Protected cache warmer] --> B[Compiled worker archive]
  B --> C[Eligible Linux test job]
  C --> D{Inputs and outputs match?}
  D -->|Yes| E[Reuse reserved worker generation]
  D -->|No| F[Compile fresh workers]
  E --> G[Run tests and join cleanup]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +110, Docs +63, Config +25, Other +43. Total +241 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 120 10 +110
Docs 4 66 3 +63
Config 3 46 21 +25
Generated 0 0 0 0
Other 3 44 1 +43
Total 13 276 35 +241

Review metrics

Metric Value Why it matters
Measured reuse benefit 5.75 seconds gross per matching consumer The paired production-owner probe excludes cache transport, so this does not establish net workflow savings.

Technical review

Best possible solution:

Keep one verified worker-cache owner with fresh-compilation fallback, and assess net CI savings from warm production observations after rollout.

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

Not applicable as a product bug: source confirms repeated CI compilation, and the supplied paired Linux probe measures the preparation overhead.

Is this the best way to solve the issue?

Yes: extending the existing verified cache and lifecycle owner avoids duplicate compilation machinery while preserving fresh preparation for incompatible inputs.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded CI preparation optimization with measured local benefit and no reported urgent product regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 supplied Linux Testbox observations exercise the production worker owner and warmer entrypoint after archive restoration, including successful reuse and joined cleanup; hosted CI independently confirms the cold fallback. Warm Actions transport and hit-rate savings remain explicitly unclaimed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Linux Testbox observations exercise the production worker owner and warmer entrypoint after archive restoration, including successful reuse and joined cleanup; hosted CI independently confirms the cold fallback. Warm Actions transport and hit-rate savings remain explicitly unclaimed.

Evidence

What I checked:

  • Pinned introduction reviewed: Reviewed the merge-base-to-head diff across workflows, setup action, worker tooling, tests, and documentation. The earlier completed review examined this same head and retained no findings or rank-up moves. (8d8ab7b216f0)
  • Current main still lacks CI reuse: Current main's worker-cache policy rejects CI unconditionally. Its warmer and the v2026.9.5 warmer lack compiled-worker preparation/publication, so neither the inspected main nor latest release subsumes this change. (scripts/lib/vitest-worker-cache-policy.mts:11, 2c6626c6183e)
  • Release comparison: The inspected latest-release warmer has existing dependency/build/transform caches but no compiled-worker cache publication. (.github/workflows/vitest-cache-warm.yml, ec9c1a13db89)
  • Publication and consumer boundaries: The setup action only restores archives and enables reuse after a matched cache. The warmer saves after successful preparation and joined disposal, before SDK/runtime builds alter resolution. Ordinary PR cache authority remains restore-only; action pins and workflow permissions are unchanged. (.github/actions/setup-node-env/action.yml:374, 8d8ab7b216f0)
  • Existing validation and lifecycle owner retained: The preparer calls the same worker owner used by test execution. Existing restoration checks inventory, source/output hashes, compiler metadata and absolute output paths; transfers revalidate lock ownership, and disposal joins borrowers/resources before retention. (scripts/lib/vitest-worker-run.mts:138, 8d8ab7b216f0)
  • Real preparation evidence and measured limits: The captured PR body reports a Linux Node 24.19.0 Testbox probe using the production preparation owner, including archive packing/removal/extraction and joined disposal: fresh 8.43/9.44 seconds versus restored 3.21/3.17 seconds. The real warmer entrypoint also restored successfully. The body explicitly leaves warm Actions transfer cost and production hit rate unmeasured; the 5.75-second gross improvement is before transport. (scripts/prepare-vitest-worker-cache.mts:20, 8d8ab7b216f0)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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 (1 earlier review cycle)
  • reviewed 2026-09-20T21:45:38.786Z sha 8d8ab7b :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 0a9d65e into main Sep 20, 2026
141 checks passed
@steipete
steipete deleted the ci-burden/o1-job-overhead branch September 20, 2026 22:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation 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: M 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