Repository navigation
Cluster (0.10.13): the joining Mac ends on a stop only when one was asked for, never on "Stopped" - #2042
Merged
Conversation
…s no stop (red) An external pair on 0.10.12 (2026-11-12 ~20:46Z): during setup the leading Mac downloaded the chosen model, and the joining Mac's screen ended about 20 s later with "Stopped (by `darkbloom cluster stop` on one of the Macs): the pair isn't starting any more." though nobody ran it. Until both parts start the leading Mac's status reads "Stopped." (OnboardingLive.localStatus says so while leadership.serving is off, which only localServe turns on), while its start publishes downloading and then copying; the registration's stop and restart reads "Stopped; last model ..." again. The joining Mac's follow takes any "Stopped" held 20 s once a start progress was seen (ClusterOnboardingFollow.swift:223) as a stop from anywhere. aStatusThatReadsStoppedThroughADownloadIsNoStop scripts that leader: 21 s of "Stopped." beside the download's bytes, a copy, the gap before the start, the load, the registration's "Stopped; last model ...", then serving. The joining Mac must end with the leading Mac's outcome, never the stop line. It fails on this commit's sources (the joining Mac says the stop line at 20 s and exits 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…never on "Stopped" The report (an external pair on 0.10.12, 2026-11-12 ~20:46Z): the joining Mac's screen ended about 20 s into the leading Mac's download with "Stopped (by `darkbloom cluster stop` on one of the Macs): the pair isn't starting any more", though nobody ran it. Root cause (0.10.9 to 0.10.12, since b62750d): followStart took a leading-Mac status that read "Stopped" for 20 s, once a start progress was seen, for a stop from anywhere (ClusterOnboardingFollow.swift:221-229). Until both parts start, the leading Mac's status reads "Stopped." (OnboardingLive.localStatus says so while leadership.serving is off; only localServe turns it on), and a start that must download or copy the model publishes downloading/copying all that time. The joining Mac keeps the first phase it saw, so every such start ended its screen 20 s in. The registration's stop and restart, and the cluster service's approval-change restart, could trip it too when they took 20 s. The fix is an explicit signal. The leading Mac counts each stop a person asks for (OnboardingLive.stop and the forwarded .stop: darkbloom stop, cluster stop, restart, from either Mac) in its setup record, in the same write as the stopped intent (ClusterSetupRecord.stopsAsked, OnboardingLive.stopping). The start's own stops (a model change, the registration) and the service's never count. Its status reply carries the count (ClusterControlReply.stopsAsked: 0 before the first, nil from an older build, which an older Mac ignores). The joining Mac ends only once the count grew since the start began (ClusterOnboardingFollowedStop), and then at once. A look that read no count tells nothing, and a stop before the start began (the leader still at its list) is none of this start's. The "Stopped" inference and its 20 s hold are gone. So a real stop still ends both screens. The leading Mac's wait for the parts now ends at once on a stop too (waitReady, as pairServing did; before, it waited 15 minutes and offered Retry). A stop asked while the model downloads or copies keeps the pair stopped instead of starting both Macs after the download (chooseAndServe compares the count before serve). Checks: the previous commit's red check is green. The joining Mac's stop check now carries a count and ends at once, not after 20 s. New checks cover the count's rules, a stop before the start, a stop during the download on both screens, and a stop during the leader's load. ProviderCoreTests: the count on the wire (an older Mac ignores it, an older leader sends none), and only a person's stop counts. Tests/ClusterOnboardingChecks/run.sh: 1955 passed, 0 failed (red commit: 1928 passed, 2 failed, both in the new check). Docs: inference.md (how the follow ends), two-mac-cluster.md; changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…view-2042) The independent review of 8e4f828 (review-2042.md) found these, now fixed: M1: waitReady's new pairStopped() check ended the leading Mac's load wait on stops nobody asked for: the cluster service's approval restart, the re-plan, releaseForSingleMac, a mirrored lease intent. That check is gone. The leading Mac's waits (for the parts and for the coordinator) now end on the same count the joining Mac reads, from the flow: ClusterOnboardingDriver.stopEnding, asked about once a second off the console's thread (waitWithRows(ending:)). The baseline is the start's, taken in chooseAndServe and refreshed when the screen starts the pair again. pairServing's own pairStopped() check, which predates the PR and had the same flaw, is removed with the function. SF1: the two Macs took their baselines at different moments. The start now begins at its first step on the leading Mac, `copy` (before the download question) or `starting` (ClusterOnboardingLeaderStep.startBegun). chooseAndServe reads the count there, and the joining Mac counts the start as begun from that step too. SF2: a stop that took the command lock between the pre-start check and serve was undone by serve. OnboardingLive.localServe(unlessStoppedSince:) now compares the count under that lock. ClusterControlRequest.stopsBefore carries it for a forwarded start (an older leader ignores it, as before), and the flow uses ClusterOnboardingOperations.serveUnlessStopped. SF3: ProviderCoreTests (ClusterOnboardingStopsAskedTests, on the ClusterApprovalMacs fixture's leading Mac) cover a real localStop(asked:) counting while the pair's own stop doesn't, the status reply carrying the count (followerStatus, ClusterOnboardingLeaderStatus(reply:)), and a start refused after a stop. The leader-load check now fails without the flow's stop check: its wait answers only after 20 s. stop()'s routing and execute(.status) end to end stay untested, since they reach the host's real pairing. SF4: the red check holds every "Stopped" stretch for over 20 s (the download, a login after it with nothing published, the registration). So the review's mutant, the 20 s rule exempting downloading/copying, fails it now: checked on dev's sources with that mutant, the stop line comes in the registration stretch. SF5: docs and changelog say what counts: `darkbloom cluster stop`, and `darkbloom stop` or `restart` once the pair runs. Before that, `darkbloom stop` stops only its own Mac's. inference.md matches the code. Nits: stopping -> recordStop; the pre-start stop clears the published progress; the stop-count tests moved to their own file. Tests/ClusterOnboardingChecks/run.sh: 1969 passed, 0 failed (512 s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew-2042 r2) The second independent review of 7eddf21 (review-2042-r2.md) found these, now fixed: M1: the leader's test ignored a stop. It ended with "Serving" or "the test failed" while the pair was stopped and the joining Mac said the stop line. startOutcome now returns .stopped when the count grew, after the test (passed or failed) and after a registration that refused. M2: the leader's download or copy ignored a stop until it finished. move now asks the count about once a second off the console's thread (ClusterOnboardingLooker, shared with waitWithRows(ending:)) and ends at once with the stop line and ClusterOnboardingStopped.transferKeptLine. What arrived stays, and the downloader and the cable copy both resume. S1: localRegister started a pair stopped during its test again: a person's stop took the command lock first, then the registration's localServe undid it. It now refuses a pair whose saved start is off. That also covers releaseForSingleMac. S2: the single-Mac and version-split continues served with a plain serve and reset the baseline, swallowing a stop the joining Mac had already ended on. Both now go through startBothMacs (check, then serveUnlessStopped) with the start's baseline. Retry, a new start, reads its baseline before it serves. S3: the two Macs could count a stop near the start's first step differently. The step now carries the count it began with (ClusterOnboardingLeaderStep.stopsBefore, optional on the wire), and the joining Mac compares with it when present. S4: checks that fail without each part. The coordinator wait now ends on the count (its wait still runs), a stop at the test (passed or failed), a start refused under the lock, a stop at the single-Mac question, Retry as a new start, and the download ending at once with what stays. The download check also asserts the published step's count. Nits: a count unreadable at the start's first step is read again before serve; a refused forwarded start maps by its line; startBothMacs and stoppedEnding replace the copies. Tests/ClusterOnboardingChecks/run.sh: 1990 passed, 0 failed (514 s). CI on 7eddf21: all green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts; refactor pass (review-2042 r3) The third independent pass of 8689dc3 (review-2042-r3.md, APPROVE with should-fix) verified round 2. It ran 13 mutants, and its refactor pass is applied here. N1: Retry reset the leading Mac's count but kept the first start's step, so a joining Mac opened after Retry compared with the old count. Retry now publishes `starting` with the new start's count. N2: four mutants survived; each is killed now (mini runner): - E, the refused start mapped to its own ending: the check rejects the generic failure's indented line. - H, Retry's baseline: the retried wait takes 2.4 s, and the step carries the new count. - I, the version-split continue: a twin of the single-Mac check. - F, the joining Mac preferring the step's count: a follow whose first look is already past the leader's count. localRegister's guard stays covered by reading only. The fixture's registration fails at its fetch either way. Refactor pass: - R1: ProvisionOutcome.stopped is now .cancelled, beside .stopAsked. - R2/R3: one stopAsked(since:) replaces four copies and a local closure. - R4: stopEnding is now endsOnStopAsked. - R5: provision/move take the baseline explicitly (the blocker path passes nil). - R6: localRegister reads the record once. - R7: the looker's doc. - R8: no looker, and no status read, without a count. - R10: ClusterApprovalMacs.startedLeaderService is shared by ClusterServiceRestartingStopTests and ClusterOnboardingStopsAskedTests. - Left, as the pass advised: R9, R11, R12, R13. Tests/ClusterOnboardingChecks/run.sh: 1999 passed, 0 failed (522 s). CI on 8689dc3: all green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
This was referenced Nov 13, 2026
This branch was successfully 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.
Draft, for 0.10.13 (into
dev). Branched fromdevatd6f6bc409c.Commits:
a5ae121d86: the red check.8e4f828bae: the fix.7eddf2187d: the independent review's points, round 1 (see "Refactor pass").8689dc3f96: round 2's points.09ba436cdc: round 3's should-fix points and the refactor pass.Why
The report came from an external provider, 2026-11-12 ~20:46Z. They set up two Macs with
darkbloom cluster, almost certainly on 0.10.12 (any of 0.10.9–0.10.12 behaves the same). The leading Mac downloaded the chosen model, and the joining Mac's screen ended with:Nobody ran
darkbloom cluster stop.Root cause. File:line at
dafd15c658(0.10.12); this area is identical ondev.ClusterOnboardingFollow.swift:221-229,stoppedHoldSeconds = 20at:56). This came in with b62750d, in 0.10.9.localStatussays so whileleadership.servingis off (ClusterOnboardingLive.swift:2460-2461).localServeturns it on (:1688).serve(ClusterOnboardingFlow.swift:2893-2964), and publishesdownloading/copyingevery second meanwhile (ClusterOnboardingLive.swift:1298,:1209,:1245).ClusterOnboardingFollow.swift:257-267). It prints "4/4 Start" at the first one (:262).serve.registering,:1458), if it took 20 s;ClusterService.swift:1542), if it took 20 s;What changes
The fix uses an explicit signal instead of the status' words.
darkbloom cluster stopon either Mac, anddarkbloom stoporrestartonce the pair runs. All of these reachOnboardingLive.stopor the forwarded.stop. Before the pair runs,darkbloom stopstops only what runs on its own Mac, so it isn't counted.ClusterSetupRecord.stopsAsked,OnboardingLive.recordStop).ClusterControlReply.stopsAsked,ClusterOnboardingLeaderStatus(reply:)). It is 0 before the first stop and nil from an older build; an older Mac ignores the field.copybefore the download question, orstarting(ClusterOnboardingLeaderStep.startBegun). Both Macs compare the count with the one they read then:ClusterOnboardingFollowedStop). A look that read no count tells nothing, a stop made at the model list doesn't count, and a lower count becomes the new baseline. The "Stopped" rule and its 20 s hold are removed.ClusterOnboardingLeaderStep.stopsBefore).ClusterOnboardingDriver.stopEnding, asked about once a second off the console's thread byClusterOnboardingLooker). Before, the load wait ignored stops (15 minutes, then ✗ with Retry). The coordinator wait ended on any turned-off start, including the cluster service's approval restart, which this removes along withpairStopped.startBothMacs).OnboardingLive.localServe(unlessStoppedSince:),ClusterControlRequest.stopsBefore). So a stop that took the lock first is never undone.localRegister).Behaviour:
flowchart LR subgraph Before B1["leader downloads the model; its status reads Stopped. until serve"] --> B2["joining Mac: Stopped held 20 s once a phase was seen"] B2 --> B3["joining Mac ends: Stopped by darkbloom cluster stop, nobody ran it"] B4["real cluster stop during the download"] --> B5["leader starts both Macs after the download anyway"] B6["real cluster stop during the load"] --> B7["leader waits 15 min, then ✗ with Retry"] end subgraph After A1["leader downloads the model; status reads Stopped."] --> A2["joining Mac follows the start to the leader's outcome"] A4["real cluster stop at any point of the start"] --> A5["leader counts it: stopsAsked + 1"] A5 --> A6["joining Mac: count grew since the start began, ends at once"] A5 --> A7["leader: ends its waits at once; after a download or copy, starts nothing"] endCode flow:
flowchart LR subgraph Before S1["OnboardingLive.localStop: serving = false"] --> S2["localStatus: Stopped"] S2 --> F1["followStart: lastStatus hasPrefix Stopped and started or start, for 20 s"] F1 --> F2["ClusterOnboardingStopped.line"] S1 --> P1["pairServing: pairStopped"] end subgraph After T1["OnboardingLive.stop / forwarded .stop"] --> T2["localStop asked: true"] T2 --> T3["recordStop: serving = false, stopsAsked + 1, one write"] T3 --> T4["status reply: stopsAsked"] T4 --> G1["followStart: begun at copy/starting step, ClusterOnboardingFollowedStop.look"] G1 --> G2["ClusterOnboardingStopped.line"] T4 --> W1["chooseAndServe: stopsBefore at the first step; waits: stopEnding"] T3 --> C1["localServe unlessStoppedSince, under the command lock"] endCompatibility
stopsBefore. An older Mac ignores both.Validation
aStatusThatReadsStoppedThroughADownloadIsNoStopalone (a5ae121d86) fails ondev's sources exactly as reported: "4/4 Start", then the stop line at 20 s, exit 1.onboarding checks: 1928 passed, 2 failed, both in that check.bash provider-swift/Tests/ClusterOnboardingChecks/run.shat09ba436cdc: 1999 passed, 0 failed (local, Swift 6.4.2, 522 s;dev: 1926 passed, 453 s). CI is all green on the head09ba436cdc(run 43328469030: onboarding checks 1999 passed, 0 failed), as on7eddf2187dand8689dc3f96. The newClusterOnboardingStopsAskedTests(4 of 4) andClusterServiceRestartingStopTestspassed in Provider Unit Tests shard 2.dev's sources, the 20 s rule exemptingdownloading/copying→ the red check fails: the stop line comes in the registration stretch;aStopFromAnywhereEndsTheLeadersLoadAtOncefails;WaitHonestChecks.swift):ClusterOnboardingStopsAskedTests):stopsBeforeon the wire, in both directions;recordStop;ClusterApprovalMacsfixture's leading Mac: a reallocalStop(asked:)counts, the pair's own doesn't, andfollowerStatuscarries the count;localServe(unlessStoppedSince:)refuses a start after a stop and leaves the pair stopped.make changelog-checkOK.scripts/docs-impact-check.py --base origin/devOK.scripts/check-date-comparisons.pyOK.stop()'s routing tolocalStop(asked: true), andexecute(.status)end to end. Both reach the real pairing store or ask the other Mac, so a unit test would touch the host's own pair.localRegister's new guard. The fixture's registration fails at its fetch either way.Known limitations
darkbloom restartduring an onboarding start counts as a stop. Both screens end with the stop line whilerestartstarts the pair again. The old code did the same if its drain took 20 s. Not counting it would need a separate stop operation on the wire.serving-based stop insideOnboardingLive.waitReadyorpairServingwould pass every check.ClusterOnboardingLive.swiftisn't compiled by the onboarding checks, and a unit test there would reach the host's real pairing. Reading the code is the guard.releaseForSingleMac(start --soloreleasing a leftover part) turns the pair off without counting. It no longer ends the leader's coordinator wait with the stop line; that wait goes on to its reasons or its bound.testServing), not a start, has no stop check. This predates the PR.Refactor pass
Independent review-only pass with fresh context:
opencode run -m anthropic/claude-opus-5-5 --auto --title review-2042, in its own detached worktree at8e4f828bae. No provider build, commits or GitHub writes. It ran the onboarding checks: red ata5ae121d86, green at the head.Verdict on
8e4f828bae: REQUEST CHANGES. It confirmed the root cause and found the joining Mac's fix sound. All of its points are addressed in7eddf2187d:pairStopped()check inwaitReadyended the leader's load wait on stops nobody asked for. The waits now end on the count from the flow (stopEnding), andpairServing's olderpairStopped()check is removed too.servecould be undone by it.localServe(unlessStoppedSince:)now checks the count under the command lock.recordStop, the PR text, and clearing the published progress.Second pass, on
7eddf2187d(--title review-2042-r2, fresh context): REQUEST CHANGES. It found every round 1 point fixed. SF1 and SF3 were only partly fixed, and it found new gaps on the leading Mac, all addressed in8689dc3f96:Third pass, on
8689dc3f96(--title review-2042-r3-refactor, fresh context): an independent verification and the repository's refactor pass (AGENTS.md), review-only.Verdict: APPROVE with should-fix. It ran 13 mutants with the mini runner, and the full checks at the head gave 1990 passed. Applied in
09ba436cdc:retryIsANewStartasserts the step.ProvisionOutcome.stopped→.cancelled.stopAsked(since:)replaces four copies and the local closure.stopEnding→endsOnStopAsked.provision/movetake the baseline explicitly; the blocker path passes nil.localRegisterreads the record once.ClusterApprovalMacs.startedLeaderServiceis shared withClusterServiceRestartingStopTests.provisionswitches;localRegister's guard. On the fixture, the registration's fetch fails the same way, so removing the guard passes. Reading the code is the guard.