Skip to content

CI: drop three macOS legs that assert nothing a Linux runner does not - #7974

Merged
danielhanchen merged 1 commit into
mainfrom
ci/trim-macos-duplicate-legs
Aug 6, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/trim-macos-duplicate-legs

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

GitHub caps concurrent macOS jobs at 5 per account, shared across every macos-* label and across unslothai/unsloth and unslothai/unsloth-zoo. Enterprise is the only plan that raises it.

That cap is the binding constraint on CI latency here. Measured during a busy period: 35 jobs running against a 60-job total cap (19 linux, 13 windows, 3 macOS) while 15 macOS jobs sat queued behind 5 slots. The total cap is nowhere near reached, so raising overall concurrency would change nothing; macOS is the one genuinely scarce resource, and it was the slow leg on the last two desktop releases.

This PR removes three macOS legs that cost a slot each and produce no signal a Linux leg does not already produce.

The three legs

studio-export-capability-ci.yml runs exactly one command, pytest tests/test_export_capability.py. Every test in that file goes through _patch(), which monkeypatches _has_torch, get_device and is_apple_silicon. Nothing touches Metal, MLX or any Apple binary. studio-backend-ci.yml already runs the same file on ubuntu-latest as part of pytest tests/, and does not deselect it.

cross-platform-parity-ci.yml runs source-text assertions. tests/python/test_cross_platform_parity.py is Path.read_text() plus regex over install.sh / install.ps1 / setup.ps1, with zero platform., sys.platform, darwin or uname references. The matrix exists for the Windows cp1252 default encoding, which the workflow header states outright. The macOS row asserted what the Linux row already asserts.

mlx-ci.yml keeps every Metal-bound step and stops re-running two fully spoofed test files. test_hardware_dispatch_matrix.py and test_is_mlx_dispatch_gate.py use monkeypatched profiles plus a MetaPathFinder that blocks import mlx.core, so they assert identically on any host, and studio-backend-ci.yml runs both on ubuntu-latest in its "Hardware-spoof tests" step. Their paths: triggers are removed too, so a change touching only those files no longer boots a Mac to run nothing related.

test_mlx_training_worker_behaviors.py stays on the Mac. It is pure ast.parse and would run anywhere, but no Linux job currently claims it, so removing it would have been real coverage loss.

What is unchanged

Every genuinely Apple-bound step is untouched: real _IS_MLX verification, the real mlx module imports, the real LoRA training round-trip, assert-llama-loads.sh, codesigning and notarization.

Test plan

  • All four modified workflow files parse as valid YAML
  • macOS job census across the repo: 33 -> 31
  • Assertion-preservation diff: extracted the test-command set from every run: body before and after. The sets are identical apart from the two spoofed files, which is the intended change
  • Confirmed studio-backend-ci.yml triggers on tests/**, so both moved files still run on ubuntu-latest when changed
  • CI green on this PR

Follow-up

A second PR will consolidate the duplicated macOS smoke preamble. A byte-identical 5-step block (checkout, setup-node, setup-python, install.sh --local --no-torch, assert-llama-loads.sh) currently repeats across 7 job definitions, so a studio/** PR runs the same install on macos-14 up to 7 times concurrently. Keeping that restructure separate so these deletions can land and be judged on their own.

GitHub caps concurrent macOS jobs at 5 per account, shared across every
macos-* label and across unslothai/unsloth and unslothai/unsloth-zoo. That
cap is the binding constraint on CI latency here: the 60-job total is not
close to reached (measured 35 running, 3 of them macOS) while 15 macOS jobs
sat queued behind 5 slots. It was the slow leg on the last two desktop
releases.

These three legs cost a slot each and buy no signal a Linux leg does not
already produce:

studio-export-capability-ci.yml runs one command, pytest
tests/test_export_capability.py. Every test in that file goes through
_patch(), which monkeypatches _has_torch, get_device and is_apple_silicon.
Nothing touches Metal, MLX or an Apple binary, and studio-backend-ci.yml
already runs the same file on ubuntu-latest via pytest tests/.

cross-platform-parity-ci.yml runs source-text assertions:
tests/python/test_cross_platform_parity.py is Path.read_text() plus regex
over install.sh, install.ps1 and setup.ps1, with zero platform., sys.platform,
darwin or uname references. The matrix exists for the Windows cp1252 default
encoding, which the workflow header says outright; the macOS row asserted
what the Linux row already asserts.

mlx-ci.yml keeps every Metal-bound step and stops re-running two fully
spoofed test files. test_hardware_dispatch_matrix.py and
test_is_mlx_dispatch_gate.py use monkeypatched profiles and a MetaPathFinder
that blocks import mlx.core, so they assert identically on any host, and
studio-backend-ci.yml runs both on ubuntu-latest. Their paths triggers are
removed too, so a change to only those files no longer boots a Mac to run
nothing related. test_mlx_training_worker_behaviors.py stays: it is pure
ast.parse and would run anywhere, but no Linux job currently claims it.

No assertion is lost. Extracting the test-command set from every run: body
before and after gives an identical set apart from those two spoofed files.

macOS jobs in this repo: 33 -> 31.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 8ff176ede8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit fc0adfb into main Aug 6, 2026
12 checks passed
@danielhanchen
danielhanchen deleted the ci/trim-macos-duplicate-legs branch August 6, 2026 07:24
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