Skip to content

perf(ci): balance Windows projects by selected test costs - #134279

Closed
steipete wants to merge 1 commit into
codex/ci-measured-admission-20260831from
codex/ci-windows-scheduling-20260831
Closed

steipete wants to merge 1 commit into
codex/ci-measured-admission-20260831from
codex/ci-windows-scheduling-20260831

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The two Windows test jobs have uneven project costs and execute selected projects one at a time. Whole-config weights also misprice small selections, leaving the longer job on CI's critical path.

Why This Change Was Made

Use the existing project concurrency of two on self-hosted Windows runners, while retaining one on the hosted fallback and one Vitest worker per project. Rebalance three complete files between the existing two jobs. Runtime preparation stays ahead of every reader, and the runner still joins admitted work before cleanup.

Selected projects use their recorded selection duration when available, otherwise the existing per-file estimates. Whole-config and glob selections retain their existing weights and ordering. Timing keys and file estimates move into one dependency-free metadata owner, so the preflight planner does not acquire persistence or runtime imports.

User Impact

The same 80 Windows files run in the same two jobs, with 32/48 files and 14/15 project invocations. There are no new jobs, configuration options, dependencies, deadlines or matrix concurrency limits. A Node resource receipt records OS-visible CPUs, affinity parallelism and memory; requested runner labels alone do not establish actual resource allocation.

Evidence

  • node --import ./scripts/tsx.mjs scripts/test-projects.mts test/scripts/test-projects.test.ts test/scripts/vitest-shard-timings.test.ts test/scripts/ci-node-test-plan.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/test-projects-build-admission.test.ts test/package-scripts.test.ts: 725 passed, two existing skips. Null/empty selection regression fails before its repair.
  • The complete changed-file gate passes, including script/root-test types, lint, format and package-lock validation. Canonical workflow checks and independent Codex review pass. The local gate first lacked npm on PATH; it passed using the existing Node 24 toolchain, with no install or dependency reconciliation.
  • Five real worker lifecycle cases and a two-project, one-worker-per-project smoke pass, preserving borrower lifetime and cleanup. Native workflow-expression checks cover both Windows tasks on hosted and self-hosted paths.
  • All six compact matrix outputs remain identical after metadata extraction: Blacksmith 46/28, GitHub 108/80 and hybrid 74/57. The Windows file hash inventory is unchanged and disjoint. The diagnostic command also runs on Node 22 and 24.

Runtime production is unchanged. Tooling scripts +165/-138 (net +27), workflow +8/-0, package scripts +2/-2, tests +99/-1, docs/skill +6/-1. The small tooling growth provides selection-aware ordering while sharing the existing timing facts without a heavyweight import closure.

This PR is stacked on #134096, which accounts for measured build/runtime costs and partitions the complete plugin catch-all. The projected Windows project phases are about 174/177 seconds on the retained timing sample; these are scheduling estimates, not native candidate measurements. Native Windows elapsed time and memory receipts remain required before landing. Whole CI below five minutes is not yet proven.

@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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 16:39
@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: 🐚 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 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:48 PM ET / 16:48 UTC.

ClawSweeper review

What this changes

The PR runs up to two selected Vitest projects concurrently on self-hosted Windows CI, keeps hosted fallbacks serial, and rebalances the two existing Windows test inventories using selection-aware costs.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review. The branch is not on current main, its scheduling and cleanup path is coherently bounded, and no introduced correctness defect was found; native self-hosted Windows evidence remains necessary before landing the concurrency increase.

Priority: P3
Reviewed head: 8fe551ab73bd568c1346a1f62c2c1153cf1c9df2
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused owner-boundary coverage and no source-proven correctness defect, with native Windows confirmation remaining the material merge-risk reducer.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate is not applicable; however, the production CI change still needs the native Windows receipts identified in the PR body before landing.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate is not applicable; however, the production CI change still needs the native Windows receipts identified in the PR body before landing.
Evidence reviewed 6 items Introduced workflow bound: The introduced workflow defaults project concurrency to one and selects two only for a self-hosted runner; the job-level Vitest worker cap remains one.
Runner lifecycle owner: The project runner finishes runtime preparation before creating workers or scheduling the explicitly parallel multi-config run, and then dispatches through the resolved bounded concurrency.
Selection-cost behavior coverage: New tests cover null and empty whole-config selections, expensive exact selections, and selection-specific observed timings so whole-config timing samples are not substituted.
Findings None None.
Security None None.

How this fits together

The Windows CI job dispatches two explicit test inventories to the project runner. The runner prepares shared runtime artifacts, orders selected projects by observed or estimated cost, then runs them under the workflow’s process and Vitest-worker limits.

flowchart LR
  A[Windows CI matrix] --> B[Runner environment]
  B --> C[Two test inventories]
  C --> D[Shared runtime preparation]
  D --> E[Cost-aware project ordering]
  E --> F[Bounded Vitest processes]
  F --> G[Joined cleanup and results]
Loading

Decision needed

Question Recommendation
Should this maintainer-authored Windows CI concurrency change land only after native self-hosted resource and cleanup evidence is recorded? Require native Windows proof: Rebase the stack as needed and land only after the intended self-hosted Windows class records two-project execution, resource information, and clean fixture teardown.

Why: Source and simulated workflow coverage establish the intended limits, but they cannot establish actual Windows runner allocation or concurrent fixture behavior.

Before merge

  • Resolve merge risk (P1) - The workflow guard simulates the runner classification and a stubbed package manager; supplied evidence does not yet show an actual self-hosted Windows run with two concurrent projects, resource output, fixture memory, and completed cleanup.
  • Resolve merge risk (P1) - This branch is stacked on the open parent perf(ci): bound test jobs with measured build and runtime costs #134096, while neither commit is on current main; landing still requires parent resolution and an exact-head refresh against main.
  • Complete next step (P2) - The remaining work is maintainer acceptance of native Windows capacity evidence and stack reconciliation, not a narrow automated repair.
Agent review details

Security

None.

PR surface

Tests +98, Docs +5, Config +8, Other +27. Total +138 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 99 1 +98
Docs 2 6 1 +5
Config 2 10 2 +8
Generated 0 0 0 0
Other 4 165 138 +27
Total 11 280 142 +138

Review metrics

Metric Value Why it matters
Production versus test delta CI tooling/workflow +175/−140; tests +99/−1; docs/skill +6/−1 The net production growth is confined to internal CI scheduling and metadata extraction; application runtime code is unchanged.

Stored data model

Persistent data-model change detected: migration/backfill/repair: package.json, serialized state: scripts/lib/vitest-shard-metadata.mts, serialized state: scripts/lib/vitest-shard-timings.mts, unknown-data-model-change: scripts/lib/vitest-shard-metadata.mts, unknown-data-model-change: scripts/lib/vitest-shard-timings.mts, vector/embedding metadata: scripts/lib/ci-node-test-plan.mts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the native self-hosted path before merge (recommended)
    Record an exact-head self-hosted Windows run proving environment detection, two concurrent project processes, resource receipt, and completed fixture cleanup after the parent stack is reconciled.

Technical review

Best possible solution:

After the parent stack is reconciled with main, retain the bounded self-hosted-only concurrency design and attach redacted native Windows receipts demonstrating actual classification, two-project execution, resource state, and cleanup.

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

Not applicable: this is an internal CI scheduling change, not a reported product bug. The relevant validation is an exact-head native Windows workflow run rather than a user reproduction.

Is this the best way to solve the issue?

Yes, conditionally: selection-aware ordering plus a self-hosted-only process cap reuses the existing runner and cleanup owners; native Windows evidence is still needed to validate the performance and capacity premise.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is an internal CI performance and scheduling improvement with no claimed product-runtime change.
  • add merge-risk: 🚨 automation: The PR changes GitHub Actions Windows execution parallelism and the test-project scheduling path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as maintainer-authored, so the external-contributor proof gate is not applicable; however, the production CI change still needs the native Windows receipts identified in the PR body before landing.

Label justifications:

  • P3: This is an internal CI performance and scheduling improvement with no claimed product-runtime change.
  • merge-risk: 🚨 automation: The PR changes GitHub Actions Windows execution parallelism and the test-project scheduling path.
  • 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: The repository state identifies this as maintainer-authored, so the external-contributor proof gate is not applicable; however, the production CI change still needs the native Windows receipts identified in the PR body before landing.

Evidence

What I checked:

  • Introduced workflow bound: The introduced workflow defaults project concurrency to one and selects two only for a self-hosted runner; the job-level Vitest worker cap remains one. (.github/workflows/ci.yml:3978, 8fe551ab73bd)
  • Runner lifecycle owner: The project runner finishes runtime preparation before creating workers or scheduling the explicitly parallel multi-config run, and then dispatches through the resolved bounded concurrency. (scripts/test-projects.mts:371, 8fe551ab73bd)
  • Selection-cost behavior coverage: New tests cover null and empty whole-config selections, expensive exact selections, and selection-specific observed timings so whole-config timing samples are not substituted. (test/scripts/test-projects.test.ts:3657, 8fe551ab73bd)
  • Verified introduced scope: The locally verified test merge has the pinned base and head as parents, and its changed-file set matches the PR-introduced surface. (1a6a1ee02110)
  • Current-main necessity check: Neither this head nor its stacked base is an ancestor of fetched current main; current main also lacks this workflow concurrency branch, so the PR is not implemented on main. (.github/workflows/ci.yml:3994, d01486f283cc)
  • Native-proof requirement: The changed CI documentation and PR body both distinguish requested runner labels from actual resources and require native Windows concurrency, memory, and cleanup receipts. Public docs: docs/ci.md. (docs/ci.md:447, 8fe551ab73bd)

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.

  • Attach redacted native self-hosted Windows output showing the resource receipt, two-project execution, and clean fixture teardown.
  • Reconcile the stacked parent with current main and refresh exact-head CI before merge.

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Implemented through #134038, merged as 4ee565c6d2a, including complete Windows inventory with cost-aware project 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.

@steipete steipete closed this Aug 31, 2026
@RomneyDa
RomneyDa deleted the codex/ci-windows-scheduling-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: 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