Repository navigation
mlx: select an Apple chip by its whole name and test the Darwin branches - #323
cacheline999 wants to merge 1 commit into
Conversation
`--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
left a comment
There was a problem hiding this comment.
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,proandApple MforApple 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_requiredwith 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_devicethrough 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
28d677cadiscovery 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.
amy-why-3459
left a comment
There was a problem hiding this comment.
LGMT
PR review verdict — PASS
Reviewed base 663f3b3 and head 4980bf1.
src/inferrsi/infra/platforms/mlx.py:--device-modelnow matches the whitespace-normalized, case-folded whole chip name (with or without theAppleprefix), soM1/pro/Apple Mno longer selectApple M1 Pro; result keys and theinspect_devicessignature are unchanged.tests/test_mlx_discovery.py: mocked Darwin cases cover available, whole-name match, partial/other-model mismatch, non-ARM64 and failed sysctl; real-host test is skipped off Apple Silicon.- Locally ran
pytest tests/test_mlx_discovery.py tests/test_inspection.pyon Linux: 34 passed, 1 skipped.
Not verified: Apple hardware run (author-reported) and the hosted Ready run, which is still awaiting maintainer approval.
Dong1017
left a comment
There was a problem hiding this comment.
Incremental review — approval-record contract (current head 4980bf1c, no new code finding): The November 4 approval starts with LGMT, while the repository's review convention requires the exact, case-sensitive LGTM on the first non-empty line for a qualifying PASS approval. GitHub's APPROVED state alone does not establish that the review meets this additional convention; the main ruleset also requires two eligible, current approvals.
Suggested minimal correction: ask the original independent reviewer to submit a qualifying review with the exact first line (or obtain another eligible independent review). Preserve the existing review record rather than silently treating its typo as compliant. This is a process/evidence finding only: the two-file MLX patch and its tests were already covered in earlier review, and I have not run any tests, altered approvals, or verified Apple hardware or Ready CI.
Governing Issue and delivery slice
Refs #38
--device-modelmatch". Not yet assigned; real-host evidence and this scope are posted on task: add MLX backend discovery and seed source-grounded MLX knowledge for Apple Silicon #38 (task: add MLX backend discovery and seed source-grounded MLX knowledge for Apple Silicon #38 (comment)) for the acceptance owner.--device-modelmatching for the MLX probe, mocked tests for the Darwin branches ofinspect_devices, and a doctor test that runs only on a real Apple Silicon host.Knowledge authorship declaration
Not applicable: no path protected by
docs/knowledge-model-policy.mdis changed.Changed artifacts and evidence
--device-modelmatch that verifies the right chipsrc/inferrsi/infra/platforms/mlx.py: compare the whitespace-normalized, case-folded request with the whole chip name, with or without theAppleprefix--device-model M1,proandApple Mall returnedavailable/selection_verified: true. After: those three exit 1 withdevice_model_mismatch;m1 prostill exits 0 withavailabletests/test_mlx_discovery.py: mocked Darwin cases (available, model match, partial/other model mismatch, non-ARM64 chip, failed sysctl), labeled as claiming no hardware validationM1,pro,Apple Mfail onmainand pass with this changetest_actual_apple_silicon_doctor_reports_available, skipped unless Darwin/arm64Checks and dependencies
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.test_actual_non_macos_doctor_reports_unavailableskips on macOS by design; full suite not run locally.inspect_devicessignature and result keys are unchanged.Remaining work and Issue closure
platform_packscriterion of task: add MLX backend discovery and seed source-grounded MLX knowledge for Apple Silicon #38 is obsolete after refactor: remove the unread platform_packs descriptors and fix the generated-path guidance #201.🤖 Generated with Claude Code