Skip to content

perf(ci): bound test jobs with measured build and runtime costs - #134096

Closed
steipete wants to merge 14 commits into
codex/ci-windows-runtime-20260831from
codex/ci-measured-admission-20260831
Closed

steipete wants to merge 14 commits into
codex/ci-windows-runtime-20260831from
codex/ci-measured-admission-20260831

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Seven tooling stripes consumed 2,412 seconds of observed serial work, with individual walls up to 641 seconds. Repeated 115-second hints hid that imbalance. Compact admission also omitted shared runtime preparation, copied build ownership onto unrelated hosted children, could emit empty selections interpreted as complete configs, and ran a second packing pass that could invalidate its own admission cap.

Single-config plugin jobs had a separate metadata mismatch: each executes one outer plan and serial inner processes, but 66 of 67 rows omitted the serial declaration. The existing CPU policy therefore reserved capacity for overlapping processes that cannot exist.

The shared plugin catch-all remained one 468-file job, taking 528–829 seconds of test execution on the observed two-CPU runners. The process-heavy Performance Git lifecycle file also serialized 105 independent repository/process fixtures, creating a 244-second native file floor.

Why This Change Was Made

Use sixteen file-weighted tooling stripes with successful-run measurements including imports and setup. Prepare prerequisite facts once and charge the strongest shared build once per job. Expand composite groups before one packing pass and preserve sibling separation there; remove the unconstrained second pass. Hosted children keep nonempty, complete file partitions and derive build ownership from their actual consumers. Direct measurements remain authoritative, and indivisible files retain truthful estimates.

Declare every one-config plugin row serial at its producer. Remove the redundant Memory Core-only branch and carried root data; multi-target jobs retain their separate serialization rule. No execution path or worker-budget formula is added.

Use Vitest's native sharding for the catch-all, with job count derived from the existing file-budget owner. The complete config continues to discover and exclude files; the counting inventory never narrows execution to the changed plugin. Forward the existing per-group Vitest argument field at the runner owner while preserving global flags and preventing leakage into siblings. Six jobs retain the existing worker and isolation policies.

Run at most two independent Performance Git lifecycle cases concurrently through the same Vitest seam as the sibling Git-owner suite. Each case owns its copied repository, environment, process group, lease and sentinel; template cleanup and configuration reset follow joined cases. Assertions, deadlines and scenario bodies are unchanged.

User Impact

The same test inventory, process isolation and deadlines, with better work estimates and truthful CPU ownership. The hybrid compact budget remains 96; hosted-only plans permit 112 rows with the existing 96 concurrent-job limit. No new configuration, environment option, dependency, runner label, workflow concurrency, runtime or storage behavior.

This PR is temporarily stacked on #134038 to inherit its verified startup, lint and fixture repairs. Its previous CI failed on the older media and prompt fixtures, so the new base addresses concrete failures. It will target main after the parent lands.

Evidence

The original empty-child, leaked-prerequisite and post-admission-cap reproductions fail before repair. The rebased planner passes all 50 admission/planner owner cases. The serial-config regression fails on the original producer; parent integration passes 150 changed-plan, shard-execution and build-admission cases. Script/root-test types, formatting, script lint and all changed-file gates pass. Independent Codex reviews are clean at the configured blocking threshold.

The serial correction alone preserves all 67 rows and 26 config identities, including 23 whole-config rows and 44 rows with 558 ordered include entries. Removing only the concurrency field yields byte-identical plans and adds zero registrations. Executing the unchanged workflow policy gives 2/3/4/6 workers for serial jobs on 2/4/8/16 detected CPUs; potentially overlapping jobs remain capped at two. Actual recent x64 Blacksmith logs report two CPUs even for four/eight-CPU labels, including the retained baseline. This patch retains two workers on those machines; allocation and real wall-time gains remain separate questions.

Catch-all producer→runner→test-projects→native Vitest proof preserves all 468 effective files in six disjoint 78-file partitions. Direct-plugin and core-driven changes use the same complete config. Real discovery covers untracked/new-root, hidden, symlink, nested-dist, deleted and excluded paths. All 66 sibling execution plans remain unchanged apart from row names shifting after insertion. The 482 counting entries include live/E2E files that Vitest correctly excludes; that inventory sizes jobs only. The producer and argument-forwarding regressions fail before repair.

Lifecycle A/B proof passes all 105 scenarios, with identical 1,524 cleanup-boundary receipts and 2,473 process records. Local tests take 333.85→162.94 seconds; command wall takes 338.96→167.42. A sampler observes at most two fixture roots and none afterward, all sentinels survive, and every release reports no descendants. Vitest's actual limiter/join/cleanup source was inspected. This is a local concurrency measurement, not native Linux or whole-workflow timing.

The six-profile planner proof preserves complete file/config/environment/dist multisets, with no duplicates, empty selections, protected-family collisions or multi-group cap violations. The retained ecd142c plan had PR rows 46/74/108 and push rows 28/57/80 for Blacksmith/hybrid/hosted. Its maximum predicted PR work was 276/169/310 seconds; the 310-second hosted singleton is a measured file floor, not a five-minute workflow claim. Replaying successful file intervals produces a tallest hybrid tooling job of 193.264 seconds versus 511.030 for the previous partition. These are predictions/replays, not fresh elapsed CI measurements.

Preparing per-file facts avoids the initial candidate's repeated discovery: local import medians 3.907 seconds on baseline, 9.963 in the initial candidate, and 4.167 after preparation, with identical emitted assignments. Direct runner-specific timings still win over fallback hints.

Capacity accounting includes separately appended plugin fallback rows and control jobs. Replacing one catch-all row with six increases plugin fallback rows from 67 to 72. The conservative hybrid bound is 96 compact +72 plugin +52 other jobs =220 registrations per broad PR, with 148 per main wave. Four main waves and fourteen observed PR arrivals give 3,672 against the 6,000 operating target, up 70 with 2,328 remaining. This is an observed arrival envelope, not an organization-wide admission cap or proof of physical CPU capacity. The hosted cap change adds no Blacksmith registrations. The repository backend remains externally configured; this PR does not change it.

Final integration passes 459 tests across seven planner, runner, plugin-boundary, build-admission and lifecycle owners. Full script/root-test type checks, lint and the changed-file gate pass; the final Codex review is clean. An initial test invocation stopped before execution because it named a nonexistent owner-test filename; the corrected owner set passed in full.

CI tooling +218/−165 (net +53); tests/support +271/−25 (net +246); docs +11/−7 (net +4); product runtime zero. Tooling growth owns shared build-cost admission, prepared file facts and native catch-all job partitioning after removing duplicate packing. The lifecycle change adds only test scheduling metadata. No changelog is required for internal CI.

Review follow-through

The latest ClawSweeper finding is fixed: docs consistently say sixteen tooling stripes and no longer claim an unchanged job count. The rebase preserves #134038's newer control/plugin registration accounting and its Gateway lint/type repairs. Fresh review is requested for the native catch-all and bounded lifecycle changes. Fresh exact-head CI and final main-target validation remain required; no prior failed run is being reused as a green gate. The parent's current run is delayed in trusted-harness checkout, with matching local Git transport stalls; those observations are not attributed to test execution or treated as a confirmed global incident.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:14 PM ET / 16:14 UTC.

ClawSweeper review

What this changes

The PR updates CI test planning to charge shared build work, partition slow test groups, and serialize single-plan extension jobs.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No concrete introduced defect was found, but this protected maintainer PR changes CI admission and is still awaiting exact-head matrix completion.

Priority: P3
Reviewed head: 5ccb789f131c5d35e1f2c1608af3d6bd6ca4523f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) No source-proven correctness defect was found, with exact-head CI still needed to confirm the changed automation topology.
Proof confidence 🌊 off-meta tidepool Not applicable: This internal CI change is protected for maintainer handling; the supplied repository state identifies its author as a MEMBER, so the external-contributor real-behavior-proof gate does not apply. The PR body nevertheless records focused local planner and lifecycle evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This internal CI change is protected for maintainer handling; the supplied repository state identifies its author as a MEMBER, so the external-contributor real-behavior-proof gate does not apply. The PR body nevertheless records focused local planner and lifecycle evidence.
Evidence reviewed 8 items Workflow consumer: The CI workflow projects planner fields including groups, environment, build mode, and plan concurrency into the Node-test matrix; its worker policy gives serial plans the full detected-core budget.
Scoped catch-all partition: The changed-extension planner creates native Vitest shard arguments for the catch-all while leaving discovery and exclusions with the complete extension config.
Argument isolation: The shard runner combines global and per-group Vitest arguments only for the current group before creating the child environment.
Findings None None.
Security None None.

How this fits together

The CI planner converts repository changes into test-job descriptors, and the shard runner launches each descriptor’s Vitest process. This PR changes the estimates, partitions, and worker-budget metadata that control that handoff.

flowchart LR
  A[Repository change] --> B[CI test planner]
  B --> C[Compact job packing]
  B --> D[Extension test partitions]
  C --> E[CI job matrix]
  D --> E
  E --> F[Shard runner]
  F --> G[Vitest processes]
Loading

Decision needed

Question Recommendation
Should this CI-topology change proceed after the exact-head matrix confirms the planned extension partitions and compact jobs complete successfully? Validate then proceed: Wait for the exact-head CI matrix and confirm the shard topology completes with its intended coverage before merging.

Why: The patch changes automation capacity and coverage partitioning, and the PR carries the protected maintainer label while its fresh validation is incomplete.

Before merge

  • Resolve merge risk (P1) - The revised planner expands and repartitions CI work, while the exact-head job matrix remains in progress; a matrix or coverage regression would affect automation rather than product runtime.
  • Resolve merge risk (P1) - Direct inspection of the installed Vitest contract and a complete current-main comparison was unavailable in this partial clone, so native sharding semantics remain a maintainer-visible verification gap.
Agent review details

Security

None.

PR surface

Tests +246, Docs +4, Other +53. Total +303 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 271 25 +246
Docs 2 11 7 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 5 218 165 +53
Total 12 500 197 +303

Review metrics

Metric Value Why it matters
Production versus test LOC CI tooling +218/-165 (net +53); tests/support +271/-25 (net +246) The production growth is confined to CI planning and runner ownership, with focused regression coverage for the added admission and partitioning behavior.

Stored data model

Persistent data-model change detected: serialized state: scripts/ci-run-node-test-shard.mts, unknown-data-model-change: scripts/ci-run-node-test-shard.mts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the exact-head matrix (recommended)
    Confirm the current head runs the planned compact and extension partitions successfully before accepting the CI scheduling change.
  2. Pause for contract verification
    Hold the CI-topology change if native Vitest sharding behavior cannot be verified against the pinned dependency before merge.

Technical review

Best possible solution:

Retain the existing planner and runner ownership, then accept the new topology only after the exact head completes and confirms all native catch-all shards preserve the intended inventory.

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

Not applicable: this is an internal CI scheduling change rather than a user-reported product failure.

Is this the best way to solve the issue?

Unclear: the implementation stays within the existing planner, config, and runner boundaries, but direct inspection of the pinned Vitest contract was unavailable and fresh exact-head CI is not complete.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9cc05cca83e2.

Labels

Label justifications:

  • P3: This is internal CI scheduling and performance work, with no direct product-runtime behavior change.
  • merge-risk: 🚨 automation: The patch changes generated CI job partitions, worker budgets, and shard invocation arguments.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This internal CI change is protected for maintainer handling; the supplied repository state identifies its author as a MEMBER, so the external-contributor real-behavior-proof gate does not apply. The PR body nevertheless records focused local planner and lifecycle evidence.

Evidence

What I checked:

Likely related people:

  • steipete: 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.

  • Let the exact-head CI matrix complete and verify the planned compact and extension shards preserve coverage.

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 (3 earlier review cycles)
  • reviewed 2026-08-31T12:26:14.152Z sha ecd142c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-31T12:48:24.445Z sha ecd142c :: found issues before merge. :: [P3] Correct the stale tooling-stripe documentation
  • reviewed 2026-08-31T15:28:01.143Z sha 4333fccca506d330ac1424081f366d37fcc5718e :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@steipete
steipete force-pushed the codex/ci-measured-admission-20260831 branch from ecd142c to 4333fcc Compare August 31, 2026 15:21
@steipete
steipete changed the base branch from main to codex/ci-windows-runtime-20260831 August 31, 2026 15:22
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The updated head repairs the requested sixteen-stripe documentation, inherits the common CI fixture/lint/startup fixes through #134038, and adds truthful serial-plan metadata for one-config plugin jobs. The body records exact inventory preservation, resource-policy proof, updated capacity accounting, parent tests and the remaining native/final-target gate.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 31, 2026
@steipete steipete changed the title perf(ci): account for tooling work and shared build prerequisites perf(ci): bound test jobs with measured build and runtime costs Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 5ccb789 retains the reviewed admission/serial-config repairs, rebased byte-identically onto the parent's Gateway validation fixes. It adds six native Vitest catch-all jobs preserving all 468 files and a two-case bound for the 105 independent Performance Git lifecycle scenarios. All 459 integrated owner tests, full script/test-root type checks, lint and the changed-file gate pass; Codex review is clean.

The body and docs record the complete plugin/control registration accounting: the observed burst estimate rises from 3,602 to 3,672 against the 6,000 target. Native timing and final main-target CI remain required. No prior failed run is reused as a green gate, and current Git transport stalls are recorded separately from execution performance.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the codex/ci-measured-admission-20260831 branch from 4333fcc to 5ccb789 Compare August 31, 2026 16:07
@steipete
steipete force-pushed the codex/ci-windows-runtime-20260831 branch 2 times, most recently from 767c47e to acbf9f0 Compare August 31, 2026 17:36
@steipete
steipete deleted the branch codex/ci-windows-runtime-20260831 August 31, 2026 20:32
@steipete steipete closed this Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Implemented through #134038, merged as 4ee565c6d2a, including complete workload planning and one-time runtime prerequisite admission. The integration preserves the connected main changes and removes the superseded duplicate paths.

Exact-head CI33434384581 completed successfully with all applicable Testboxes green. Both Windows jobs, all 16 UI jobs and the macOS Node job passed. The integration PR records the focused source-owner and regression proof, including the Windows readiness repair and trusted-wrapper merge checks. This source PR is superseded by that verified landing.

@RomneyDa
RomneyDa deleted the codex/ci-measured-admission-20260831 branch October 22, 2026 00:12
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 merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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