Skip to content

mlx: select an Apple chip by its whole name and test the Darwin branches - #323

Open
cacheline999 wants to merge 1 commit into
InferMatrixLab:mainfrom
cacheline999:mlx-device-model-exact-match
Open

cacheline999 wants to merge 1 commit into
InferMatrixLab:mainfrom
cacheline999:mlx-device-model-exact-match

Conversation

@cacheline999

@cacheline999 cacheline999 commented Nov 2, 2026 •

Copy link
Copy Markdown

Governing Issue and delivery slice

Refs #38

Knowledge authorship declaration

Not applicable: no path protected by docs/knowledge-model-policy.md is changed.

Changed artifacts and evidence

Requirement Actual change Check / evidence and result Remaining gap
Case-insensitive --device-model match that verifies the right chip src/inferrsi/infra/platforms/mlx.py: compare the whitespace-normalized, case-folded request with the whole chip name, with or without the Apple prefix Before: on a real M1 Pro, --device-model M1, pro and Apple M all returned available / selection_verified: true. After: those three exit 1 with device_model_mismatch; m1 pro still exits 0 with available none
Unit tests for Apple, non-Apple and model-mismatch paths tests/test_mlx_discovery.py: mocked Darwin cases (available, model match, partial/other model mismatch, non-ARM64 chip, failed sysctl), labeled as claiming no hardware validation The mismatch cases for M1, pro, Apple M fail on main and pass with this change none
Real Apple Silicon run test_actual_apple_silicon_doctor_reports_available, skipped unless Darwin/arm64 Passed on Apple M1 Pro, macOS 26.1 Intel Mac negative path not run

Checks and dependencies

  • Checks actually run (result and tested scope): pytest tests/test_mlx_discovery.py tests/test_inspection.py → 34 passed, 1 skipped (Python 3.11.14, Apple M1 Pro, macOS 26.1); ruff check src tests tools → passed; git diff --check → clean.
  • Failed, skipped, timed-out or not-run checks (if applicable): test_actual_non_macos_doctor_reports_unavailable skips on macOS by design; full suite not run locally.
  • Dependencies / shared interfaces / integration assumptions (if applicable): inspect_devices signature and result keys are unchanged.

Remaining work and Issue closure

🤖 Generated with Claude Code

`--device-model` matched any substring of the sysctl brand string, so
"M1", "pro" or "Apple M" verified the selection of an "Apple M1 Pro".
Compare the whitespace-normalized, case-folded request with the whole
chip name, with or without the "Apple" prefix.

Cover the Darwin branches of inspect_devices with explicitly mocked
cases (available, model match, partial/other model mismatch, non-ARM64
chip, failed sysctl) and add a doctor test that runs only on a real
Apple Silicon host.

Agent-assisted-by: Claude Code / claude-opus-5-5 (author)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: hid19960830 <lingzhichu.clz@gmail.com>
@Dong1017 Dong1017 added the area:workbench CLI workbench: profile, A/B loop, quality gates, evidence reports label Nov 2, 2026 — with ChatGPT Codex Connector

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole-name MLX selection fix looks correct at 4980bf1c; hosted Ready validation is still pending.

  • The two-file change rejects partial names such as M1, pro and Apple M for Apple M1 Pro, while preserving case/whitespace normalization and the optional Apple prefix. The discovery result contract and other backends are unchanged.
  • The applicable Ready run is action_required with zero jobs. Passing declaration checks do not replace its tests/package checks; the next step is the existing maintainer's decision on that run.
  • The existing author, cacheline999, retains the correction. The M1 Pro receipt is author-reported; Intel Mac behavior and the parent Issue's acceptance remain separate. Mocked Darwin tests establish software-branch coverage, not hardware compatibility.
Evidence and review scope
  • Head: 4980bf1c80e5d4ec134c72ea060499f062bc93e9; API base / observed main: 2baebf6ebb815ebf07d21c41e3b3754858c0798e.
  • Independently read both changed files and followed inspect_device through the MLX adapter and environment-inspection caller. The matching predicate now compares normalized whole names rather than substrings.
  • Issue evidence distinguishes the author's historical 28d677ca discovery result from this fix. The PR reports targeted tests and Ruff on M1 Pro; I did not reproduce those runs.
  • Static review only: no local suite, Apple host, model/device execution or workflow action by this maintenance session. No source defect found in this bounded delta. This COMMENT does not imply APPROVE/LGTM, parent-Issue acceptance or MLX/Metal performance validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workbench CLI workbench: profile, A/B loop, quality gates, evidence reports

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants