Skip to content

[CI] ci: restore five unit runners and prune source-only tests - #26437

Merged
nwparker merged 2 commits into
mainfrom
nwparker/ci-runner-capacity-five-shards
Oct 8, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/ci-runner-capacity-five-shards

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Use five runners for the full unit suite by default, leaving more room for other pull requests. Preserve the complete behavioral test suite while removing three source-string checks. The browser fixture acts on the frame it has actually loaded and refuses a missing or detached frame.

What Changed

The existing PR shard setting defaults to five instead of ten; its repository override still accepts either. Update the existing contract expectation and explanatory comment. Test selection, four workers per runner, isolation, six setup files, deadlines and protected Node routing stay unchanged.

The HTML-preview fixture passes its already-loaded frame to the original action instead of looking it up again. A missing or detached frame fails before the action. This changes no product code, security assertions, browser inputs or navigation deadlines, and adds no click listeners, CDP sessions or request observers.

Six files change on base 89ba968230d7e704b5754a43ef64fa7b91c6c84e; shipping head is 5e4ba04586948c30f23504cbfb73d4cb7265f32d. All 507 current protected Node patterns and the three newer Windows hook cases are retained.

Remove lazy-use-ref-ratchet.test.ts (one case) and prefill-extension-source.test.ts (two cases). The first uses a private source scanner rather than rendering React; the other two call the real generator but only inspect its output strings. This intentionally drops the global eager-useRef text rule and the Pi/OMP literal-source checks. The retained OMP VM test executes the generated handler and checks draft delivery; titlebar VM, installation, security and behavioral tests remain. Those companions do not establish equivalent standalone Pi startup-filter coverage. No replacement skips, no-ops or production changes are added.

Why

The goal is lower occupied runner time under the shared concurrency cap. Five shards reuse an existing supported mode and avoid five repeated setups. Keeping ten shards but limiting their overlap would retain ten setups. Historical five-shard feedback took longer, so occupancy and required-check latency must both be measured on the current head. This does not establish the 2× capacity goal.

Before / after evidence

The ten-shard run and five-shard run used equivalent named source definitions and the same 11,678-file workload. Every file enrolled once and reported module counts, statuses and runtime routes matched. They used separate hosts with different cache and queue states; individual case-title equality was not recorded.

Metric Ten shards Five shards Observed change
Unit runner-seconds 3,206 2,827 11.82% less
Main workflow runner-seconds 5,066 4,844 4.38% less
Run creation to required-check completion 541 s 813 s 50.28% longer
Unit matrix jobs 10 5 Five fewer

Three earlier same-source Bun command rounds also retained all first samples:

Round Ten: summed command seconds Five: summed command seconds
1 2,782.848 2,636.720
2 2,503.864 2,441.178
3 2,518.534 2,410.926

Those commands have overlapping workers and different warm-up/queue histories. Their sums omit job setup and are not whole-workflow occupancy or a loaded-fleet throughput measurement. Five-shard longest commands were roughly 1.83–1.92× longer with ample runners.

The original pre-Bun baseline already used five unit jobs: 3,018 unit runner-seconds and 4,470 across four attached validation workflows, with six cleanup seconds recorded separately. Restoring five addresses the doubled unit-job demand; neither that historical baseline nor newer, different workloads proves a current capacity gain.

Current full-CI before / after

Before: ten runners tested a tree identical to this PR's base. After: five runners tested the exact shipping tree. All four attached workflows passed. Every retained module has the same case count, status, skips and runtime route; the only removed inventory is the two approved modules / three text checks. Reports cover 11,867 files and 115,273 cases: 114,201 passed, three expected failures and 1,069 skips, with zero unhandled errors. Actual routes remain 10,708 Bun, 1,158 protected Node and one measurement file. Ordinary reports do not contain full individual case-title maps or worker-process samples.

Metric Before: ten After: five Observed change
Unit runner-seconds 3,341 3,037 9.10% less
Unit test-step seconds 2,932 2,804 4.37% less
Unit seconds outside testing 409 233 43.03% less
Configured unit runners 10 5 50% fewer
ARM runner-seconds across validation 4,441 3,843 13.47% less
All attached validation runner-seconds 5,805 5,558 4.25% less
Creation to required-check completion 751 s 814 s 8.39% longer
Longest unit test step 315 s 571 s 81.27% longer

These are changed-source observations on separate hosts, caches and queue conditions, not a controlled sharding-only or loaded-fleet gain. The six-file change includes the three retired text checks and the fixture boundary. The earlier separate Mobile workflow (346 seconds) is absent; the Pi test deletion instead triggers three existing native owner-verification jobs (224 seconds). Main's unchanged WebKit installation took 48 → 345 seconds, overlapping other setup; its render checks took 133 → 175 seconds. These steps do not receive the unit shard count, and their timing differences are retained rather than attributed to sharding. Unit creation-to-start delay fell 98 → 12 seconds, but that queue observation is not a demonstrated scheduling improvement.

This validation used 25 allocations / 33 declared jobs, one attempt each: main 5,302 seconds, Node detector 24, LoC eight and Pi verification 224. Runner pools: ARM Ubuntu 3,843; latest Ubuntu 1,169; Windows2022 317; WindowsLatest 104; macOSLatest 79; slim Ubuntu 46. Post-merge/main-push and cleanup work is outside this validation ledger. The matched earlier trial and current observation consistently favor lower unit occupancy, with longer isolated feedback. The 2× capacity goal remains unproven.

Fixture qualification and retained validation costs

Full browser qualification passed all 30 original cases in both before and candidate arms: 15 Chromium and 15 WebKit cases, exact duplicate-preserving title/ancestor/status maps, no filtered cases. The driver before/after bytes remain exact on the current base. The measured browser setup pinned Chromium 154.0.8037.57 and WebKit 26.6. Source teardown closes browsers; this is not independent proof of complete process-tree absence.

The earlier failure was not reproduced, so this establishes fixture compatibility and a source-proven missing-frame boundary, not the failure's cause, a flake fix or a speed gain. The current full CI passed; the original cause remains unproven.

Retained validation Occupied runner-seconds Result and scope
First five-shard main run 37731822096 4,799 Five unit jobs passed; unchanged Windows writer contract failed. Main workflow only.
Intermediate capture head 37735602314 6,865 All attached validation passed; different source and extra platform jobs. Capture is superseded by merged writer fix #26444.
Previous final head 37738260078 4,867 All attached work counted; units passed but mobile/browser job failed, leaving required CI red.
Windows diagnostic 37734518876 344 Same 61-file/601-case command passed without reproducing the failure; not a fix.
Browser version-gate diagnostic 37742582416 80 Failed before either test arm ran.
Instrumented browser diagnostic 37744282224 140 Selected 12 cases passed in each arm; observation collector rejected the evidence.
Full 30-case boundary qualification 37754586179 198 Both full arms passed; compatibility only.
Current shipping head 37786396086 and its attached workflows 5,558 All four workflows passed, including five full unit shards, mobile browser checks, packages and native Pi verification.

These differing workloads are validation costs, not a before/after fleet ratio. Queue time is separate, failed attempts remain counted, and this PR does not erase their conclusions. The current replacement combines the reviewed shard setting, the distinct qualified frame boundary and the explicit text-test removals; it is not an unchanged retry. The removed modules previously reported 140 ms and 45 ms including collection. Those descriptive values are not measured runner savings; no extra benchmark is added for them.

Linked Issue

N/A — maintainer-requested CI capacity correction; follows #26295 and incorporates the separately merged writer fix #26444.

Visual Proof

N/A — CI scheduling and browser-test fixture hardening; no product UI changes.

Testing

  • Manually tested locally — no local unit, browser or native runtime execution.
  • Existing shard-default contract updated; all retained callbacks and assertions unchanged; three text-policy cases explicitly removed.
  • Static lint, formatting, diff checks and normal commit hooks passed during integration.
  • Full CI on the current shipping head; all retained module counts, statuses, skips and routes match the previous ten-shard report.

Actual five-job enrollment, full reports, main browser checks, Linux/Windows packages and all selected platform/security checks passed. Real IME, WSL, separate headless platform lanes and changed-spec E2E were correctly unselected; no execution claim for them. Root checked that both shard-count and selection-mode repository variables were absent; CI enrolled all files in shadow/full fallback across five jobs. No new job, benchmark framework or cache warmer was added. The workflow edit intentionally selected the existing full policy checks once.

Review

Independent source review checked the four exact patch outputs and two whole-file deletions, all 53 scheduling/fixture guards and 15 deletion guards, current 507-pattern Node inventory, complete source recovery and preservation of upstream Windows cases. The only exact deleted-filename references found were historical timing weights; no required selector or reliability manifest referenced them. Existing raw browser and ordinary-run reviews are retained. CodeRabbit reviewed the shipping head with zero inline threads and one advisory to add a Pi prefill test. Its sample uses the status-extension harness, which loads prefill only for OMP (handler source); Pi's standalone prefill is installed separately (service). That sample could pass even if the standalone Pi guard broke, so it is declined as a wrong-owner negative control. The explicit loss of the old literal tripwire remains disclosed; equivalent standalone Pi behavioral coverage is not claimed. No replacement test or unchanged retry was added.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material copied.

Notes

macOS, Linux, Windows, SSH and folder-workspace contracts retain their existing routing and deadlines. This changes the hosted unit matrix default, a test fixture and three textual test policies; runtime and wire behavior are unchanged.

Checklist

  • Small focused change; mechanism, alternatives and before/after limits explained.
  • No product UI impact; visual proof marked N/A.
  • Source reviewed for correctness, security, platforms and runtime coverage.
  • Current full CI passes; before/after occupancy, longer feedback, all failed validation costs and bot advisory disposition are reported.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The full-unit shard default in the PR workflow changes from ten to five. Comments describe the five-shard default and note that a repository variable can request ten shards. The preflight test now expects a fallback value of five. The preview driver now rejects a missing or detached loaded frame and passes the loaded frame to the action. Two test files are removed: one for Pi prefill source behavior and one for renderer useRef initializer patterns.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 5e4ba

The current behavior is protected in the implementation, but the change removes the test that would catch a Pi prefill regression on reload. This is a narrow risk suitable for follow-up.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed No active directly linked issue remains. Linked issue #26444 is closed and supplies historical context only. Therefore, no linked-issue coding requirement applies to this pull request.
Out of Scope Changes check ✅ Passed The changed files match the current stated intent: reduce the default unit shard count, update its contract comments and test, harden the loaded-frame fixture, and remove the three source-only tests. …
Title check ✅ Passed The title clearly summarizes the two primary changes: restoring five unit runners and removing source-only tests.
Description check ✅ Passed The description is complete and detailed. It covers the change, rationale, testing, limitations, validation results, visual-proof status, review notes, platform considerations, and checklist. The Link…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker nwparker changed the title ci: reduce full PR unit runner occupancy with five shards ci: reduce unit runner demand and retain Windows writer timeout evidence Oct 8, 2026
@nwparker
nwparker force-pushed the nwparker/ci-runner-capacity-five-shards branch from 009406f to aedbf3b Compare October 8, 2026 06:33
@nwparker nwparker changed the title ci: reduce unit runner demand and retain Windows writer timeout evidence ci: reduce unit runner demand with five default shards Oct 8, 2026
@nwparker nwparker changed the title ci: reduce unit runner demand with five default shards ci: restore five unit runners and prune source-only tests Oct 8, 2026
@nwparker
nwparker force-pushed the nwparker/ci-runner-capacity-five-shards branch from aedbf3b to 5e4ba04 Compare October 8, 2026 13:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/pi/prefill-extension-source.ts (1)

28-31: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add behavioral coverage for the Pi startup-only prefill guard.

The deleted assertion was the only test targeting this guard. A focused test should invoke the Pi handler with { reason: 'reload' } and assert that the prefill remains set and setEditorText is not called.

Suggested fix
+++ b/src/main/pi/agent-status-extension-pi-prefill.test.ts
+import { expect, it, vi } from 'vitest'
+import { createAgentStatusExtensionHarness } from './agent-status-extension-test-harness'
+
+it('preserves a Pi prefill on a non-startup session_start', async () => {
+  const h = createAgentStatusExtensionHarness({
+    kind: 'pi',
+    env: { ORCA_PI_PREFILL: 'Draft' }
+  })
+  const setEditorText = vi.fn()
+
+  await h.callHook('session_start', { reason: 'reload' }, { ui: { setEditorText } })
+
+  expect(setEditorText).not.toHaveBeenCalled()
+  expect(h.processEnv.ORCA_PI_PREFILL).toBe('Draft')
+})

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8bc9562d-f410-44f7-92c8-2c28d08d552d
📥 Commits

Reviewing files that changed from the base of the PR and between aedbf3b and 5e4ba04.

📒 Files selected for processing (3)
  • config/scripts/mobile-web-app-preview-arm-driver.mjs
  • src/main/pi/prefill-extension-source.test.ts
  • src/renderer/src/lazy-use-ref-ratchet.test.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/lazy-use-ref-ratchet.test.ts
  • src/main/pi/prefill-extension-source.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@nwparker
nwparker merged commit 907cb6e into main Oct 8, 2026
33 checks passed
@nwparker nwparker changed the title ci: restore five unit runners and prune source-only tests [CI] ci: restore five unit runners and prune source-only tests Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant