Skip to content

Commit a6cc62f

Browse files
authored
ci: split Control UI E2E into 13 shards so it stops setting the wall (#131257)
* ci: split Control UI E2E into 13 shards so it stops setting the wall checks-ui-e2e is the tallest CI job on main (387s worst observed). Its shard imbalance is not a packing problem: measured across runs 33116963478, 33117411412, and 33117811987, control-UI shard bodies span 1.25-1.27x, and leave-one-run-out cross-validation shows hinting all 286 files gains ~13s at 11 shards and ~0-7s at 13-14, because per-file run-to-run noise (p50 16%, p90 40%) swamps the residual prediction error. What dominates is a fixed per-shard floor of 116s median / 143s p90 (checkout, pnpm install, Vitest transform) that no packing change can touch. That floor varies randomly per job rather than per shard, so the packer must not model it -- a constant added to every bucket never changes greedy LPT's choice -- but it does set the shard count. Raise the hosted/hybrid matrix from 12 to 14 rows (13 control-UI shards plus the browser-extension row) and match max-parallel so the extra rows do not queue. Replaying each run's real per-file times through the packer moves the tallest shard body from 229/218/219s to 179/183/179s, modelling the tallest row at 4:52 p50 and 5:20 p90 against 5:28/5:56. Two extra registrations per run against a 6000/5min operating target. Also correct the sequencer comment, which pointed the next maintainer at the hint refresh that measurably does not pay, and record the floor-based sizing rationale in docs/ci.md. Note: this takes checks-ui-e2e off the critical path but does not reach a 5:00 wall on its own -- checks-node-compact-small-11 (297-367s) and checks-ui (276-331s) set a 5:42-6:32 floor behind it. * docs(ci): correct the remaining eleven-shard Control UI E2E reference The planner-descriptor paragraph still described the hosted and hybrid profiles as eleven Vitest shards plus one browser-extension shard, which was accurate for the previous 12-row matrix and contradicts the 14-row plan in the same document. Found by ClawSweeper review of #131257.
1 parent cc68715 commit a6cc62f

4 files changed

Lines changed: 30 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,12 @@ jobs:
747747
const runnerProfile = process.env.OPENCLAW_CI_RUNNER_PROFILE ?? "blacksmith";
748748
const usesHostedRunnerProfile =
749749
runnerProfile === "github" || runnerProfile === "hybrid";
750-
const uiE2eShardCount = usesHostedRunnerProfile ? 12 : 4;
750+
// Control UI E2E is serial Chromium work: 2114s of measured body plus a
751+
// ~116s median per-shard floor (checkout, pnpm install, Vitest transform)
752+
// that every added row pays again. Sharding is the only lever on the
753+
// tallest row -- duration-weighted packing already lands within ~10% of
754+
// ideal -- so the count is set from that floor, not from packing slack.
755+
const uiE2eShardCount = usesHostedRunnerProfile ? 14 : 4;
751756
const qaSmokeCiPartCount = usesHostedRunnerProfile ? 6 : 4;
752757
const supportsNativeI18n =
753758
hasPackageScript("native:i18n:check") &&
@@ -1826,7 +1831,7 @@ jobs:
18261831
OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY: "1"
18271832
strategy:
18281833
fail-fast: false
1829-
max-parallel: ${{ (needs.preflight.outputs.runner_profile == 'github' || needs.preflight.outputs.runner_profile == 'hybrid') && 12 || 4 }}
1834+
max-parallel: ${{ (needs.preflight.outputs.runner_profile == 'github' || needs.preflight.outputs.runner_profile == 'hybrid') && 14 || 4 }}
18301835
matrix: ${{ fromJson(needs.preflight.outputs.ui_e2e_matrix) }}
18311836
steps:
18321837
- *linux_node_checkout_step

‎docs/ci.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The repository variable `OPENCLAW_CI_RUNNER_BACKEND` controls the runner backend
233233
| `github` | GitHub-hosted | GitHub-hosted | Every configurable job remains hosted |
234234
| `hybrid` | Selected critical-path plateaus use Blacksmith on attempt 1; remaining light lanes stay hosted | Blacksmith on attempt 1; GitHub-hosted on `github.run_attempt > 1` | Rerunning a failed or stuck Blacksmith job automatically moves it to hosted capacity |
235235

236-
Heavy lanes are `build-artifacts`, `check-sqlite-session-lifecycle`, `android`, `macos-node`, `macos-swift`, `ios-build`, and `ios-screenshot-shard`. Hybrid also sends the compact Node matrix, up to 96 rows, twelve-row hosted-planner `checks-ui-e2e` matrix, the `checks-ui-e2e-real-gateway` lane that shares its serial Chromium workload, six-row QA Smoke matrix, the two-part Windows matrix, `checks-ui`, `check-lint`, `check-test-types`, the five `check-test-types-core-*` stripes, `check-dependencies`, `check-additional-extension-package-boundary`, `check-additional-runtime-topology-architecture`, and `report-plugin-sdk-api-diff` to Blacksmith on attempt 1. Compact-small rows use `blacksmith-4vcpu-ubuntu-2404`, compact-large rows use `blacksmith-8vcpu-ubuntu-2404`, and the planner's measured small queue-tail promotions retain their 8-vCPU labels. Every other configurable `ci.yml` lane stays hosted in hybrid, including preflight, the five core-lint stripes, the remaining lint/check rows, docs, and Python skills. Separate Opengrep workflows remain GitHub-hosted.
236+
Heavy lanes are `build-artifacts`, `check-sqlite-session-lifecycle`, `android`, `macos-node`, `macos-swift`, `ios-build`, and `ios-screenshot-shard`. Hybrid also sends the compact Node matrix, up to 96 rows, fourteen-row hosted-planner `checks-ui-e2e` matrix, the `checks-ui-e2e-real-gateway` lane that shares its serial Chromium workload, six-row QA Smoke matrix, the two-part Windows matrix, `checks-ui`, `check-lint`, `check-test-types`, the five `check-test-types-core-*` stripes, `check-dependencies`, `check-additional-extension-package-boundary`, `check-additional-runtime-topology-architecture`, and `report-plugin-sdk-api-diff` to Blacksmith on attempt 1. Compact-small rows use `blacksmith-4vcpu-ubuntu-2404`, compact-large rows use `blacksmith-8vcpu-ubuntu-2404`, and the planner's measured small queue-tail promotions retain their 8-vCPU labels. Every other configurable `ci.yml` lane stays hosted in hybrid, including preflight, the five core-lint stripes, the remaining lint/check rows, docs, and Python skills. Separate Opengrep workflows remain GitHub-hosted.
237237

238238
Hybrid is the normal degraded-capacity mode. If Blacksmith is down: rerun the failed or stuck heavy job; it lands on hosted automatically. During a full Blacksmith outage, `github` remains the repository-wide circuit breaker:
239239

@@ -245,7 +245,7 @@ Hosted paths use the same setup exercised by manual dispatches and fork pull req
245245

246246
The compact Node planner keeps separate Blacksmith and standard 4-core hosted timing ownership. The `github` profile targets 90/95 seconds of serial group work for the hosted large/small source runner classes and applies a 1.6x median scaling fallback only to unmeasured groups. Hybrid keeps the expanded topology and hosted-derived splitting for groups above the unchanged 150-second ceiling, so hosted retries do not inherit an indivisible hosted wall pole. Its attempt-1 packing scales the Blacksmith hints by 0.87: the unscaled all-Blacksmith push plan totals 4,723 predicted seconds, while complete Blacksmith runs `31945998653` and `31949756966` measured 3,742.046 and 3,756.674 seconds of shard work (79.230% and 79.540%). The 0.87 factor is 9.379% above the higher observed ratio. With the direct outlier hints below, 0.85 yields 45 nondist jobs and 0.86 is the first two-decimal factor yielding 46; 0.87 stays one point above that rounding cliff while preserving the 46-job plan. Direct sampled hints cover the doctor and cron-service outliers, while a 140-second floor and singleton bin protect the observed `agentic-gateway-core-3` tail. During rebalance, native hybrid groups use scaled Blacksmith stripe hints; only synthesized hosted stripes retain their divided parent weight. Failed and timeout-and-retry samples are excluded from refreshes. Whole-config groups with registered file listers (agent support, gateway methods, runtime config, isolated unit fast) split into file-weighted hosted stripes. The hosted agent-chat split also carries direct successful-run hints for its two longest files so they cannot land in the same stripe. The subprocess-heavy tooling family uses seven balanced stripes projecting to roughly 115 hosted seconds per stripe.
247247

248-
The `github` profile contains 70 push descriptors and 79 pull-request fallback descriptors, with every nondist lane at or below 149 predicted test seconds; the serial TUI PTY dist descriptor keeps its indivisible measured wall. Hybrid contains 47 push descriptors (46 nondist jobs) and 55 pull-request fallback descriptors (53 nondist jobs), with a 140-second predicted maximum. In `github` mode compact jobs run hosted; hybrid attempt 1 uses each row's 4-vCPU or 8-vCPU Blacksmith label, while hybrid retries use hosted runners. The corresponding all-Blacksmith plans contain 25 and 34 total descriptors. Control UI E2E expands from the unchanged all-Blacksmith shape of three Vitest shards plus one browser-extension shard to eleven Vitest shards plus one browser-extension shard for the `github` and `hybrid` planner profiles. QA Smoke similarly expands from four parts to six. Hybrid attempt 1 runs those expanded matrices on Blacksmith; `github` mode and hybrid retries use hosted runners. QA's planner reserves the final part's observed roughly two-minute Matrix rider before greedily assigning primary scenarios, keeping that separate run from becoming the tail. Windows runs two jobs with disjoint, project-aligned explicit test lists on every backend. This partitions the complete Windows-specific inventory without applying Vitest `--shard` to project-local single-file selections, which Vitest rejects. The split width is pinned to two because `blacksmith-8vcpu-windows-2025` admits exactly two concurrent jobs (measured on run 31865243804): a third part queues behind a finished one, while a single lane serialized the whole 226-second body onto the wall and made Windows the slowest job in every run that scheduled it. The two parts are balanced by measured per-project wall time at roughly 108 and 112 seconds. A hybrid retry reruns both parts on hosted `windows-2025`, slower but bounded. Expect slower individual builds on standard 4-core hosted runners. Blacksmith's runner-registration budget is irrelevant for hosted jobs, but GitHub-hosted concurrency limits apply.
248+
The `github` profile contains 70 push descriptors and 79 pull-request fallback descriptors, with every nondist lane at or below 149 predicted test seconds; the serial TUI PTY dist descriptor keeps its indivisible measured wall. Hybrid contains 47 push descriptors (46 nondist jobs) and 55 pull-request fallback descriptors (53 nondist jobs), with a 140-second predicted maximum. In `github` mode compact jobs run hosted; hybrid attempt 1 uses each row's 4-vCPU or 8-vCPU Blacksmith label, while hybrid retries use hosted runners. The corresponding all-Blacksmith plans contain 25 and 34 total descriptors. Control UI E2E expands from the unchanged all-Blacksmith shape of three Vitest shards plus one browser-extension shard to thirteen Vitest shards plus one browser-extension shard for the `github` and `hybrid` planner profiles. QA Smoke similarly expands from four parts to six. Hybrid attempt 1 runs those expanded matrices on Blacksmith; `github` mode and hybrid retries use hosted runners. QA's planner reserves the final part's observed roughly two-minute Matrix rider before greedily assigning primary scenarios, keeping that separate run from becoming the tail. Windows runs two jobs with disjoint, project-aligned explicit test lists on every backend. This partitions the complete Windows-specific inventory without applying Vitest `--shard` to project-local single-file selections, which Vitest rejects. The split width is pinned to two because `blacksmith-8vcpu-windows-2025` admits exactly two concurrent jobs (measured on run 31865243804): a third part queues behind a finished one, while a single lane serialized the whole 226-second body onto the wall and made Windows the slowest job in every run that scheduled it. The two parts are balanced by measured per-project wall time at roughly 108 and 112 seconds. A hybrid retry reruns both parts on hosted `windows-2025`, slower but bounded. Expect slower individual builds on standard 4-core hosted runners. Blacksmith's runner-registration budget is irrelevant for hosted jobs, but GitHub-hosted concurrency limits apply.
249249

250250
Restore all-Blacksmith routing after an outage by deleting the variable:
251251

@@ -273,7 +273,9 @@ target below about 60% of the live bucket. With the current 10,000-registration
273273
bucket, that means a 6,000-registration operating target, leaving headroom for
274274
concurrent repositories, retries, and burst overlap.
275275

276-
The changed-target PR plan reduces the common Node test burst from 29 Blacksmith registrations to one. Broad-risk all-Blacksmith PRs keep the 32-registration metadata-complete compact fallback; canonical all-Blacksmith pushes use 24 nondist compact registrations. Hybrid currently uses 53 nondist fallback rows and 46 nondist push rows. The `github` and `hybrid` planner profiles remain capped at 96 compact rows; `github` rows are hosted, while hybrid rows consume Blacksmith registrations on attempt 1 and move to hosted capacity on retries. Screenshot-risk runs add at most two Blacksmith registrations. Even the 96-row cap plus roughly 27 other Blacksmith lanes is about 123 registrations per full run, or 492 for four admitted runs in a five-minute window, far below the 6,000-registration operating target.
276+
The changed-target PR plan reduces the common Node test burst from 29 Blacksmith registrations to one. Broad-risk all-Blacksmith PRs keep the 32-registration metadata-complete compact fallback; canonical all-Blacksmith pushes use 24 nondist compact registrations. Hybrid currently uses 53 nondist fallback rows and 46 nondist push rows. The `github` and `hybrid` planner profiles remain capped at 96 compact rows; `github` rows are hosted, while hybrid rows consume Blacksmith registrations on attempt 1 and move to hosted capacity on retries. Screenshot-risk runs add at most two Blacksmith registrations. Even the 96-row cap plus roughly 29 other Blacksmith lanes is about 125 registrations per full run, or 500 for four admitted runs in a five-minute window, far below the 6,000-registration operating target.
277+
278+
`checks-ui-e2e` is sized against its per-shard floor rather than its packing slack. The lane is serial Chromium work: roughly 2,114s of measured test body across 286 control-UI files, and a median 116s that every row pays before and around that body (about 25s checkout, about 44s Node setup dominated by `pnpm install`, about 27s of Vitest transform/import, with a p90 of 143s). Duration-weighted packing already lands the tallest row within about 10% of ideal on held-out runs, so the tallest row falls only by splitting the body further. The hosted-planner count is 14 rows — 13 control-UI shards plus the browser-extension row — which models to a 4:52 median and 5:20 p90 tallest row against 5:28/5:56 at the previous twelve. Two extra registrations per run is negligible against the operating target; the fixed floor, not the bucket, is what bounds further splitting.
277279

278280
Canonical-repo CI keeps Blacksmith as the default runner path for pushes and first-attempt same-repo pull-request runs when the backend is unset or `blacksmith`. Hybrid keeps the heavy set plus the named critical-path plateau lanes on Blacksmith for attempt 1; other light lanes and every rerun Blacksmith lane use GitHub-hosted capacity. Pull-request retries of both UI E2E jobs use GitHub-hosted Ubuntu in every mode; push retries remain on their normal backend unless hybrid fallback applies. All `workflow_dispatch` runs, including `release_gate`, and non-canonical repository runs use GitHub-hosted runners. The [`github` backend](#runner-backend-modes) provides a manual repository-wide fallback; canonical runs do not probe Blacksmith queue health or mutate the variable automatically.
279281

‎test/scripts/ci-workflow-guards.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,7 +3624,7 @@ NODE
36243624
expect(
36253625
JSON.parse(expectDefined(dispatchManifest.outputs.ui_e2e_matrix, "dispatch UI E2E matrix"))
36263626
.include,
3627-
).toHaveLength(12);
3627+
).toHaveLength(14);
36283628
expect(
36293629
JSON.parse(
36303630
expectDefined(dispatchManifest.outputs.qa_smoke_ci_matrix, "dispatch QA smoke matrix"),
@@ -7805,7 +7805,7 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
78057805
expect(uiE2e.env).toEqual({ OPENCLAW_UI_E2E_SKIP_REAL_GATEWAY: "1" });
78067806
expect(uiE2e.strategy["fail-fast"]).toBe(false);
78077807
expect(uiE2e.strategy["max-parallel"]).toBe(
7808-
"${{ (needs.preflight.outputs.runner_profile == 'github' || needs.preflight.outputs.runner_profile == 'hybrid') && 12 || 4 }}",
7808+
"${{ (needs.preflight.outputs.runner_profile == 'github' || needs.preflight.outputs.runner_profile == 'hybrid') && 14 || 4 }}",
78097809
);
78107810
expect(uiE2e.strategy.matrix).toBe("${{ fromJson(needs.preflight.outputs.ui_e2e_matrix) }}");
78117811
const expectedUiE2eMatrix = (shardCount: number) => ({
@@ -7821,8 +7821,8 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}"
78217821
});
78227822
for (const [runnerBackend, shardCount] of [
78237823
["blacksmith", 4],
7824-
["github", 12],
7825-
["hybrid", 12],
7824+
["github", 14],
7825+
["hybrid", 14],
78267826
] as const) {
78277827
const manifest = runCiManifestFixture({
78287828
bundledPlanner: true,

‎test/vitest/vitest.ui-e2e.sequencer.ts‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ import { basename } from "node:path";
55
import { BaseSequencer, type TestSpecification } from "vitest/node";
66

77
// Measured wall seconds per file, medianed over the checks-ui-e2e job logs of
8-
// CI runs 33063115103 and 33055390669 (2026-08-27). The suite grew from 247 to
9-
// 281 files and from 1430s to 2422s of body since the previous fit, and every
10-
// prior hint had drifted 1.5-1.9x low, so the table is regenerated rather than
11-
// patched. The 80 slowest files are listed because they carry the tallest
12-
// shard; the ~4s median file is interchangeable and rides the byte proxy below.
13-
// Source bytes alone correlate at r=0.79 with duration and mispredict by up to
14-
// 3.6x, so proxying everything leaves the widest shard well above ideal.
8+
// CI runs 33063115103 and 33055390669 (2026-08-27). Only the slowest files are
9+
// listed, and deliberately so: they carry the tallest shard, while the ~4s
10+
// median file is interchangeable and rides the byte proxy below.
11+
//
12+
// Listing every file does not pay. Cross-validated over runs 33116963478,
13+
// 33117411412, and 33117811987 (weights fit on two runs, shards scored on the
14+
// held-out third), a full 286-file table beat this one by ~13s on the tallest
15+
// shard at 11 shards and by ~0-7s at 13-14, because per-file run-to-run noise
16+
// (p50 16%, p90 40%) swamps the remaining prediction error. Dropping the hints
17+
// entirely does cost real time -- bytes alone correlate at r=0.79, mispredict
18+
// by up to 3.6x, and push the tallest shard from ~222s to ~259s at 11 shards --
19+
// so keep this table sized to the slow tail and re-measure it when that tail
20+
// shifts. The tallest shard is bounded by shard count and the ~116s per-shard
21+
// job floor, not by this map; see the `checks-ui-e2e` note in docs/ci.md.
1522
// Refresh by summing `<file> (n tests) <ms>` per file across two runs' logs.
1623
const UI_E2E_FILE_SECONDS_HINTS = new Map<string, number>([
1724
["activity-run-inspector.e2e.test.ts", 23],

0 commit comments

Comments
 (0)