Skip to content

MLX backend tests: answer zoo _first_resolved in the inference stub - #18361

Merged
danielhanchen merged 1 commit into
mainfrom
ci/mlx-stub-first-resolved
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/mlx-stub-first-resolved

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Two coverage tests in studio/backend/tests/test_mlx_inference_backend.py fail against current unsloth-zoo main:

FAILED test_the_stub_answers_every_helper_zoo_imports_from_inference
  AssertionError: zoo imports ['_first_resolved'] from mlx.inference and the stub cannot answer them
FAILED test_the_stub_accepts_every_call_zoo_makes_to_an_inference_helper
  AttributeError: _first_resolved

This shows up on the macOS MLX job for every PR (for example the staging run for #18332).

Cause

unslothai/unsloth-zoo#2586 (mlx-vlm 0.8.0 support) has unsloth_zoo/mlx/speculative.py import _first_resolved from mlx.inference for the Qwen4 head replay. _first_resolved tries several binding contracts through _resolved_bindings and returns the first that resolves.

The zoo change is correct. These two tests exist to flag a new helper that the stub of unsloth_zoo.mlx.inference cannot answer, and they did.

Fix

Map _first_resolved to _no_replay, next to its sibling _resolved_bindings. The stub has no Metal or QSA cache, so "no replay can be bound" is the right answer, the same one the other head-replay helpers give.

Verification

Run on this Linux host. It has no mlx_lm / mlx_vlm, so 8 tests that need them fail on both sides, unchanged:

Tree (zoo main e9728df56) Result
main 10 failed: the 8 host-only ones plus the two above
this branch 8 failed: the host-only ones only

The branch also passes the two tests against zoo from before #2586. ruff is clean.

unsloth-zoo #2586 has speculative.py import _first_resolved from
mlx.inference for the Qwen4 head replay. The stub in
test_mlx_inference_backend.py could not answer it, so its two coverage
tests fail on the macOS MLX job against current zoo main. Map it to
_no_replay next to its sibling _resolved_bindings.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T17:11:42.844091Z 79d5cf5 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 79d5cf528f

ℹ️ 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 10f6f06 into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/mlx-stub-first-resolved branch November 18, 2026 17:13
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