Skip to content

fix(cluster): refuse unplanned models in checks and serve - #2069

Merged
ashhart merged 2 commits into
ashhart:mainfrom
swbiggart:review-ready/cluster-exit
Nov 4, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
swbiggart:review-ready/cluster-exit

Conversation

@swbiggart

@swbiggart swbiggart commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

cluster check and cluster status printed not planned but returned success when a model could not be planned. Return 1 for that failure. serve, including --dry-run, now stops at this preflight before describing or attempting a launch.

The existing preflight checks every configured model unless --model filters it: serve A can therefore now refuse because a different model B cannot be planned. A non-fitting B already blocked A; this change leaves model selection unchanged.

  • Issue: n/a; a standalone host planner bug, with no model arithmetic change.
  • Rebased onto main at 023def309dd1d5534c740fb7465e2835cee3ee2c to resolve the changelog conflict. Current head: a25ffe1cdb691b633e5a0f973b846f06551ea1a3.
  • atc overlap --json: incomplete (pullFilesLimit, pullFilesUnavailable, timeLimit). A separate paginated audit of all 173 open PRs on 2026-11-03 at 19:55 UTC found no PR changing these files; related cluster discussions and merged changes were also checked.

Checks

  • Tested implementation commit: e8089a852c95043fe679f7db9601500c88746486, before the rebase and changelog-only follow-up. Both changed Zig files are byte-identical to that tested commit.
  • Changelog follow-up: documents all three preflight exit codes under Unreleased. git diff --check passes; the rebased branch merges cleanly with main. No tests rerun for the documentation-only follow-up.
  • Lean checker, python3 tools/zig/lean_check.py: 424 problems on base and head, 0 new.
  • New behavior regression: on main, serve --dry-run fails the expected-exit-1 assertion with actual 0; the filtered run has 7 passes and 1 failure before the fix and 8 passes afterward (7 module test blocks and 1 behavior regression; 0 skipped). It also checks check and status for missing file lists and unsupported estimates.
  • Full host CLI suite: 72 passed, 6 skipped, 0 failed.
  • zig build test test-kernel-contract test-golden test-server-security test-pull-security fuzz-cortheon -Dcpu=apple_m1 -j1 --summary all: exit 0; 675/675 steps succeeded, 372/378 tests passed, 6 skipped. This final-head run was mostly cached.
  • Plain zig build -Dcpu=apple_m1 -j1 --summary all: exit 0; 250/250 steps succeeded.
  • zig fmt --check on both changed files and git diff --check: pass.
  • CI: pending on this PR.
  • Not run: Linux host execution, CUDA device tests and real-cluster/model tests. This is a host preflight change, with no inference claim.

Filtered regression command:

zig test -lc --dep sys --dep core --dep fabric --dep lanes \
  -Mroot=zig/src/cluster/cli.zig -Msys=zig/src/platform/sys.zig \
  --dep sys -Mcore=zig/src/core/root.zig \
  --dep sys -Mfabric=zig/src/fabric/fabric.zig \
  --dep sys -Mlanes=zig/src/core/lanes/lanes.zig \
  --test-filter 'check, status and serve'

Receipt

n/a: host planner exit codes only; no inference path changes. Checks ran on Apple M5 Max, macOS 27.2, Zig 0.17.0.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

@ashhart

ashhart commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Thanks @swbiggart. Printing "not planned" and exiting 0 was a real trap for scripts, and the fix puts it on the same footing as a model that doesn't fit, with a test for each command and both refusal kinds. One small thing: could you add a CHANGELOG line saying cluster check, cluster status and serve's preflight now exit 1 when a configured model can't be planned? Then it can land.

swbiggart added a commit to swbiggart/TensorFold-upstream that referenced this pull request Nov 3, 2026
@swbiggart
swbiggart force-pushed the review-ready/cluster-exit branch from aa13720 to a25ffe1 Compare November 3, 2026 23:24
swbiggart added a commit to swbiggart/TensorFold-upstream that referenced this pull request Nov 3, 2026
@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thanks @swbiggart. The CHANGELOG line is exactly what we asked for, and the code commit is the one we reviewed, so this is ready to land.

@ashhart
ashhart force-pushed the review-ready/cluster-exit branch from a25ffe1 to 27748f8 Compare November 4, 2026 10:03
ashhart pushed a commit to swbiggart/TensorFold-upstream that referenced this pull request Nov 4, 2026
Return 1 when planning fails, including the preflight used by serve. Dry-run serve now refuses before describing a launch. Keep the existing all-model check and its --model filter.
@ashhart
ashhart force-pushed the review-ready/cluster-exit branch from 27748f8 to 41dcd4f Compare November 4, 2026 11:37
@ashhart
ashhart merged commit 45876f5 into ashhart:main Nov 4, 2026
0 of 7 checks passed
@ashhart

ashhart commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Thank you @swbiggart. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

2 participants