Skip to content

Order the Mac inference phases so the gates stop fighting each other - #8024

Merged
danielhanchen merged 1 commit into
mainfrom
ci/mac-phase-gates
Aug 6, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/mac-phase-gates

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to the Mac inference-smoke consolidation, applying the resolution that came out of reviewing the equivalent Windows change in #8013. Same three phases, same one-job shape, so the same two gating problems were present here.

The installer gate

The step carried an explicit if: ${{ !cancelled() }}, and the comment above it explained the reasoning: phase 1's environment and model cache ran before the installer, so under the implicit success() a phase-1 GGUF download failure or 15-minute timeout would skip the install, skip assert-llama with it, and evaluate every phase-2 and phase-3 gate false. A transient HF download would take the whole workflow down.

The gate does buy that independence. What the comment did not weigh is the other side: !cancelled() is true after any non-cancellation failure, including a failed setup-node or setup-python. The installer then runs on a runner that never got its pinned toolchain, assert-llama passes, and all three phases run and fail somewhere unrelated to the real cause.

Reordering gets both properties at once, and needs no condition at all:

before   checkout  node  python  Phase 1 env  cache-hf  prime-hf  save  install(!cancelled)  assert-llama
after    checkout  node  python  install  assert-llama  Phase 1 env  cache-hf  prime-hf  save

Everything above phase 1's block is genuinely shared; everything from the block down is phase 1's own. The installer goes back to the implicit success(), where the only thing it can now see is a real shared-preamble failure, which should stop the job.

Checked that nothing in the preamble needed the moved environment: the installer takes gh-token and hf-token, not HF_HOME, and phase 2 already ran it with no HF_HOME set at all.

Phase-local prerequisites

Phases 2 and 3 gated every step on assert-llama alone. That is right for cross-phase independence and wrong within a phase: a failed download still booted a server with no model, and the test then ran against it, so the job spent the phase's full budget cascading from an error already reported several steps earlier.

Each phase now chains on its own prerequisites, with assert-llama kept as the first term so nothing about cross-phase independence changes:

phase 2   boot-tools    <- download-gguf-tools.outcome  != 'failure'
          ready-tools   <- boot-tools.outcome           == 'success'
          test          <- ready-tools.outcome          == 'success'

phase 3   boot-vision   <- sdks-vision.outcome == 'success' && download-gguf-vision.outcome != 'failure'
          ready-vision  <- boot-vision.outcome  == 'success'
          test          <- ready-vision.outcome == 'success'

The download clause is != 'failure' rather than == 'success' on purpose: a cache hit skips the download step, and == 'success' would make a warm cache skip the entire phase.

Phase 3 gates on the SDK install because it is the only phase that imports openai / anthropic; phase 2 drives the API with curl and deliberately does not, so a pip failure there cannot cost the tool-calling coverage.

Verification

  • Every run: body in the file is byte-identical across the change: 24 before, 24 after, 0 lost and 0 added. The diff moves steps and edits if: keys only.
  • actionlint clean, and no step ends up with a duplicate if: key.
  • No step gates on its own id.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: f864894d3a

ℹ️ 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".

Follow-up to the Mac consolidation, applying the resolution that came out of
reviewing the equivalent Windows change in #8013.

The installer carried an explicit 'if: ${{ !cancelled() }}' with a comment
explaining why: phase 1's environment and model cache ran before it, so under
the implicit success() a phase-1 GGUF download failure would skip the install,
skip assert-llama with it, and take phases 2 and 3 down. The gate bought that
independence, but at a price the comment did not mention: a failed setup-node
or setup-python no longer stops anything, the installer runs on a runner that
never got its pinned toolchain, assert-llama passes, and all three phases run
and fail somewhere unrelated.

Moving phase 1's block below the shared preamble is better than either gate,
because it makes the two failure classes structural rather than conditional.
Everything above the block is genuinely shared, everything below it belongs to
phase 1, and the installer can go back to the implicit success().

Phases 2 and 3 also gated every step on assert-llama alone, so a failed
download or a server that never came up still ran the test against it. Each
phase now chains on its own prerequisites, keeping assert-llama as the first
term so cross-phase independence is unchanged. Phase 3 additionally gates on
its SDK install, which only it needs.

Verified no coverage moved: every 'run:' body in the file is byte-identical
across the change, 24 before and 24 after, none lost and none added.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: b4eca3a8c1

ℹ️ 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 0cd070d into main Aug 6, 2026
7 of 8 checks passed
@danielhanchen
danielhanchen deleted the ci/mac-phase-gates branch August 6, 2026 14:40
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