Skip to content

ci(test): size Vitest workers from measured CI headroom - #152864

Merged
steipete merged 1 commit into
mainfrom
ci-burden/h2-worker-sizing
Sep 19, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/h2-worker-sizing

Conversation

@steipete

@steipete steipete commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Heavy Gateway CI remains capped at two Vitest workers even when Blacksmith supplies eight CPUs and about 31 GiB of RAM. The scheduler, workflow override, compact group pin, and packed-job cap all have to agree before additional workers can reach the tests.

User Impact

The complete 293-file agentic-gateway-core-2 group passed at eight workers with a 253.5-second midpoint, 15.8% below the same-revision three-worker control. Interactive local behavior is unchanged. End-to-end PR CI performance remains unmeasured.

Why This Change Was Made

CI autosizing admits six workers at 24–28 GiB and eight at 28–128 GiB with at least eight available CPUs. The worst measured single-plan RSS gives conservative two-plan bounds of 16.98 GiB for six workers and 20.16 GiB for eight, below 75% of the corresponding 24/28 GiB thresholds. The explicit override, load backoff, process memory constraints, free-memory pressure limits, forks limit, and 16-worker cap remain.

Roomy serial self-hosted jobs resolve that policy after runtime preparation. Only core-2 loses its compact pin on Blacksmith/hybrid; its co-located siblings retain their original caps. A plan-carried fallback restores two workers when the executor observes constrained capacity, hosted execution, a frozen target, or overlapping plans. Hosted, frozen, constrained, and overlapping workflow ceilings remain unchanged. Production Gateway admission remains exclusive.

The planner retains conservative historical timing floors while emitting timing identities for the changed worker policy. config/ci-test-timings.json, runner labels, registration counts, test inventories, assertions, and deadlines are unchanged.

Evidence

Blacksmith probe run 35441442486, head 6a23c50cf7d1925cb7e042665edf8a67cfd9645d: six jobs, two predefined samples each, all twelve passed without rerunning failures. Actual allocation: eight CPUs, 30.95 GiB, Node 24.19.0. Resource receipts confirm the listed workers and admitted plan slots. Every single-plan sample ran 293 files; every two-plan sample ran 580 files. Zero unhandled errors.

Requested workers (actual) Plans Wall seconds, both samples Peak summed RSS Peak process RSS Result
default (3) 1 313.0 / 288.8 5.92 GiB 5.63 GiB 2/2 passed
6 1 248.5 / 239.7 8.49 GiB 8.12 GiB 2/2 passed
8 1 252.5 / 254.5 10.08 GiB 9.69 GiB 2/2 passed
default (3) 2 364.9 / 347.2 9.04 GiB 5.66 GiB 2/2 passed
6 2 359.0 / 316.4 12.12 GiB 7.46 GiB 2/2 passed
8 2 380.0 / 339.6 14.71 GiB 8.59 GiB 2/2 passed

RSS is sampled every two seconds across Vitest-matching processes; the table takes the maximum of both samples. Raw sample artifacts agree with every summary. Two-plan measurements already include both processes, so their aggregate is not multiplied again.

Six workers was slightly faster than eight in these samples (18.9% below the single-plan control). Eight did not improve the combined two-plan wall. Eight satisfies the requested memory admission criterion; this small sample establishes a single-plan improvement, not a precise optimum or a full-workflow speedup. The disposable probe temporarily allowed core-1/core-2 overlap to measure contention; that exception is absent from this PR and the remote probe branch has been deleted.

The probe includes the fixture fix from #152785, now merged as c30f2063c254cfab4530014a4550d4bb7bdf7e16. The runnable PR CI cycle must include that fix in its tested base.

Local validation passed: scheduler, shard executor, planner, and workflow guards; changed-file checks (including scripts/root-test typechecks and boundary guards); explicit type-aware lint with a rejecting Promise canary; formatting; docs sanity; and whitespace checks. Independent branch review found no actionable P0–P2 findings.

Native PR CI

Run 35443456810 passed on head 82535d44f70dc0d41beb7626ad91797239c88c83: 124 successful jobs, nine skipped, zero failures, run attempt 1. The three core-2 jobs automatically selected eight workers on eight-CPU / 30.95-GiB runners. Their descriptors retained the fallback limit and their siblings' two-worker caps. All Gateway core families passed.

Core-2 part / containing job Latest main group span PR group span Latest main job wall PR job wall
1 / compact-large-4 123.878 s 83.069 s 6m04s 5m28s
2 / compact-large-2 137.427 s 86.542 s 6m18s 5m26s
3 / compact-large-3 203.474 s 160.313 s 6m39s 6m22s

The latest successful main comparison is 35442446249. All three core-2 file inventories match exactly. Summed core-2 spans fell from 464.779 to 329.924 seconds (29.0%), or 32.8% below the committed 491-second weight. The full workflow took 16m57s versus main's 16m17s, below the earlier 19–23-minute range. The final critical-path bin, checks-node-compact-large-1, took 15m10s on two CPUs with two workers; its Gateway server-isolated slice consumed 560.380 seconds. Main and PR select different work, so the paired probe remains the controlled worker-count comparison.

The emitted compact PR plan remains at 73 rows on hybrid and 76 on Blacksmith, including two dist boundary descriptors. This change adds no persistent jobs or registrations. Workflow Sanity also passed on the head. No workflow or Blacksmith sample was rerun, and the PR remains unmerged with auto-merge disabled.

Landing handoff: this CI run tested synthetic merge 495a030b against base 297fca0c6184d59836cb70001b193f10115dc9d1. That base predates the final H1 child-retention support-fixture patch from #152785; the Phase 1 probe includes the patch, which is now on main. Refresh and verify the combined base through the maintainer preparation workflow before landing. This lane does not rebase, rerun CI, or merge after its one full validation cycle.

Use measured CI-only six/eight-worker memory tiers for roomy serial self-hosted jobs. Retain local behavior, actual-host fallback limits, Gateway exclusivity, unproven group caps, and historical timing floors. The twelve predefined Blacksmith probe samples passed; native PR CI remains a separate validation step.
@clawsweeper

clawsweeper Bot commented Sep 19, 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: L maintainer Maintainer-authored PR labels Sep 19, 2026
@steipete
steipete marked this pull request as ready for review September 19, 2026 12:38
@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 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 19, 2026, 9:13 AM ET / 13:13 UTC (Revision 2).

ClawSweeper review

What this changes

The PR sizes CI test workers from measured CPU and memory headroom while retaining conservative limits for constrained runners and unmeasured test groups.

Merge readiness

⛔ Blocked before merge - 3 items remain

The optimization remains useful and is not implemented on current main. No introduced correctness or security defect was found; the documented combined-base validation handoff remains outstanding.

Priority: P2
Reviewed head: 82535d44f70dc0d41beb7626ad91797239c88c83

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with strong operational measurements and no actionable code findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The controlled Blacksmith probe and native PR run exercise the changed scheduler, planner, and shard executor on eight-CPU/30.95-GiB runners, with reported eight-worker admission and improved core-2 spans. GitHub confirms successful execution; the separate combined-base preparation requirement remains.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The controlled Blacksmith probe and native PR run exercise the changed scheduler, planner, and shard executor on eight-CPU/30.95-GiB runners, with reported eight-worker admission and improved core-2 spans. GitHub confirms successful execution; the separate combined-base preparation requirement remains.
Evidence reviewed 7 items Introduced scope and current-main necessity: The three changed scheduling and execution modules still differ from fetched main by the proposed implementation; main has not absorbed the worker-sizing change. Review used the pinned merge-base delta, not unrelated endpoint drift.
Execution safeguards: The executor retains exclusive Gateway admission, intersects job and group worker caps, and applies the fallback when execution is hosted, frozen, constrained, or overlapping. Planner cap redistribution happens after runtime placement.
Real CI execution: GitHub confirms native run 35443456810 succeeded on the reviewed head, attempt 1. The captured PR body reports automatic eight-worker selection for all three core-2 jobs, retained sibling caps, and group spans of 83.069, 86.542, and 160.313 seconds. The controlled twelve-sample probe also succeeded. Raw job-log retrieval was blocked by the review host’s artifact-domain allowlist; the detailed captured results remain valid evidence, with that inspection limitation disclosed.
Findings None None.
Security None None.

How this fits together

OpenClaw’s CI planner groups tests into runner jobs, and the shard executor applies worker limits before launching Vitest. This change connects measured host capacity to those limits without increasing job concurrency.

flowchart LR
  A[Test inventory] --> B[CI job planner]
  B --> C[Group caps and fallback limits]
  D[Runner CPU and memory] --> E[Worker scheduler]
  C --> F[Shard executor]
  E --> F
  F --> G[Vitest execution and results]
Loading

Before merge

  • Resolve merge risk (P1) - The successful native test merge predates the fixture repair used by the controlled probe; the combined landing candidate has not been verified in the supplied evidence.
  • Resolve merge risk (P1) - The samples establish a core-2 improvement, not an optimal worker count or a full-workflow speedup.
  • Complete next step (P2) - Complete the documented preparation handoff: refresh against main containing the retention-fixture repair and record validation of the combined candidate before landing.
Agent review details

Security

None.

PR surface

Tests +279, Docs +63, Config +14, Other +103. Total +459 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 404 125 +279
Docs 3 65 2 +63
Config 1 43 29 +14
Generated 0 0 0 0
Other 3 130 27 +103
Total 11 642 183 +459

Review metrics

Metric Value Why it matters
Automatic CI worker tiers 6 workers at 24–<28 GiB; 8 at 28–128 GiB, with at least 8 CPUs These thresholds determine where the measured capacity increase becomes eligible.
Production versus test growth Production/tooling net +117 lines; tests net +279 lines The implementation growth supports fallback propagation, sibling-cap preservation, and historical timing floors.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep worker sizing in the shared scheduler, preserve executor fallbacks and sibling caps, and land against a verified combined base.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep worker sizing in the shared scheduler, preserve executor fallbacks and sibling caps, and land against a verified combined base.

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

Not applicable as a product bug: this is CI capacity tuning, supported by controlled runner measurements and a successful native execution of the reviewed head.

Is this the best way to solve the issue?

Yes. Reusing the existing scheduler and executor preserves one policy owner, and the fallback metadata protects environments outside the measured capacity envelope.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded CI performance improvement with measured benefit and no urgent user-facing 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 (linked_artifact): The controlled Blacksmith probe and native PR run exercise the changed scheduler, planner, and shard executor on eight-CPU/30.95-GiB runners, with reported eight-worker admission and improved core-2 spans. GitHub confirms successful execution; the separate combined-base preparation requirement remains.
  • proof: sufficient: Contributor real behavior proof is sufficient. The controlled Blacksmith probe and native PR run exercise the changed scheduler, planner, and shard executor on eight-CPU/30.95-GiB runners, with reported eight-worker admission and improved core-2 spans. GitHub confirms successful execution; the separate combined-base preparation requirement remains.

Evidence

What I checked:

  • Introduced scope and current-main necessity: The three changed scheduling and execution modules still differ from fetched main by the proposed implementation; main has not absorbed the worker-sizing change. Review used the pinned merge-base delta, not unrelated endpoint drift. (scripts/lib/vitest-local-scheduling.mts:160, 82535d44f70d)
  • Execution safeguards: The executor retains exclusive Gateway admission, intersects job and group worker caps, and applies the fallback when execution is hosted, frozen, constrained, or overlapping. Planner cap redistribution happens after runtime placement. (scripts/ci-run-node-test-shard.mts:478, 82535d44f70d)
  • Real CI execution: GitHub confirms native run 35443456810 succeeded on the reviewed head, attempt 1. The captured PR body reports automatic eight-worker selection for all three core-2 jobs, retained sibling caps, and group spans of 83.069, 86.542, and 160.313 seconds. The controlled twelve-sample probe also succeeded. Raw job-log retrieval was blocked by the review host’s artifact-domain allowlist; the detailed captured results remain valid evidence, with that inspection limitation disclosed. (82535d44f70d)
  • Prior review follow-up and fixture boundary: The updated body supplies the previously requested native timings but explicitly retains a preparation handoff. The recorded test merge has fixture blob 828a017f9c39841936caa8613bf8c476bff3775b; the merged fixture repair and fetched main have e4a0f55a329b866bd07c6e98ebb807215cf77d3b. GitHub confirms test(gateway): isolate child retention from provider discovery #152785 merged; it repairs fixture isolation and does not supersede worker sizing. (src/gateway/session-utils.child-cache-retention.test-support.ts, c30f2063c254)
  • Release comparison: The supplied latest release, v2026.9.5, retains the previous memory tiers and lacks the new CI-specific six/eight-worker admission. (scripts/lib/vitest-local-scheduling.mts:159, ec9c1a13db89)
  • Area history and routing: Current-main history connects Peter Steinberger to Gateway exclusivity and compact worker policy, and Vincent Koc to process-memory-aware scheduling. GitHub commit metadata verifies the handles steipete and vincentkoc. Some older local history objects were unavailable, so no feature-introduction attribution is asserted. (scripts/lib/vitest-local-scheduling.mts, 533698353132)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record preparation validation of the combined candidate containing the merged retention-fixture repair.

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-19T12:52:23.614Z sha 82535d4 :: blocked before merge. :: none

@steipete
steipete merged commit f6d3da2 into main Sep 19, 2026
250 of 253 checks passed
@steipete
steipete deleted the ci-burden/h2-worker-sizing branch September 19, 2026 13:37
@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 20, 2026
)

Use measured CI-only six/eight-worker memory tiers for roomy serial self-hosted jobs. Retain local behavior, actual-host fallback limits, Gateway exclusivity, unproven group caps, and historical timing floors. The twelve predefined Blacksmith probe samples passed; native PR CI remains a separate validation step.
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: L 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