Skip to content

Cut check.yml's critical path: shard swiftlint analyze, boot simulators under the build, split ios-build - #405

Merged
alexkroman merged 10 commits into
mainfrom
claude/determined-gates-fwpeef
Nov 25, 2026
Merged

alexkroman merged 10 commits into
mainfrom
claude/determined-gates-fwpeef

Conversation

@alexkroman

@alexkroman alexkroman commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

check took 40–52 minutes, nearly all of it in ios-build: 40–48 min of unit tests, audits, swiftlint analyze and periphery run back to back. This PR moves that work onto parallel runners and removes two waits.

Cause Fix
swiftlint analyze checks one file at a time (13.6 min on iOS) New scripts/swiftlint-analyze.sh splits the files across up to 4 processes. It passes absolute paths, which SwiftLint needs to match a file to its compiler arguments; with relative paths it analyzed nothing. It fails if the compiler log covers no files.
Every iPhone job waited 2–11 min for a fresh simulator's first boot before building ios-test.sh and ios-uitest.sh start the boot in the background, run build-for-testing, wait for the boot, then test-without-building. ios-uitest.sh also launches the app once first, so the first audit doesn't run on a cold simulator.
One job ran all the iPhone gates ios-check.sh takes steps (test uitest analyze probe periphery, all by default, so a local run is unchanged). check.yml splits them into three jobs: ios-build (tests and the probe build), ios-audits (two shards, each auditing its tests at both text sizes) and ios-static (analyze and periphery).
The Mac's analyze and periphery ran inside macos New scripts/mac-static.sh (build/analyze/periphery), run by a new mac-static job. check.sh still runs them locally; on CI, BLURT_STATIC_CHECKS=0 leaves them to that job.
The Mac UI suite ran on one runner ui-tests runs as two shards.

The required check job waits for and checks every new job.

Also:

  • More Mac accessibility audits: the API-key sheet with a rejected key, and the Library's Filter menu, row context menu and Delete confirmation.
  • .claude/settings.json allows the two new scripts without a prompt.

Measured

Run on 4216b5b: green in 22.9 min, against 40–52 before. Slowest jobs: ios-audits 22.6 / 16.5, ios-build 14.5, ui-tests 13.9 / 13.2, ios-sanitizers 14.2 / 12.2, mac-static 11.2, macos 9.2, ios-static 8.4.

The last commits move testWords between the ios-audits shards (their tests took 469 s against 340 s) and merge main. The only conflict was ios-build's timeout: main raised it to 70 min for a job that ran 43; here it runs 14.5, so it stays at 30.

Each run uses about 5 more macOS runners than before, each for a shorter time.

How it was tested

scripts/check.sh --portable passes. The xcodebuild, simulator and SwiftLint behaviour is covered by this PR's CI runs, including the green run above.

  • scripts/check.sh passes (or CI will, if I'm not on a Mac)
  • I read AGENTS.md and this doesn't reintroduce anything deliberately removed
  • Docs updated if behavior changed

…rs under the build, split ios-build

ios-build was the long pole of every check run at 40-48 minutes. Three causes,
three fixes:

- swiftlint analyze runs one file at a time on Swift >= 5.6 (SwiftLint's
  LintableFilesVisitor), so it used one core: 13.6 minutes over the iPhone
  build and 8.5 over the Mac one. scripts/swiftlint-analyze.sh deals the
  same files round-robin into one process per core (at most 4) and fails if
  any process does; check.sh and ios-check.sh both call it.
- ios-test.sh and ios-uitest.sh waited for a fresh simulator's first boot
  (2-11 minutes on CI) before building. They now start the boot in the
  background, build-for-testing, wait for the boot, then test-without-building.
  The sanitizer jobs get this too.
- ios-check.sh takes steps (test, uitest, analyze, probe, periphery; all by
  default, as check.sh runs it), and check.yml runs them in three parallel
  jobs: ios-build (test probe), ios-audits (uitest) and ios-static (analyze
  periphery, which builds the tests itself for the compiler log). The
  required check job asserts both new jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
…files

The first CI run of swiftlint-analyze.sh passed on both platforms in about a
second: SwiftLint keys a file's compile command on the URL of the absolute
path in the build log and silently skips a file it can't find one for, and
the script passed relative paths, so nothing was analyzed. Pass absolute
paths, and only those the log names (SwiftLint's own test, done where an
empty selection can fail the step instead of passing it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
…n failure

Moving the audits to their own job put them on a just-booted simulator, and
the first one (testConsent) failed its 10 s wait for the consent sheet in
the PR's second run. Until this PR they ran after ios-test, whose host-app
launches had already warmed the simulator; ios-uitest.sh now installs and
launches the app once before the suite to the same effect. ios-audits also
uploads the result bundle when it fails, as ui-tests does for the Mac suite,
since the log shows only each failure's first line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
…ac screens

The iPhone audits were the run's longest job (~23-26 minutes, ~12.5 of them
test). ios-audits is now a matrix of two runners, one per text size:
AccessibilityAuditTests audits only the size BLURT_AUDIT_TEXT_SIZE names
(default or largest; unset keeps both, as a local run does), which
ios-uitest.sh hands the test runner as TEST_RUNNER_BLURT_AUDIT_TEXT_SIZE.
Every test still runs on both runners, so a new one needs no list kept, and
an unknown value fails instead of auditing nothing. Each leg uploads its own
result bundle on failure.

The Mac audits gain four states, each reached the way a functional test
already reaches it: the API key sheet with a rejected key's inline error,
the Library's Filter menu and a row's context menu while open, and the
Delete confirmation (cancelled).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
…, largest size and the Mac suite each split in two

Run 4 measured where the time goes. A cold simulator costs a runner 11-13
minutes before its first test (ios-static builds the same app in 2.3 without
one), so the default-size audits (~5.5 minutes of test) now run in ios-build,
on the simulator its unit tests already booted. The largest size (~9.5
minutes of test) runs on two ios-audits runners, split by test.

The Mac UI suite (~20 minutes of test on one runner) splits by class into two
shards balanced on CI's per-class times (~580 and ~600 s); the leak scan rides
shard a.

In both splits shard a names its tests and shard b skips them, so a new test
or class lands in b with no list to update. uitest.sh now takes a test
selection, and it and ios-uitest.sh fail a selection that ran no tests, so a
renamed entry can't quietly drop a shard to nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
With the UI jobs split, `macos` (~21 minutes) became the run's long pole, and
~10 of those minutes were swiftlint analyze (8.7, which more processes didn't
shorten on this runner) and periphery, which need only the app build.

scripts/mac-static.sh now holds the app build, analyze and periphery as
steps, moved out of check.sh, which calls them: `build` as its app build,
then `analyze` and `periphery` over that build's log, as before. check.yml's
new mac-static job runs all three on its own runner, and `macos` skips the
last two with BLURT_STATIC_CHECKS=0, honoured on CI only, the same pairing
as BLURT_INTEGRATION_TESTS=0 with ui-tests. The required check job asserts
mac-static.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
swiftlint-analyze.sh and mac-static.sh join the read-only and verification
commands .claude/settings.json pre-allows, as CLAUDE.md asks of a command in
that set; CLAUDE.md's Permissions section lists them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
…to tests and the probe

Run 6dea62b was green everywhere, and ios-build — unit tests, the probe and
the default-size audits on its own simulator — was the long pole at 23.8
minutes, while both largest-size audit runners finished in ~15. The two
ios-audits runners now each audit their half of the tests (the same
by-test shards) at both sizes, and ios-build runs only the tests and the
probe: ~3 more minutes on each audit runner, ~10 fewer on ios-build, no
extra runner. BLURT_AUDIT_TEXT_SIZE stays, for iterating on one size by
hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
Run 4216b5b was green at 22.9 minutes, with ios-audits b the long pole:
its six tests ran 469 s to shard a's 340 (22.6 min to 16.5 for the job).
testWords moves to a, which should leave the two near 400 s each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
One conflict: ios-build's timeout. Main raised it to 70 minutes for the
43-minute job it had become; here that job is the unit tests and the
probe only, 14.5 minutes on run 4216b5b, so its 30 stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
@alexkroman
alexkroman marked this pull request as ready for review November 25, 2026 17:42
@alexkroman
alexkroman enabled auto-merge November 25, 2026 17:42
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit bbd4903 Nov 25, 2026
21 checks passed
@alexkroman
alexkroman deleted the claude/determined-gates-fwpeef branch November 25, 2026 18:49
alexkroman pushed a commit that referenced this pull request Nov 25, 2026
Two conflicts:
- check.yml's required check job: #405 added mac-static, ios-audits and
  ios-static; this adds live-tests. It now needs and asserts all of them.
- CommandFixtureApp: #404 raised state(until:)'s bound from 2 s to 30 s
  for every caller, which covers the fixture's slow first launch, so the
  within: parameter this branch added is dropped and the launch uses the
  plain call. The menu-bar wait gets #404's wall-clock-ok note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
alexkroman pushed a commit that referenced this pull request Nov 25, 2026
Brings in #413's coordinator fix for ios-sanitizers (address). One
conflict: LibraryAccessibilityAuditUITests, where #405 added the Library
menus test and this branch the live-recording page; both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
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.

2 participants