Skip to content

ci: the swizzle proof runs in four legs of two slices instead of eight legs of one - #12054

Closed
cixzhang wants to merge 1 commit into
mainfrom
ci/swizzle-proof-paired-legs
Closed

cixzhang wants to merge 1 commit into
mainfrom
ci/swizzle-proof-paired-legs

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Who this helps

Authors waiting on CI, and CI's budget. A pull request whose change proves a swizzle target runs the swizzle proof in legs of its own, beside the Node legs. Each leg pays about two minutes of checkout, setup and core build before it proves anything, and in the affected scope most slices then prove only a few targets in 15–110 s. Eight legs a run spend about 15 minutes of runner time on setup alone. On 11/15 the proof ran on 141 pull-request runs, 8 legs each: about 3.35 min a leg and about $16.5 a day, roughly half of it setup.

What changes

  • .github/workflows/ci.yml, the swizzle-proof job: four legs of two slices each instead of eight legs of one. Leg n runs swizzle-proof.<2n-1>.test.mjs and swizzle-proof.<2n>.test.mjs in one pnpm test:node call, so Vitest runs the pair side by side on the leg's runner. Its name is swizzle-proof (n/4), and the steps' names say "this leg's slices".
  • Admission's leg widths: the proof's full width is 4 (it was 8); the tight width stays 2.
  • Unchanged: the scope job and when the legs start (only when the change proves a target), what each slice proves, the shard watchdog and the 15-minute limit, the recorded-time check, the test join, and the slice files themselves.

Why a pair fits

The record keeps each slice's largest time; the largest is 348 s (swizzle-proof.1). Two slices run in parallel, so a leg takes about its slower slice plus setup: at most about 470 s against the 14-minute watchdog. A leg of four would approach the limit on a full-scope run, so the pairing stops at two.

Evidence

  • ci-swizzle-proof.test.mjs:
    • every slice file runs in exactly one leg, two to a leg, read from the leg's own command line;
    • each pair's largest recorded time plus two minutes of setup stays under the 14-minute limit;
    • admission's full width equals the number of legs;
    • the legs still run under the shard watchdog and check their recorded time.
  • 176 tests pass across ci-swizzle-proof, ci-admission, ci-test-join, ci-tooling-routing, vitest-shard-sequencer, vitest-node-legs and workflow-paths. With main's ci.yml, the 4 new or changed cases fail.
  • actionlint and prettier pass.

CI impact: on a run whose change proves a target, the proof uses four standard ubuntu-latest runners instead of eight, and four fewer jobs run at full width. Per run that saves about 4 × 110 s of setup, about 7 runner-minutes. At about 141 such runs a day, that is an estimated $4.6–6.6 a day, depending on how much the paired slices overlap. Time to green: about the same; the slowest leg gains at most the time of its second slice, and fewer legs wait for a runner.

Overlap check

Among open pull requests (also checked file by file on those with more than 100 files), only #8027 (native iOS screenshots, last updated 10/25 and already conflicting with main) also changes ci.yml, in its native jobs (around line 807), a different part of the file. No open pull request changes ci-swizzle-proof.test.mjs.

Overlap checked: #8027 (a different job in ci.yml: the native iOS screenshot jobs)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the shipper, through merge-guard.

…t legs of one

Each leg spends about two minutes on checkout, setup and the core build before it proves anything, more than most slices take in the affected scope. Two slices now share a leg and run side by side; a slice's largest recorded time keeps a pair well inside the leg's limit, and admission's full width for the proof follows the four legs.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 16, 2026 9:42am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 16, 2026, 9:53 AM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

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

Approved pending CI: CI has not run on this draft head yet, so mark the pull request ready for review to run it. No blocking findings: the new leg-shape tests fail on main's ci.yml and pass here.

  • Optional: the leg-limit test counts only each pair's slower slice, which holds because Vitest runs the pair at once by default; --maxWorkers=2 on the leg's command would pin that (see the inline note).
  • Optional: the headers of ci-swizzle-proof.test.mjs, slice.mjs and each swizzle-proof.<n>.test.mjs still say one slice per leg.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claims:
    • Leg n runs slices 2n−1 and 2n in one Node test call, is named swizzle-proof (n/4), and its steps say "this leg's slices": verified (ci.yml:1573, :1603, :1613, :1617).
    • Vitest runs the pair side by side: verified (no worker limit in vitest.config.ts; Vitest 4.1 defaults to one worker per CPU minus one).
    • Admission's full width for the proof is 4 and its tight width stays 2: verified (ci.yml:208).
    • The scope job, the start condition, the watchdog, the 15-minute limit, the recorded-time check, the test join and the slice files are unchanged: verified (diff; ci.yml:1530-1570, :1585, :1609-1612, :1619).
    • The record keeps each slice's largest time, 348 s for slice 1: verified (scripts/lib/duration-split.mjs:160-168, scripts/vitest-node-durations.json:1393).
    • A leg takes about its slower slice plus setup, at most about 470 s: verified as arithmetic (348 s + 120 s), given the parallel run.
    • A leg of four would approach the limit on a full-scope run: consistent with the record (four slices on three workers, about 613 s plus setup).
    • The shape tests cover one leg per slice file, two per leg, the pair's limit, admission's width, the watchdog and the recorded-time check: verified (ci-swizzle-proof.test.mjs:49-128).
    • 176 tests pass across the seven named test files: verified (103 plus 73).
    • With main's ci.yml the four new or changed cases fail: verified (4 failed, 3 passed).
    • Prettier passes: verified. Actionlint passes: not checked (not available to this review; Lint has not run on the draft).
    • Four standard ubuntu-latest runners instead of eight, and four fewer jobs at full width: verified (ci.yml:1583-1584; the added full-width jobs drop from 6 to 2).
    • About 110 s of setup, 3.35 minutes a leg, 141 proving runs a day, about 7 runner-minutes and $4.6–6.6 a day saved: not checkable here (CI history); the arithmetic is consistent.
    • Time to green stays about the same: consistent (the longest leg stays the slice-1 leg; at tight width the proof runs two waves instead of four).
    • Only #8027 also changes ci.yml, in its native jobs: #8027 verified (open, conflicting, its hunk at line 807); other open pull requests not enumerated.
  • Files:
    • .github/workflows/ci.yml: clear (optional: pin the pair's parallel run at line 1613).
    • .github/scripts/ci-swizzle-proof.test.mjs: clear (optional: its header still says one slice per leg).

Automated review (maintainer link)

Comment thread .github/workflows/ci.yml
export VITEST_SHARD_WATCHDOG_SECONDS
WATCHDOG=(--reporter=default --reporter=github-actions --reporter=./scripts/vitest-shard-watchdog.mjs)
pnpm test:node "${WATCHDOG[@]}" packages/cli/test/swizzle-proof/swizzle-proof.${{ matrix.slice }}.test.mjs
pnpm test:node "${WATCHDOG[@]}" packages/cli/test/swizzle-proof/swizzle-proof.$((2 * LEG - 1)).test.mjs packages/cli/test/swizzle-proof/swizzle-proof.$((2 * LEG)).test.mjs

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.

Optional: the leg-limit test in ci-swizzle-proof.test.mjs ("holds a pair of slices inside the leg limit") counts only each pair's slower slice, which is right only while Vitest runs both files at once. Today that comes from Vitest's default of one worker per CPU minus one. Adding --maxWorkers=2 to this command would pin it, so leg 1 never runs its 348 s and 340 s slices one after the other against the watchdog. Pairing slowest with fastest (1+8, 2+7, 3+6, 4+5) would also keep a serial run inside the limit.

@cixzhang

Copy link
Copy Markdown
Contributor Author

(Posted by Cindy's agent.) Closing: the swizzle proof no longer runs on pull requests by default (#12449), and on the release-check a slice proves its targets in about 137 s (slice 3: 21 targets, 34 s of it in the browser), so pairing two slices per leg saves no wall time and only a few runner-minutes a day.

@cixzhang cixzhang closed this Nov 18, 2026
@github-actions
github-actions Bot deleted the ci/swizzle-proof-paired-legs branch November 18, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — cacf064a Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant