Repository navigation
fix(cluster): count only the disk space free now for a model copy or download - #1766
Merged
Merged
Conversation
The two-Mac setup offered MiMo-V2.6-Flash's 172.9 GB download on the owner's M3 Ultra with 54.1 GB free: macOS's "important usage" capacity (256.6 GB) counts purgeable space such as local snapshots as free. The checks drive the copy-or-download plan, the receiver of a copy over the cable, the statfs fallback and the real probe with macOS's three figures, and the setup's model list with a choice that has no room on disk. They need one seam: `ClusterDiskSpace` (free now, purgeable) from `ClusterModelStore.diskSpace`, carried by `ClusterModelProvisioningMac.disk`, the receiver's `diskSpace`, the setup report's `modelStorePurgeableBytes` and the offer's `fitsOnDisk`. The seam keeps today's rule (important usage first, then statfs), so the checks fail: provisioning 156 passed, 8 failed; onboarding 707 passed, 4 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…download The setup offered MiMo-V2.6-Flash's 172.9 GB download on the owner's M3 Ultra with 54.1 GB free. Its disk check read macOS's "important usage" capacity, 256.6 GB there, which counts what macOS could purge (local snapshots, files iCloud keeps elsewhere) as free; the M5 Max read 551.4 GB with 161 GB free. - `ClusterDiskSpace` takes the volume's available capacity (statfs's free blocks when that is not read, as before) as the free figure; the rest of the important-usage capacity is purgeable, said but never counted. - The download, the copy to the other Mac, the copy from it and the receiving Mac's cluster service all refuse on the space free now plus the 2 GiB kept free. When the purgeable space would make room, the refusal says so: "this Mac has 54.1 GB free; the model needs 172.9 GB and 2.1 GB to spare. macOS could free up to 202.5 GB more (purgeable files such as local snapshots), but Darkbloom doesn't count on it." - The model list puts a model a Mac has no room for after the ones that fit, its line ending "not enough free disk" (`ClusterOnboardingProvisionOffer .fitsOnDisk`); chosen anyway, it says why and downloads nothing. - The setup wizard's "Disk" fact and its low-disk warning read the same figure. Checks: provisioning 164 passed, 0 failed; onboarding 711 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Free disk in the two-Mac guide: what a download or copy needs, what macOS could purge (not counted), the list's "not enough free disk", the refusal's words and what to do. The cluster stages explanation names the figures and the code that reads them. One changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in one place - The receiver's mid-copy check (`checkFreeDisk`) asks `ClusterDiskSpace.holds` with half the reserve, as `begin` and the plan ask it with the whole reserve, instead of its own `free < remaining + keep`. Same free-now figure, same threshold; the sum is now overflow-safe like the others. - `ClusterDiskSpace.purgeableNote`, which returned a sentence, becomes the predicate `purgingWouldMakeRoom`. `ClusterModelProvisioning.diskShortWords` now holds the whole refusal, so the disk value type keeps figures and rules and the words live in one function. No message, figure, threshold or wire field changes. Checks: provisioning 164 passed, 0 failed; onboarding 711 passed, 0 failed; `swift build --target ProviderCore` complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jonathan308
added a commit
that referenced
this pull request
Nov 4, 2026
Brings #1763, #1765, #1764, #1770, #1772, #1767, #1768, #1769 and #1766 from dev. One conflict, in docs/provider/two-mac-cluster.md (2 hunks): before "## Undo", #1774's "Stopping and starting again", then #1770's "Pairing again"; Undo keeps #1770's opening, #1774's --service sentences, the Uninstall link, and #1772's "## Uninstall" section as written. Resolution verified in a dry run (tree 4737f00). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/provider/two-mac-cluster.md
jonathan308
added a commit
that referenced
this pull request
Nov 4, 2026
This branch and dev share three merge bases (#1770's c066551, #1767's 6a399dc and #1766's e1e8d5e, each merged into dev separately), so GitHub's single-base check reports conflicts. git's default merge resolves them through a virtual base with no conflict. Its tree equals the tree the 0.10.8 integration was built, tested and run on real Macs with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
darkbloom clusterjudged free disk by macOS's "important usage" capacity, which counts space macOS could purge (local snapshots, files iCloud keeps elsewhere) as free. On the owner's M3 Ultra that read 256.6 GB with 54.1 GB actually free, so the setup offered MiMo-V2.6-Flash's 172.9 GB download, which could not fit.Every download or copy now needs the model's size free now on each Mac that receives it, plus the 2 GiB kept free. Purgeable space is said, never counted. A model without room is listed last, ending "not enough free disk", and choosing it explains why.
Linked issue
None filed: found by the pair-2 validation (gap 3), 2026-11-04.
Test plan
provider-swift/Tests/ClusterModelProvisioningChecks/run.sh provisioningprovider-swift/Tests/ClusterOnboardingChecks/run.shswift build --target ProviderCore: complete.make docs-check,make docs-impact-check BASE=origin/dev,make changelog-check,git diff --check.Components touched
Protocol / interface changes
Yes. Two optional fields, both additive with synthesized Codable:
ClusterSetupReport.modelStorePurgeableBytes(the setup report each Mac sends the other);ClusterOnboardingProvisionOffer.fitsOnDisk(the planned list a member may forward).Older builds ignore them and read their absence as unknown.
modelStoreFreeByteskeeps its name and now carries the space free now. No coordinator or platform change.Documentation impact
docs/provider/two-mac-cluster.md(new "Free disk" section and the list row);docs/architecture/inference.md(two-Mac cluster stages).Changelog
changelog.d/cluster-disk-check-free-space.md;make changelog-checkpasses.Notes for reviewers
ClusterModelStore.diskSpace(at:), feeds every disk decision: the download, the copy each way, the receiving Mac's cluster service and the setup wizard's Disk line. The duplicate probe inClusterSetupLocalReaderis gone.volumeAvailableCapacity, elsestatfs(the fallback is unchanged).ModelDownloader.ensureAvailableCapacity) and Autopilot (AutopilotDiskGuard) still use important usage through their own code. That is a follow-up decision.Before And After
Behavior
flowchart TD subgraph Before B1[darkbloom cluster: Choose a model] --> B2["Disk = important usage<br/>256.6 GB on the M3 Ultra"] B2 --> B3["List: MiMo · 172.9 GB · download"] B3 --> B4[Download / Cancel offered] B4 --> B5[Download starts on 54.1 GB actually free:<br/>fills the disk or fails part way] end subgraph After A1[darkbloom cluster: Choose a model] --> A2["Disk = free now 54.1 GB<br/>+ purgeable 202.5 GB, not counted"] A2 --> A3["List: MiMo · 172.9 GB · download · not enough free disk<br/>(after the models that fit)"] A3 --> A4["Chosen: Can't start … 54.1 GB free; needs 172.9 GB and 2.1 GB to spare.<br/>macOS could free up to 202.5 GB more …, but Darkbloom doesn't count on it."] A4 --> A5[Exit 1, nothing downloaded] endCode
flowchart LR subgraph Before P1["ClusterModelStore.freeBytes(at:)<br/>important usage, else statfs"] --> L1[OnboardingLive: download / copy offers] P2["ClusterSetupLocalReader.freeBytes<br/>(duplicate)"] --> R1[report.modelStoreFreeBytes] --> L1 L1 --> PL1["ClusterModelProvisioning.plan<br/>free < bytes + 2 GiB"] P1 --> RC1[ClusterModelReceiver.begin] end subgraph After P3["ClusterModelStore.diskSpace(at:)<br/>available capacity, else statfs"] --> D[ClusterDiskSpace<br/>freeBytes · purgeableBytes] D --> L2[OnboardingLive offers<br/>+ fitsOnDisk] D --> R2[report.modelStoreFreeBytes<br/>+ modelStorePurgeableBytes] --> L2 L2 --> PL2["plan: holds(bytes, keeping: 2 GiB)<br/>diskShortWords + purgingWouldMakeRoom"] D --> RC2[ClusterModelReceiver.begin<br/>same rule and words] PL2 --> F[Flow list: last, 'not enough free disk'] endRefactor Pass
A dedicated refactor review (AGENTS.md "Required Refactor Pass") ran after the fix. It made one behavior-preserving commit,
e1e8d5e813refactor(cluster): share the disk rule mid-copy and word the refusal in one place:ClusterModelReceiver.checkFreeDisk) now asksClusterDiskSpace.holdswith half the reserve, asbeginand the plan do with the whole reserve. It no longer does its own sum. The figure, threshold and message are the same.ClusterDiskSpace.purgeableNotereturned a sentence. It is now the predicatepurgingWouldMakeRoom, andClusterModelProvisioning.diskShortWordsholds the whole refusal. The text is byte-identical.Reviewed and left as is:
ClusterDiskSpacelives: it stays inClusterModelProvisioning.swift, beside its probe and the code that uses it. Three plain-swiftc runners list that file by name.freeBytes:convenience initializer, the two optional wire fields, thestatfsfallback, the list order and marker, and every message.Rerun after the refactor:
swift build --target ProviderCore: complete;make docs-check,make docs-impact-check BASE=origin/dev,make changelog-checkandgit diff --check: pass.Not run: XCTest (none covers these paths),
ClusterConsoleChecks(it fails to build onorigin/devfor an unrelated reason) and a real Mac.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.