Skip to content

cluster: Qwen TP decode census, a rows check that reproduces the 27B row-count bug, and the finiteness check in the selection sum - #1721

Merged
davidtai merged 11 commits into
devfrom
perf/qwen27-tp-decode-loop
Nov 3, 2026
Merged

davidtai merged 11 commits into
devfrom
perf/qwen27-tp-decode-loop

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Instruments the Qwen3.8-27B tensor-parallel row-count gate, adds a check that reproduces it on the real weights on one
Mac, and folds the decode step's finiteness check into the selection's sealed sum. This is workstream WS-1 of the
Qwen27 pair speed plan; the fix for the row-count dependence comes in a stacked PR (see Notes).

  • Decode census: each rank logs its decode routes once per loaded model, on its first served request
    (darkbloom-qwen-tp-decode-census-v1). It lists every projection's route and layout per row count, the attention and
    norm routes, and the arithmetic switches in force. It records host values only; no prompt or token data.
  • Rows check: QwenTensorParallelRowsCheck checks bitwise that a row decodes the same bytes alone (P1), in cohorts
    (PB: 2, 4 and 8 rows with joins and a leave, across KV segments, observed by an assistant) and in verify windows (W:
    singleton and cohort). It runs in one process (a GPU-gated test) and as two processes over the loopback ring or socket
    (darkbloom-cluster-tp-check qwen-rows synthesize|run). It can also load a registered checkpoint directory.
  • What it found:
    • At the registered per-rank widths with random weights (4 layers), every comparison is bitwise equal, and every
      decode projection takes the exact kernel at every row count (aqv=24 partial=8 mlx=0).
    • On the registered checkpoint (all 64 layers, real weights; two ranks on one Mac over the sealed loopback ring,
      2026-11-01 22:23–22:28Z), every multi-row path differs from P1, starting at step 1–2, in logits and history, on
      both ranks: 379 differing comparisons out of 336 digests. The census is still aqv=369 partial=128 mlx=0.
    • So the pair's plain c8 non-equality is a real row-count dependence, reproducible without the pair. It depends on
      real values or depth, and random weights miss it.
  • Selection's finiteness check moves into the sealed sum (class A). Greedy rows count non-finite logits as a third
    word per rank beside the maximum and first index, matching the assistant's greedyChoices. Sampled rows count their
    gathered rows in the same evaluation.
    • A non-finite logit on either rank now fails both ranks in the same step, before any token is chosen. Before, that
      rank failed alone and its peer hung in the selection sum.
    • Each decode step drops one host synchronization (the separate isFinite read).
    • Selected tokens are unchanged.

Linked issue

None. Owner direction for 0.10.7 ("Qwen 27B on pairs should be much faster; fix it where it uses tensor parallelism").
The row-count dependence blocks width 8 and the public assistant (#1718). Evidence: mainnet/pair-window-1-results.md
and mainnet/overnight/qwen27-ws1.md.

Test plan

All runs used nice -n 19 and --jobs 6, with synthetic weights unless stated, on loopback only.

  • GPU focused suites (QWEN_TP_BATCH_GPU=1 QWEN_TP_MTP_GPU=1 MLX_QMV_BATCH_INVARIANT=1): 56 tests in 6 suites
    (QwenTensorParallelBatch{Driver,Session,MTPTransition,MTPWindow}Tests, QwenTensorParallelExactVectorsTests,
    QwenTensorParallelRealGeometryRowsTests).
  • CPU suites (Session, Driver, RealGeometryRows, FencedSum): 36 tests in 4 suites, including:
    • the rows check's unit test;
    • nativeNonfiniteRowsOnOneRankFailBothRanks: red against the previous selection, where the process trapped at the
      wire's 30 s peer deadline; green after;
    • the new nativeNonfiniteSampledRowsOnOneRankFailBothRanks. Every non-finite case requires selection's own error on
      both ranks.
  • QWEN_TP_REAL_GEOMETRY_GPU=1 with the worker's environment: 0 of 336 reference digests differ on both ranks.
  • tp-check qwen-rows run on the synthetic real-geometry fixture, over --backend ring (native and
    sealed-bench) and --backend socket: 0 differ on both ranks.
  • tp-check qwen-rows run on the registered checkpoint (two ranks on one M5 Ultra, ring, sealed-bench):
    reproduces the row-count dependence, as above. This is the expected finding, not a regression of this PR; the fix is
    stacked on it.
  • tp-check run --mode tp --backend ring (native and sealed) equals simulated and full (24/24 tokens).
  • PlacementChecks (1,417); make docs-impact-check BASE=origin/master, make docs-check, make changelog-check.
  • Not run: the real pair, JACCL, speed (the saved synchronization is not measured), qualification records.

Components touched

  • provider-swift (Swift CLI)
  • native runtime / MLX: libs/darkbloom-cluster (Qwen TP batch session and executor), the worker's
    TensorParallelCheck
  • landing (Next.js)
  • enclave (Swift)
  • CI / provider release
  • docs

Protocol / interface changes

  • No coordinator, wire or SDK change.
    • Within a pair: the greedy selection's sealed all-sum carries six words a row instead of four. The decode load
      agreement gains qwen-tensor-parallel-selection-nonfinite-in-sum-v1, so a rank of an earlier build refuses to load
      beside this one.
    • New: one rank log line (darkbloom-qwen-tp-decode-census-v1) and one developer subcommand
      (darkbloom-cluster-tp-check qwen-rows).
  • Yes — described above and matching side updated

Documentation impact

  • Canonical documentation updated:
    • docs/architecture/inference.md § "Qwen tensor-parallel request-owned lanes": the selection sum, the agreement
      field, the census and the rows check with their limits;
    • docs/developer/test.md: QWEN_TP_REAL_GEOMETRY_GPU=1, the qwen-rows commands, and the switch the MTP GPU runs
      need.
  • No documentation needed — reason:

Changelog

  • Added changelog.d/qwen27-tp-decode-loop.md. It leads with the visible change: on a non-finite logit, both Macs
    fail at once instead of one hanging. Ran make changelog-check.
  • No user-visible change, or an explicitly authorized release/history change.

Notes for reviewers

  • The fix is a stacked PR. It is being bisected now on the registered weights, layer by layer and then op by op,
    through a per-layer observer in the fused-residual forward (Qwen35TextModelInner.cbv2ForwardNormalized). It will
    make every row count and window position produce the one-row step's bits, with no precision loss against one Mac, and
    add a synthetic test with real-like value statistics so CI guards it. Width 8 and cluster: let a build declare Qwen3.8-27B's tensor-parallel assistant public (none declared yet) #1718's declaration evidence wait
    for it.
  • The fixture: the registered 27B at its real per-rank widths (hidden 5,120, MLP 17,408, 12/2 attention heads of 256,
    8/24 GDN heads of 128, 124,160 head rows a rank), with 4 layers (3 GDN + 1 attention) and random affine 4-bit weights,
    group 64, with BF16 scales, biases and norms.
  • Census limits (documented): the SDK runs each Gated DeltaNet layer's four input projections as one fused call, so
    the layouts listed for those four shapes are not the dispatched shape's, though the route is right. swiglu_fused_vectors
    applies only while the SDK's decode fusions are on. Routed experts' switch projections aren't listed. Only depth-3
    windows are described. The qualification pair driver's line filter drops the census, so read it from the rank logs.
  • qwen-rows run on a registered checkpoint bypasses the product's verified load (hashes, inventory, memory gate).
    The ranks agree on configuration and reduction, not on weights. It is a developer check.
  • Selection side effects:
    • A step that fails the finiteness check has already committed its native state. The batch then fails and retires
      every lane, as before, and nothing is published or captured.
    • The load-time share probe no longer times the finiteness read, on both ranks equally.
  • Pre-existing: QwenTensorParallelBatchMTPWindowTests.sharedWindowCallsKeepEveryRowsQuantizedArithmetic needs
    MLX_QMV_BATCH_INVARIANT=1 in the test process (cluster processes set it at start). It fails the same way on
    origin/master without it.
  • Merge with cluster: Qwen tensor parallel keeps prompt prefixes to the request's context, as one Mac does #1720: git merge-tree reports no conflicts; the hunks in the batch session and executor don't overlap.

Before And After

Behavior

flowchart LR
  subgraph Before["Before"]
    B1(["pair loads"]):::cfg --> B2["darkbloom-aqv-kernel-v1<br/>(arithmetic, layouts)"]:::plain
    B3(["c8 differs from solo<br/>on the real pair"]):::bad --> B4{"which route or row count?"}:::chk
    B4 --> B5["synthetic checks:<br/>tiny / 4,608-wide fixtures,<br/>~100-token contexts"]:::plain
    B6(["non-finite logit<br/>on one rank"]):::bad --> B7["that rank fails alone;<br/>peer waits in the<br/>selection sum"]:::bad
  end
  subgraph After["After"]
    A1(["first served request"]):::cfg --> A2["+ darkbloom-qwen-tp-decode-census-v1:<br/>every projection's route,<br/>attention, norm, switches"]:::good
    A3(["row-count gate"]):::chk --> A4["QwenTensorParallelRowsCheck"]:::good
    A4 --> A5["registered widths, random weights:<br/>P1 = PB = W bitwise"]:::good
    A4 --> A6["registered checkpoint, one Mac:<br/>PB and W differ from P1<br/>(reproduced; fix stacked)"]:::bad
    A7(["non-finite logit<br/>on one rank"]):::chk --> A8["both ranks fail in the<br/>same selection step;<br/>no token published"]:::good
  end
  classDef cfg fill:#e8f0fe,stroke:#3367d6,color:#111;
  classDef chk fill:#fff4e5,stroke:#e8710a,color:#111;
  classDef plain fill:#f1f3f4,stroke:#5f6368,color:#111;
  classDef good fill:#e6f4ea,stroke:#188038,color:#111;
  classDef bad fill:#fce8e6,stroke:#c5221f,color:#111;
Loading

Code

flowchart TB
  subgraph Before["Before"]
    b1["NativeBatchExecutor"]:::code --> b2["(no route log)"]:::plain
    b3["TensorParallelCheck main"]:::code --> b4["run / compare / record /<br/>synthesize / qwen-prefill"]:::plain
    b5["BatchSession.decode"]:::code --> b6["validateLogits:<br/>all(isFinite).item (sync)"]:::plain
    b6 --> b7["select: sum of<br/>(max, index) per rank (sync)"]:::plain
  end
  subgraph After["After"]
    a1["NativeBatchExecutor, first request"]:::code --> a2["BatchSession.logCensusOnce<br/>→ censusLine (host only)"]:::good
    a3["TensorParallelCheck main"]:::code --> a4["qwen-rows → QwenRowsCheck"]:::good
    a4 --> a5["QwenTensorParallelRowsCheck.run<br/>(per rank; missing digests count as differences)"]:::good
    a6["RealGeometryRowsTests"]:::code --> a5
    a8["BatchSession.decode"]:::code --> a9["validateLogits:<br/>shape, dtype"]:::good
    a9 --> a10["select: sum of (max, index,<br/>non-finite count) per rank (sync)<br/>agreement: …-nonfinite-in-sum-v1"]:::good
  end
  classDef code fill:#e8f0fe,stroke:#3367d6,color:#111;
  classDef plain fill:#f1f3f4,stroke:#5f6368,color:#111;
  classDef good fill:#e6f4ea,stroke:#188038,color:#111;
Loading

Legend: blue = entry points, green = added or changed, grey = unchanged paths, orange = checks, red = the open
problem and the removed hang.

Refactor Pass

An independent refactor/review pass (mainnet/overnight/refactor-qwen27-ws1.md) found the D1 slice exact and safe, and
the census and rows check sound. It made six fixes, none of which changes a logit or a selected token
(86d479a44, 53faf8e8d):

  1. Load agreement: the selection frame changed size without an agreement field, so a mixed-build pair could meet in
    sealed sums of different lengths, where one side could wait for bytes. Added
    qwen-tensor-parallel-selection-nonfinite-in-sum-v1.
  2. Tests: a new sampled-row non-finite test; all three non-finite cases require selection's own error on both ranks.
  3. Census: renamed to darkbloom-qwen-tp-decode-census-v1 like every always-on runtime line; its limits are
    documented; the docs say it logs when it first serves.
  4. Rows check: a digest missing from its reference now counts as a difference. Non-finite rows are marked, and the
    runner refuses to report only after both ranks' last collective, so a throw can't strand the peer.
  5. Tool: qwen-rows synthesize --layers must be an integer 1–8.
  6. Docs and changelog: the agreement field, the census and rows-check limits, the test switches, and the visible
    behavior change leading the changelog.

The parent reran make changelog-check, make docs-impact-check BASE=origin/master and make docs-check on head
53faf8e8d.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

davidtai and others added 11 commits October 30, 2026 19:03
dev carries one commit that lives on dev alone (431a93d, docs/developer/
build.md "The dev branch"): a plain swift build defaults to
DARKBLOOM_RELEASE_ENVIRONMENT=dev, so it talks to the DevNet coordinator.
Merging dev into master would carry that default to master. This commit,
on the dev-to-master release snapshot only, sets the default back to prod
in Package.swift and in the build-environment test, as on master.

Released binaries do not change either way: every release lane and CI set
DARKBLOOM_RELEASE_ENVIRONMENT explicitly.

On the next master-into-dev sync, revert this commit on the sync branch so
that dev keeps its dev default.
Release dev into master: two-Mac cluster serving, cluster approvals, CI shards (merge commit, not squash)
…, heartbeat fix (#1690) and the pair fixes (#1694)

* cluster: runtime facts v2 name each model's pair-serving grant; release modes

`darkbloom cluster runtime-facts` prints schema darkbloom_cluster_runtime_v2:
the v1 digests, unchanged, plus each model's pair_serving_grant. The grant is
the public grant a member of the same build reports for the described artifact
(ClusterPairServingGrants.grant), null when there is none: its mode families
sorted by byte, and evidence_sha256, the SHA-256 of the records it rests on as
canonical JSON Lines (ClusterPairServingGrant.records, evidenceSHA256). The
canonical encoder writes null rather than omitting it; the strict decoder
init(canonical:releaseVersion:) refuses unknown, missing or repeated fields,
schema v1, and a model whose derived IDs (release/<version>/<model>/s2, plus
/grant for a granted model) exceed 128 bytes. The model bound is 64.

The release modes come back (ClusterRuntimeApprovalFacts+Release.swift):
--list-release-models prints the models this build qualifies on a cluster, and
--app A --release-candidates DIR describes, for every listed artifact and every
catalog model ID among its candidates, the first candidate the app's worker
describes as that model. A listed model with no candidate is left out (the
environment's catalog lacks it); the output must read back under the strict
decoder for this build's version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): every lane computes cluster_runtime; sent only when enabled

The release lane (dev branch, staging, prod) computes the cluster runtime facts
of its final signed, notarized app with that app's own CLI and worker, in the
step "Compute cluster runtime facts from the final signed app" of
build-and-release: after the final hashes, with no secret (the signing
keychain is deleted and the identity proven gone first), from the target
environment's public catalog and model CDN (provider-cluster-runtime-models.py
--environment). A listed model that catalog lacks is left out and named. The
job summary shows the block and a run artifact retains it in every lane.

The payload carries it (prepare --cluster-runtime) only when CLUSTER_RUNTIME_SEND
is true: the run registers a release and the environment's repository variable
DEV_, STAGING_ or PROD_CLUSTER_RUNTIME_ENABLED is exactly 'true'. Unset, prepare
runs today's command and the payload is byte for byte today's (pinned by digest
in the tests), and a facts failure only warns (continue-on-error). Set, a
failure fails the release before staging and registration. validate accepts a
valid block in every environment and refuses an invalid one and one whose
derived approval or grant IDs exceed 128 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(release): the registration carries cluster_runtime in its canonical form

Contract A defines the block as canonical JSON (keys sorted by byte, no
whitespace, no trailing newline). prepare now refuses a block file that is not
canonical, and the registration body is encoded without whitespace when, and
only when, it carries the block, so the coordinator receives the block's
canonical bytes whether it parses them or compares them. A body without the
block is byte for byte the one sent before (pinned in the tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cluster: no derived grants; the owner's public models and their parity qualifications

Owner decisions (jonathan308, 2026-10-31): "public traffic should not be
manual"; "only glm 5.3 flash should be serving public & qwen 3.8 27b they are
both good to go they should be approved for serving".

The v2 facts no longer carry pair_serving_grant. A coordinator grant restricts
its approval to the families it names, and GLM-5.3-Flash's bundled records hold
only a pipeline_v1 run, so a derived grant would stop the GLM tensor-parallel
pairs M5 members serve today. ClusterPairServingGrants is back to dev apart from
the public-traffic line below.

ClusterPublicModels (beside the grants, reviewed in PRs) declares exactly
GLM-5.3-Flash (registered_glm53_flash, glm-5.3-flash) and Qwen3.8-27B
(registered_qwen38_27b, EigenLabs/Qwen3.8-27B-4bit-mtp): tensor_parallel on
schedules 1 and 2, evidence placement two Apple M5 Ultras (applegpu_g17d, NAX
on) on macOS 27.0, cuts [], equal shares, qualified 2026-10-31T00:00:00Z, and
the SHA-256 of the evidence document
docs/reports/2026-10-31-public-cluster-models.md (a test holds them equal). It
also names the artifact the runtime registers for each model.

Each model's parity_qualifications is [] unless the declaration names its
runtime model, catalog ID and artifact; then one object per declared family and
schedule: numerics classes of the evidence placement with the block's metallib
(g17d-nax1-mlx-98bab9d7-macos27.0 on 0.10.5-dev.branch.15 and .16), cuts, mode,
tensor_parallel_shares null, promotable, not diverged, evidence_sha256,
qualified_at and the request envelope (ClusterPublicModels.requestEnvelope:
sampling, tools, 1,048,576 tokens each way, vision and video as the candidate's
catalog entry lists image and video; text only without one). Release
candidates carry that entry (catalog.json). The strict decoder and validate
check the qualifications as a coordinator does and bound the derived IDs
release/<version>/<model>/s<s>/q<n>. The setup's public-traffic line says a
declared model is qualified in its declared family without a record of it.

The GLM block the installed 0.10.5-dev.branch.16 app computes from DevNet's
catalog is pinned as a golden. The placement check runner compiles the new file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): candidates carry their catalog entry; validate parity qualifications

provider-cluster-runtime-models.py saves each candidate's catalog entry (its id
and input_modalities, canonical, catalog.json) beside its manifest and
config.json, so the released app's own CLI gives a declared model's request
envelope the media the target environment's catalog lists; a malformed modality
list fails that entry, none listed means text only.

provider-release-publication.py checks parity_qualifications in place of
pair_serving_grant: the exact fields, schedule 1 or 2, two numerics classes,
the cuts the mode has, null shares, flags, an instant the coordinator accepts,
the envelope bounds, video only with vision, no placement twice, at most 8; and
bounds every derived approval and qualification ID
(release/<version>/<model>/s<s>/q<n>) at 128 bytes. The pinned GLM block is
accepted. Docs and the changelog fragment follow; the release step's comments
name the parity qualifications.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): the service's part beats into its own heartbeat file

Under its supervisor the cluster service beats every 2 s into the file
DARKBLOOM_CLUSTER_MEMBER_HEALTH_FILE names. Its part was started with the
service's environment unchanged, and a coordinator-paired part
(`start --foreground --cluster-member`) beats every 5 s into the file the
same key names, with its own pid. The supervisor's liveness guard reads
the file every 15 s and treats a beat of another pid as no beat. The three
periods are near multiples of each other, so their phases drift by
milliseconds per probe: once the part's beat was the last write at six
probes in a row, the guard recycled a healthy service ("heartbeat missing
for 75 s while its process is alive") and the pair dropped and registered
again. Seen on a DevNet leader about every 15 minutes.

The part now gets the service's environment with the key pointing at
part-health.json beside the service's files. The key stays set, so the
part still waits for its registration as a supervised member does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: the cluster service part's own heartbeat file

Docs Impact failed: ClusterService.swift changed without its mapped
architecture document. The cluster serving section now says which file the
service and its part each write their heartbeat to, and why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(cluster): keep the approval fixture alive through the part heartbeat tests

Both new tests failed on CI at every run: the member part never started.
They dropped the ClusterApprovalMacs fixture (`let (_, service, parts)`),
whose deinit removes both homes, so the leader's saved setup was gone
before the service's first tick. The fixture now lives until the last
check, as in the other tests of the suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cluster: pair-serving grants again, beside parity qualifications

David's finding: a pair member reports only hardware capabilities
(DistributedServingEligibility.memberCapabilities: apple_m5 on an M5), and
without a pair-serving grant the coordinator holds each member to the
model's single-Mac requirements (providerMeetsServingRequirementsLocked),
which no member meets for GLM-5.3-Flash (mlx_nax, glm5_next_v1) or
Qwen3.8-27B (mlx_nax). No pair forms without a grant, so every model in the
v2 facts again carries pair_serving_grant (null, or exactly evidence_sha256
and mode_families) beside parity_qualifications.

A declared public model's grant names its declared families with the
evidence document's SHA-256. Owner ruling 2026-10-31 ("It should be tensor
or pipeline obviously but that shouldn't matter for the coordinator"):
ClusterPublicModels declares pipeline and tensor_parallel for both
GLM-5.3-Flash and Qwen3.8-27B. Any other model's grant is the one this
build's bundled records give its artifact (ClusterPairServingGrants.grant),
with the SHA-256 of those records' canonical JSON Lines
(ClusterPairServingGrant.records, evidenceSHA256); null when they grant none.

The declaration's families drive the parity qualifications: one promotable
record per family and schedule, pipeline first (byte order), so each
approval's q1 is the pipeline and q2 tensor parallel. A pipeline is
pipeline_v1 cut at [num_hidden_layers / 2] of the model's config.json (top
level, else text_config: GLM 45 -> [22], Qwen3.8-27B 64 -> [32]); without a
layer count its records are left out and the command says so on standard
error. An envelope admits media only where the placement serves media
(ClusterModelFeaturePolicy.mediaContract): tensor parallel follows the
catalog entry, a pipeline is text only.

The strict decoder and validate check the grant (1 to 4 known families in
byte order, nonzero evidence) and bound release/<v>/<M>/s<s>/grant at 128
bytes beside the approval and /q<n> IDs. The setup's public-traffic line
follows the declaration (pipeline and tensor parallel); tests about the
records alone pass publicModels: []. The evidence report says the owner
approved both modes for both models, that GLM-5.3-Flash's bundled records
hold a pipeline_v1 run while its tensor parallel rests on the owner's
decision and the DevNet serving results, and why grants are needed; its
SHA-256 is re-pinned. The GLM golden is re-pinned from the installed
0.10.5-dev.branch.17 app, which replaced branch.16 on this Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): validate pair-serving grants and their derived IDs

provider-release-publication.py checks each model's pair_serving_grant
again (null, or exactly evidence_sha256 and 1 to 4 known mode_families in
byte order) beside its parity_qualifications, adds the grant's evidence to
the digests it checks, and bounds release/<version>/<model>/s<1|2>/grant at
128 bytes with the approval and /q<n> IDs. Its tests cover the grant rows,
the ID bound for a model with neither, qualifications only, a grant only and
both, the /grant and /q<n> IDs, and the branch.17 GLM golden (q1 the
pipeline, text only; q2 tensor parallel).

The docs (configuration reference, release runbook, inference architecture,
test guide), the changelog fragment and the release step's comments describe
the grants and why pairs need them, both declared families, the pipeline
cut, the per-placement media and the q1/q2 order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* release(publication): refuse a registration body over the coordinator's 64 KiB

The coordinator reads POST /v1/releases under MaxReleaseRegisterBodyBytes
(64 KiB, as http.MaxBytesReader applies it), the same bound as the
cluster_runtime block's own, so a block within its bound could take the body
over the limit and fail only at publish, after R2 staging. validate (in
prepare, stage and publish) now refuses a payload whose registration body
exceeds 65,536 bytes, naming its size and the limit. One function
(registration_body) builds the bytes it sizes and the bytes registration
sends, so they cannot differ.

The test grows a valid block to a body of exactly 65,536 bytes (accepted)
and 65,537 (refused before staging, with no payload written), refuses the
same limit without a block (release notes), and checks that registration
sends the sized bytes. Independent review N1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): the declared placement is evidence, not a limit; catalog room

Independent review fixes (S1, S2, N2, N3, N4, N7, N10, N15 wording).

The configuration reference, the release runbook, the inference page and
the changelog say how a coordinator applies the declared qualifications: a
promotable record qualifies its approval's whole mode family on any
numerics classes, cuts and shares within the envelope (parityQualification,
platform df61dd6f9), so public traffic for GLM-5.3-Flash and Qwen3.8-27B is
admitted in pipeline and tensor parallel on any Apple silicon pair; the
declared placement names the evidence, not a limit. No pipeline ran on two
M5 Ultras and GLM-5.3-Flash has no tensor-parallel cross-cable record: both
rest on the owner's decision and the DevNet serving results. GLM-5.3-Flash
serves only the serial schedule, so its schedule 2 entries are inert. The
digest-pinned evidence document is unchanged.

The runbook adds the catalog-room precondition (64 approvals with the
operator's own, 2 per model per release, newest release whole first, older
releases left out first), DevNet's numbers on 2026-10-31 (26 served, 4
catalog models: 8 per release, the 4 newest fit), the log check after the
first registration (release cluster approvals omitted), the recovery when a
facts failure stops a release, "set to true" (GitHub compares
case-insensitively; also in the workflow comment), the release-handler link
re-pinned to platform df61dd6f9, and "a catalog model ID of a listed
artifact". The inference page notes that a grant also bounds owner-formed
sessions to its families.

The grant's evidence is the passing records it is computed from, without a
pass a divergence of the same shape contradicts: said so in the code
comment and the reference, with a test row for a family still granted by
another pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): release facts leave out another model's catalog ID of a shared artifact

Production's catalog lists the Gemma 4 26B artifact a4722b60 twice:
gemma-4-26b and gemma-4-26b-8bit. The build registers two runtime models
on it that only the manifest tells apart (registered_gemma4_26b and
registered_gemma4_26b_8bit), and only the 8-bit one is qualified on a
pair, so only it is a listed release model. ClusterRuntimeApprovalFacts
.release required every catalog model ID of a listed artifact to be
described as the listed model, and the worker describes gemma-4-26b's
manifest as registered_gemma4_26b. Run against production's catalog and
CDN, the release's facts step therefore failed ("Qualified cluster models
the release cannot describe: gemma-4-26b"), and a production release with
PROD_CLUSTER_RUNTIME_ENABLED=true would stop after signing.

A catalog model ID whose candidates the worker describes only as another
registered model is that model's: a member that installed it runs as that
model, which this release does not qualify. It is now left out and named
on standard error (note: left out, the catalog model ID of another
registered model). A catalog model ID of which the worker describes no
candidate at all still fails the step, and so does an empty result, whose
message now names what was left out.

The new test builds production's shape from the checked-in metadata
fixtures (gemma-4-26b and gemma-4-26b-8bit, one configuration): it fails
on the previous code with the production error and passes now; a second
test checks the note in both directions. The runbook's release step and
the configuration reference state the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(cluster): refactor pass on the release facts fix

Behaviour-preserving cleanup of 35f7b9f, from the dedicated refactor
pass that AGENTS.md requires before the pull request opens. The facts
block, --list-release-models and every message and note stay byte for
byte the same.

- ClusterRuntimeApprovalFacts.release: the left-out list holds the note
  lines it names (leftOut) instead of a list called othersCatalogIDs that
  held reason strings and was mapped to those lines afterwards. The doc
  comment says "whose candidates the worker describes only as another
  registered model", as the docs do, and that the empty-result error
  names what was left out.
- ClusterRuntimeFactsCommand: one note(_:) writes "note: <line>" to
  standard error, for the declared families without a qualification and
  for the catalog IDs release(note:) leaves out, instead of a second copy
  of that format in a closure. The command's doc comment names both.
- ClusterRuntimeApprovalFactsTests: the "another" case of
  releaseNamesEveryCatalogModelItCannotDescribeAndRefusesAnEmptyResult now
  passes through the empty-result error, which names the left-out ID; it
  checks that message's prefix as well as the refusal it already checked.
- provider-release.md, release step 6: "every catalog model ID of a listed
  artifact gets one entry" contradicted the exception the fix added two
  sentences later. It now reads "every catalog model ID of a listed
  artifact that it describes as the listed model gets one entry"; the rest
  of the step is only rewrapped.
- configuration.md: the fix's paragraph is rewrapped (one 108-column
  line); no word changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): Qwen3.8 27B pairs register with the coordinator by default

With the default [backend] mtp_mode = "auto", the guided setup planned
Qwen3.8 27B tensor parallel with the model's embedded speculative
assistant, which a setup saved for coordinator pairing may not carry
(ClusterConfiguration.validate). The leader's check of a coordinator's
approval ran only the attachment's own checks, so it stopped both parts
and sent the approval, and the other Mac refused it at its save ("A
tensor assistant requires Qwen TP on a row with an inline head, serial
prefill and a local cluster setup"). The pair served on the leader's
local API only, while the setup said it was qualified for public
traffic (finding F1 of the 0.10.6 two-Mac proof).

The assistant stays local-only: no parity qualification covers its
verify windows. The bundled tensor-parallel records of the 27B predate
it, and neither the records, the release's cluster_runtime block nor a
pair's registration has a speculation field.

- The onboarding plans for how the cluster serves: through Darkbloom,
  auto discovers like off (ClusterPlacementTensorAssistantSelection.
  discoveryMode), so the default Qwen setup carries no assistant and
  both Macs accept the approval. darkbloom cluster local keeps it. The
  service's re-plans follow the saved scope, and forwarded planModels
  and adopt carry the asking Mac's scope. An explicit on is kept.
- ClusterApprovalAttachment.attachment runs the whole
  ClusterConfiguration.validate on the setup with the approval
  attached, so the leader refuses an assistant setup before any part
  stops or anything is sent. The refusal names the reason and the
  remedy in 163 characters.
- A plan that decodes with the assistant says "not offered for public
  traffic" instead of "qualified for public traffic".

Tests: ClusterApprovalTensorAssistantTests (real stores, the other
Mac's own approval handling) and the onboarding's public-traffic line
for the registered 27B artifact fail on 35f7b9f with the live F1
message and pass with the fix; discoveryMode, the plain refusal through
the link, the public-traffic line and the CLI scope binding have tests
of their own. The release's model list and cluster_runtime block are
byte-identical (51c77bdb..., 4fd4ea8a...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): coordinator-side member ends no longer set a pair's approval aside for good

ClusterApprovalCheck.memberQuickEnds counted every coordinator-paired part
end under 120 s except an unreachable coordinator. A registration the
coordinator did not acknowledge in its 10 s negotiation window (a deploy, a
restart, a slow coordinator) counted like a local failure. Three in a row set
the approval aside as failing, and the same build never took it again; a
release-derived approval keeps its ID for the whole release, so the pair
served only the leader's local API until someone intervened (provider bug
hunt 1.4, probe 8bad154d9).

(a) Which ends count
- A quick end whose error is ClusterMemberControlError.negotiationFailed
  leaves the count as it is; a run of 120 s or more still resets it, and an
  unreachable coordinator still resets it. Every other end counts: a changed
  input, a crash without an error line, connectionEnded, roleUnsupported.
- "The coordinator control connection ended or lost trust" never ends a
  coordinator-paired part: `start --cluster-member` runs its loop with
  stopOnDisconnect false, so a dropped connection, an untrusted or offline
  trust_status and a runtime-outdated status leave it reconnecting. That exit
  (memberControlEnded) is the distributed leader part's, which the count never
  includes. A coordinator restart reaches the count only as a registration the
  restarted coordinator does not accept in time: the negotiation case above.
  Per platform master 2847f27dd, "untrusted" is sent only for this Mac's own
  verification (failed or missed attestation challenges, a revoked App Attest
  credential, a failed security check, a replaced connection), so it would
  count; "offline" only accompanies the end of the connection.
- This complements the coordinator fix that ends each pair session before
  its shutdown closes the members' sockets (darkbloom-platform
  fix/coord-shutdown-pair-cancel, 824e82e3c, not yet on master): a deploy
  then ends members cleanly, and this rule still covers older coordinators,
  coordinator crashes and slow negotiation.

(b) A bounded set-aside
- ClusterSetupRecord.ApprovalSetAside gains setAt (wall-clock seconds), which
  the cluster service records (ClusterApprovalCheck.setAside(by:worker:now:)).
  step holds a failing approval aside for ClusterApprovalFallback.failingSeconds
  = 3_600 only; then the same build takes it again. A record without setAt (an
  older build's) or with a time ahead of the clock is past the bound. The count
  starts again because each Mac's part that serves locally resets it, so the
  approval comes back with none.
- The status line says when; two-mac-cluster and the configuration reference
  follow; changelog fragment.

Tests (ClusterApprovalWatchTests): coordinatorSideEndsDoNotReachTheFailingLimit,
localQuickEndsStillSetTheApprovalAside,
aFailingApprovalIsOfferedAgainAnHourAfterItWasSetAside,
aSetAsideInTheCurrentRecordFormatReadsCleanlyAndIsPastTheHour. They fail on
the old rules (12 issues in 5 tests, with a compile shim for the new field)
and pass with the change. The model-approval test now expects an older
build's record to be past the hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): pair Macs do not update themselves; update both by hand

Nothing updates Darkbloom on a Mac set up with `darkbloom cluster` (provider
bug hunt 1.2): ClusterServiceCommand.runSupervisor builds its supervisor with
autoUpdate false, so the update slot never runs; the coordinator-paired part
never starts startAutoUpdateMonitor (ProviderLoop+Serve, solo providers only);
and the single-Mac provider cannot run beside the cluster
(DistributedInstalledProviderExclusion). The docs said otherwise.

- two-mac-cluster: a section "Updating Darkbloom on the pair" with the manual
  procedure, as the code does it: `darkbloom update` on each Mac (UpdateCommand
  installs; its "Restart the provider" line does not apply without a provider
  LaunchAgent); the control leader's ClusterService.checkForUpdate compares
  the pinned worker digests with this Mac's worker file and the other Mac's
  reported facts every 60 s while serving, then stops both parts, plans the
  same model again and serves it ("Darkbloom changed on ...: setting the
  cluster up again for <model>"). The cluster service process itself keeps
  the release it started with until it starts again: a re-run of `darkbloom
  cluster` leaves an unchanged login agent alone, so log out and in (or
  restart). Automatic pair updates are listed as not yet in this build.
- cluster-always-on: the login agent's supervisor runs without the update
  slot; the update-slot row applies to the developer route
  (`start --cluster-member --always-on`) only, with auto_update on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(inference): note that min_p applies on one Mac too

abbe697 made EngineV2Bridge forward an explicit min_p on every single-Mac
slot, as a cluster pair already did (intentional: requests without min_p are
unchanged). The 0.10.6 fragments did not say so, and ChatRequest.min_p still
said it applied on a pair only (provider bug hunt 1.6).

- changelog.d/min-p-single-mac.md: the bug hunt's proposed line.
- ChatRequest.min_p: applied on every slot; the samplers count a value above 1
  as 1 and ignore 0, negative and NaN values; MiMo native media and Nemotron
  Super refuse a non-zero value. Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): Qwen pairs refuse grammar-constrained JSON before any output; pair updates in the notes

The Qwen pair JSON fix is not part of 0.10.6 (refactor pass #2, finding
M1). Skipping the grammar on a pair would have answered public JSON-mode
requests with no grammar and no answer check, because the provider
streams every coordinator request and validates a streamed answer only
when a grammar was built.

- Two-Mac guide, Qwen section: a JSON response_format request that one
  Mac would answer under a grammar is refused on a Qwen pair before any
  output (constrained_decoding_unsupported, HTTP 400). The coordinator
  moves a public request refused this way to a single Mac, which
  constrains it (darkbloom-platform fix/coord-pair-refusal-failover); the
  owner's local cluster API gets the refusal.
- changelog.d/cluster-pair-update-by-hand.md: pair Macs set up with
  darkbloom cluster do not update themselves yet; run darkbloom update on
  both Macs, then log out and back in, and press m once if the status
  says the assistant is not offered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(provider): co-resident loads fund every model's KV floor before the proportional split

0.10.5 providers report "loading 'gemma-4-26b-qat-4bit' would leave a model
without its fixed request workspace, admission watermark and 1.0 GB minimum KV
allowance (fleet KV budget 51467271830 B across 7 slots) — refused", and the
same for gpt-oss-20b at 54999766706 B, with every floor far inside the budget.

resliceGrants split the fleet KV budget only in proportion to each slot's
fp16 rate x min(context, 131072). A resident with a small rate but a real
fixed request workspace gets less than its own floor once a seventh model
joins: on a 192 GB Mac with Ternary Bonsai 2 27B, Qwen3.8 27B, Qwen3.6 and
Qwen3.5 35B-A3B, Gemma 4 26B and Nemotron 3.5 Lightning resident, Lightning
(6,144 B/token; nine recurrent generations with its assistant, a floor of at
least 1.587 GB) is offered 1.443 GB, while all seven floors total 9.9 GB of
the 51.5 GB budget.

Given the floors, resliceGrants keeps the proportional result whenever it
clears every floor (configurations that load today keep identical grants).
Otherwise, if the floors fit, each slot gets its floor plus its weighted
share of the rest; if they do not, the proportional result stands and the
floor check refuses as before. Every re-slice passes the floors: ProviderLoop
and StandaloneServer loads with the MTP target-only retry, the managed Super
newcomer, the reserve-raise preflights, native MiMo, and both regrow paths,
so an unload or reserve change cannot shrink a slot below its floor.

Tests: real EngineV2 residents with their fixed workspace reproduce the
refusal through ProviderLoop and StandaloneServer and are admitted after the
fix; a plain regrow cut Lightning to zero serving width and now keeps its
floor. Pure tests pin the reported budgets, unchanged results when nothing
starves, refusal for infeasible or unprovable floors, and Σ ≤ budget. The
Super capacity test that used proportional starvation as its trigger now
asserts that Super loads at its floor, and a genuine shortfall still refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(provider): a newcomer's KV floor is checked only when its engine is assembled

The re-slice funds every resident's floor first, but a newcomer has no
engine yet and counts only the base 1 GiB floor. A newcomer with a small
KV rate and its own fixed workspace can therefore still receive less than
its floor and fail at assembly with no_kv_headroom: Nemotron 3.5
Lightning loaded seventh beside the reported residents gets 1.443 GB
against its 1.587 GB floor (serving width 0), unchanged from 0.10.5.

hardware-support.md now states that limit where the floors are described,
and inference.md says the re-slice, not every load, refuses only when the
floors exceed the fleet KV budget. Behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(provider): local server regrow and reserve check keep a starved slot's KV floor

The fix passes slot floors at both regrow paths and both reserve checks,
but only the ProviderLoop pair had a test. Dropping the floors from
StandaloneServer.resliceGrowSurvivors and reserveKeepsSurvivorsServiceable
left all 350 selected tests passing.

The new test mirrors the ProviderLoop one on the same seven-slot scenario:
it first checks that the server's own budget starves Lightning under the
plain proportional split, then expects the reserve check to pass and the
regrow to leave every resident at its floor with serving width, within the
budget. With either floors argument removed it fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(provider): the KV floor changelog entry names the refusal it removes

"A load is refused only when the minimums together exceed the budget"
promised more than the split can check. The model being loaded counts
only the 1 GB base minimum until it is built, so Nemotron 3.5 Lightning
loaded beside several high-rate models can still fail with no KV
headroom, as on 0.10.5. The entry now says the message appears only when
the minimums exceed the budget, and states that limit.

Release preparation already rendered this fragment into CHANGELOG.md;
the matching one-line change there equals changelog.py render of the
new fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: David Tai <dtaipublic@gmail.com>
* cluster: runtime facts v2 name each model's pair-serving grant; release modes

`darkbloom cluster runtime-facts` prints schema darkbloom_cluster_runtime_v2:
the v1 digests, unchanged, plus each model's pair_serving_grant. The grant is
the public grant a member of the same build reports for the described artifact
(ClusterPairServingGrants.grant), null when there is none: its mode families
sorted by byte, and evidence_sha256, the SHA-256 of the records it rests on as
canonical JSON Lines (ClusterPairServingGrant.records, evidenceSHA256). The
canonical encoder writes null rather than omitting it; the strict decoder
init(canonical:releaseVersion:) refuses unknown, missing or repeated fields,
schema v1, and a model whose derived IDs (release/<version>/<model>/s2, plus
/grant for a granted model) exceed 128 bytes. The model bound is 64.

The release modes come back (ClusterRuntimeApprovalFacts+Release.swift):
--list-release-models prints the models this build qualifies on a cluster, and
--app A --release-candidates DIR describes, for every listed artifact and every
catalog model ID among its candidates, the first candidate the app's worker
describes as that model. A listed model with no candidate is left out (the
environment's catalog lacks it); the output must read back under the strict
decoder for this build's version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): every lane computes cluster_runtime; sent only when enabled

The release lane (dev branch, staging, prod) computes the cluster runtime facts
of its final signed, notarized app with that app's own CLI and worker, in the
step "Compute cluster runtime facts from the final signed app" of
build-and-release: after the final hashes, with no secret (the signing
keychain is deleted and the identity proven gone first), from the target
environment's public catalog and model CDN (provider-cluster-runtime-models.py
--environment). A listed model that catalog lacks is left out and named. The
job summary shows the block and a run artifact retains it in every lane.

The payload carries it (prepare --cluster-runtime) only when CLUSTER_RUNTIME_SEND
is true: the run registers a release and the environment's repository variable
DEV_, STAGING_ or PROD_CLUSTER_RUNTIME_ENABLED is exactly 'true'. Unset, prepare
runs today's command and the payload is byte for byte today's (pinned by digest
in the tests), and a facts failure only warns (continue-on-error). Set, a
failure fails the release before staging and registration. validate accepts a
valid block in every environment and refuses an invalid one and one whose
derived approval or grant IDs exceed 128 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(release): the registration carries cluster_runtime in its canonical form

Contract A defines the block as canonical JSON (keys sorted by byte, no
whitespace, no trailing newline). prepare now refuses a block file that is not
canonical, and the registration body is encoded without whitespace when, and
only when, it carries the block, so the coordinator receives the block's
canonical bytes whether it parses them or compares them. A body without the
block is byte for byte the one sent before (pinned in the tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cluster: no derived grants; the owner's public models and their parity qualifications

Owner decisions (jonathan308, 2026-10-31): "public traffic should not be
manual"; "only glm 5.3 flash should be serving public & qwen 3.8 27b they are
both good to go they should be approved for serving".

The v2 facts no longer carry pair_serving_grant. A coordinator grant restricts
its approval to the families it names, and GLM-5.3-Flash's bundled records hold
only a pipeline_v1 run, so a derived grant would stop the GLM tensor-parallel
pairs M5 members serve today. ClusterPairServingGrants is back to dev apart from
the public-traffic line below.

ClusterPublicModels (beside the grants, reviewed in PRs) declares exactly
GLM-5.3-Flash (registered_glm53_flash, glm-5.3-flash) and Qwen3.8-27B
(registered_qwen38_27b, EigenLabs/Qwen3.8-27B-4bit-mtp): tensor_parallel on
schedules 1 and 2, evidence placement two Apple M5 Ultras (applegpu_g17d, NAX
on) on macOS 27.0, cuts [], equal shares, qualified 2026-10-31T00:00:00Z, and
the SHA-256 of the evidence document
docs/reports/2026-10-31-public-cluster-models.md (a test holds them equal). It
also names the artifact the runtime registers for each model.

Each model's parity_qualifications is [] unless the declaration names its
runtime model, catalog ID and artifact; then one object per declared family and
schedule: numerics classes of the evidence placement with the block's metallib
(g17d-nax1-mlx-98bab9d7-macos27.0 on 0.10.5-dev.branch.15 and .16), cuts, mode,
tensor_parallel_shares null, promotable, not diverged, evidence_sha256,
qualified_at and the request envelope (ClusterPublicModels.requestEnvelope:
sampling, tools, 1,048,576 tokens each way, vision and video as the candidate's
catalog entry lists image and video; text only without one). Release
candidates carry that entry (catalog.json). The strict decoder and validate
check the qualifications as a coordinator does and bound the derived IDs
release/<version>/<model>/s<s>/q<n>. The setup's public-traffic line says a
declared model is qualified in its declared family without a record of it.

The GLM block the installed 0.10.5-dev.branch.16 app computes from DevNet's
catalog is pinned as a golden. The placement check runner compiles the new file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): candidates carry their catalog entry; validate parity qualifications

provider-cluster-runtime-models.py saves each candidate's catalog entry (its id
and input_modalities, canonical, catalog.json) beside its manifest and
config.json, so the released app's own CLI gives a declared model's request
envelope the media the target environment's catalog lists; a malformed modality
list fails that entry, none listed means text only.

provider-release-publication.py checks parity_qualifications in place of
pair_serving_grant: the exact fields, schedule 1 or 2, two numerics classes,
the cuts the mode has, null shares, flags, an instant the coordinator accepts,
the envelope bounds, video only with vision, no placement twice, at most 8; and
bounds every derived approval and qualification ID
(release/<version>/<model>/s<s>/q<n>) at 128 bytes. The pinned GLM block is
accepted. Docs and the changelog fragment follow; the release step's comments
name the parity qualifications.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): the service's part beats into its own heartbeat file

Under its supervisor the cluster service beats every 2 s into the file
DARKBLOOM_CLUSTER_MEMBER_HEALTH_FILE names. Its part was started with the
service's environment unchanged, and a coordinator-paired part
(`start --foreground --cluster-member`) beats every 5 s into the file the
same key names, with its own pid. The supervisor's liveness guard reads
the file every 15 s and treats a beat of another pid as no beat. The three
periods are near multiples of each other, so their phases drift by
milliseconds per probe: once the part's beat was the last write at six
probes in a row, the guard recycled a healthy service ("heartbeat missing
for 75 s while its process is alive") and the pair dropped and registered
again. Seen on a DevNet leader about every 15 minutes.

The part now gets the service's environment with the key pointing at
part-health.json beside the service's files. The key stays set, so the
part still waits for its registration as a supervised member does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: the cluster service part's own heartbeat file

Docs Impact failed: ClusterService.swift changed without its mapped
architecture document. The cluster serving section now says which file the
service and its part each write their heartbeat to, and why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(cluster): keep the approval fixture alive through the part heartbeat tests

Both new tests failed on CI at every run: the member part never started.
They dropped the ClusterApprovalMacs fixture (`let (_, service, parts)`),
whose deinit removes both homes, so the leader's saved setup was gone
before the service's first tick. The fixture now lives until the last
check, as in the other tests of the suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cluster: pair-serving grants again, beside parity qualifications

David's finding: a pair member reports only hardware capabilities
(DistributedServingEligibility.memberCapabilities: apple_m5 on an M5), and
without a pair-serving grant the coordinator holds each member to the
model's single-Mac requirements (providerMeetsServingRequirementsLocked),
which no member meets for GLM-5.3-Flash (mlx_nax, glm5_next_v1) or
Qwen3.8-27B (mlx_nax). No pair forms without a grant, so every model in the
v2 facts again carries pair_serving_grant (null, or exactly evidence_sha256
and mode_families) beside parity_qualifications.

A declared public model's grant names its declared families with the
evidence document's SHA-256. Owner ruling 2026-10-31 ("It should be tensor
or pipeline obviously but that shouldn't matter for the coordinator"):
ClusterPublicModels declares pipeline and tensor_parallel for both
GLM-5.3-Flash and Qwen3.8-27B. Any other model's grant is the one this
build's bundled records give its artifact (ClusterPairServingGrants.grant),
with the SHA-256 of those records' canonical JSON Lines
(ClusterPairServingGrant.records, evidenceSHA256); null when they grant none.

The declaration's families drive the parity qualifications: one promotable
record per family and schedule, pipeline first (byte order), so each
approval's q1 is the pipeline and q2 tensor parallel. A pipeline is
pipeline_v1 cut at [num_hidden_layers / 2] of the model's config.json (top
level, else text_config: GLM 45 -> [22], Qwen3.8-27B 64 -> [32]); without a
layer count its records are left out and the command says so on standard
error. An envelope admits media only where the placement serves media
(ClusterModelFeaturePolicy.mediaContract): tensor parallel follows the
catalog entry, a pipeline is text only.

The strict decoder and validate check the grant (1 to 4 known families in
byte order, nonzero evidence) and bound release/<v>/<M>/s<s>/grant at 128
bytes beside the approval and /q<n> IDs. The setup's public-traffic line
follows the declaration (pipeline and tensor parallel); tests about the
records alone pass publicModels: []. The evidence report says the owner
approved both modes for both models, that GLM-5.3-Flash's bundled records
hold a pipeline_v1 run while its tensor parallel rests on the owner's
decision and the DevNet serving results, and why grants are needed; its
SHA-256 is re-pinned. The GLM golden is re-pinned from the installed
0.10.5-dev.branch.17 app, which replaced branch.16 on this Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci(release): validate pair-serving grants and their derived IDs

provider-release-publication.py checks each model's pair_serving_grant
again (null, or exactly evidence_sha256 and 1 to 4 known mode_families in
byte order) beside its parity_qualifications, adds the grant's evidence to
the digests it checks, and bounds release/<version>/<model>/s<1|2>/grant at
128 bytes with the approval and /q<n> IDs. Its tests cover the grant rows,
the ID bound for a model with neither, qualifications only, a grant only and
both, the /grant and /q<n> IDs, and the branch.17 GLM golden (q1 the
pipeline, text only; q2 tensor parallel).

The docs (configuration reference, release runbook, inference architecture,
test guide), the changelog fragment and the release step's comments describe
the grants and why pairs need them, both declared families, the pipeline
cut, the per-placement media and the q1/q2 order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* release(publication): refuse a registration body over the coordinator's 64 KiB

The coordinator reads POST /v1/releases under MaxReleaseRegisterBodyBytes
(64 KiB, as http.MaxBytesReader applies it), the same bound as the
cluster_runtime block's own, so a block within its bound could take the body
over the limit and fail only at publish, after R2 staging. validate (in
prepare, stage and publish) now refuses a payload whose registration body
exceeds 65,536 bytes, naming its size and the limit. One function
(registration_body) builds the bytes it sizes and the bytes registration
sends, so they cannot differ.

The test grows a valid block to a body of exactly 65,536 bytes (accepted)
and 65,537 (refused before staging, with no payload written), refuses the
same limit without a block (release notes), and checks that registration
sends the sized bytes. Independent review N1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): the declared placement is evidence, not a limit; catalog room

Independent review fixes (S1, S2, N2, N3, N4, N7, N10, N15 wording).

The configuration reference, the release runbook, the inference page and
the changelog say how a coordinator applies the declared qualifications: a
promotable record qualifies its approval's whole mode family on any
numerics classes, cuts and shares within the envelope (parityQualification,
platform df61dd6f9), so public traffic for GLM-5.3-Flash and Qwen3.8-27B is
admitted in pipeline and tensor parallel on any Apple silicon pair; the
declared placement names the evidence, not a limit. No pipeline ran on two
M5 Ultras and GLM-5.3-Flash has no tensor-parallel cross-cable record: both
rest on the owner's decision and the DevNet serving results. GLM-5.3-Flash
serves only the serial schedule, so its schedule 2 entries are inert. The
digest-pinned evidence document is unchanged.

The runbook adds the catalog-room precondition (64 approvals with the
operator's own, 2 per model per release, newest release whole first, older
releases left out first), DevNet's numbers on 2026-10-31 (26 served, 4
catalog models: 8 per release, the 4 newest fit), the log check after the
first registration (release cluster approvals omitted), the recovery when a
facts failure stops a release, "set to true" (GitHub compares
case-insensitively; also in the workflow comment), the release-handler link
re-pinned to platform df61dd6f9, and "a catalog model ID of a listed
artifact". The inference page notes that a grant also bounds owner-formed
sessions to its families.

The grant's evidence is the passing records it is computed from, without a
pass a divergence of the same shape contradicts: said so in the code
comment and the reference, with a test row for a family still granted by
another pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): prepare provider 0.10.6

Set ProviderCore.version to 0.10.6 and mark v0.10.5 as published on
2026-10-30 (tag target d3bbcd0).

Open the v0.10.6 candidate entry with its upgrade and rollout notes: the
first production release with two-Mac clusters (darkbloom cluster over one
Thunderbolt 5 cable with RDMA, macOS 26.2 or later; GLM-5.3-Flash and
Qwen3.8-27B in tensor parallel); releases carry their cluster runtime
facts (#1692), from which a coordinator with darkbloom-platform#643
derives approvals, pair-serving grants and public qualifications, off in
production until that coordinator runs with its switches on and migration
58, and PROD_CLUSTER_RUNTIME_ENABLED is set after it and before the tag;
no coordinator change or version floor for single-Mac serving; the #1690,
#1686, #1680 and #1683 changes; the MLX pins (mlx 72dffa2d and mlx-swift
c633d221 unchanged, mlx-swift-lm 2beb401f -> 7933a0fa for SDK #373 only,
so the metallib hash should equal v0.10.5's); and what the verbatim
entries below are.

Update the release runbook: the 0.10.6 scope, the pin, metallib and
catalog checks before tagging, the rollout order (the platform with #643,
its three switches and migration 58 first, then
PROD_CLUSTER_RUNTIME_ENABLED, the dev -> master promotion as a merge
commit, the tag and the platform snapshot), platform evidence inspected on
2026-10-31, and the published history.

The pending changelog fragments are rendered in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): render the pending changelog fragments into provider 0.10.6

Insert the output of

  python3 scripts/changelog.py render --version 0.10.6 --date 2026-10-31

(all 101 pending fragments) verbatim, without its heading line, below the
v0.10.6 upgrade and rollout notes, and remove exactly those 101 fragments.
The render ran on this branch's base, origin/dev a0413a8, before the
v0.10.6 heading existed, because the renderer refuses a version that
CHANGELOG.md already names. A render from a git archive export of
a0413a8 is byte-identical.

This commit is mechanical, so a later roll-up can revert it, merge dev and
render again if more fragments land before this merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): name the single-Mac answers that change in 0.10.6

Two client-visible answers of one Mac are new since v0.10.5: a content part
of an unknown type is refused with 400 (OpenAIRequestValidationError, from
the cluster capability honesty change), and media the model's processor
refuses answers 400 invalid_media instead of the retryable 503
(EngineV2VisionPrefill.clientFault). Say so beside "no coordinator change".
Both use failure codes the coordinator's closed enum already had in
v0.10.5's protocol reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): complete the single-Mac changes and production gates in the 0.10.6 notes

From the independent review of this preparation:

- S1: three answers to coordinator requests change on one Mac, not two. A
  response_format answer cut off by max_tokens is now a client error
  (InferenceErrorClassifier: client_error instead of the retryable
  tool_noncompliance), so the coordinator no longer retries it on another
  provider. The local API (darkbloom start --local) normalizes a request that
  fails to decode as the coordinator path does (InboundChatNormalization),
  returns logprobs where the model captures them, reports
  usage.completion_tokens_details.reasoning_tokens and answers the cut-off
  with 422 and its own message (LocalChatUploadResponder,
  StandaloneServer+HTTP). Two operator changes without a fragment are named
  too: provider.toml is written owner-only (ProviderConfigFile), and the
  0.10.6 updater extracts releases under umask 022 (SelfUpdater).
- S2: production needs four cluster settings, including
  EIGENINFERENCE_CLUSTER_PAIR_TRUSTED_TLS_PROXIES (the coordinator listens on
  plain HTTP behind Caddy), and App Attest serving for every account
  (EIGENINFERENCE_APP_ATTEST_SERVING, _ENVIRONMENT=production,
  _ROLLOUT_PERCENT=100).
- S3: PROD_CLUSTER_RUNTIME_ENABLED waits for #643 plus any follow-up fix and
  for the DevNet proof with the release's dev build: derived release/
  approvals and a session on a real pair.
- N4: four repeated single-Mac statements (all published in v0.10.0); N5: the
  6% is for one request; N6: the SDK pin moved through #1680 and #1684.

The rendered entries are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): settings, DevNet proof, snapshot promotion and tag checks for 0.10.6

From the independent review of this preparation:

- S2: rollout step 1 sets four cluster settings, among them
  EIGENINFERENCE_CLUSTER_PAIR_TRUSTED_TLS_PROXIES (without it no member
  connection attaches to pair control behind Caddy, and in the split
  deployment the trusted-proxy path is the only one), and App Attest serving
  at a 100% account rollout, because a member without MDM pairs only through
  App Attest. Evidence rows cite the platform configuration reference, the
  cluster-control "Member trust" row and appattest/service/config.go.
- S3: a DevNet proof step: the 0.10.6 dev build's release/ approvals are
  listed and a real pair forms a session, on the platform fixes production
  will run. The variable step checks production /health for that revision;
  #643 alone is not enough. The DevNet observation (block accepted, no
  release/ entry) is in the evidence table.
- S4: the promotion is a snapshot branch cut at this preparation's merge
  commit on dev, and before tagging, make changelog-check prints 0 fragments
  and the tagged commit differs from that merge commit only by master's prod
  default.
- N2: merging into dev starts the DevNet dev-branch release; N5, N6; N7: #644
  carries only migration 58; N8: the catalog bounds and what 0.10.6 adds.

The cluster runtime facts section now names the trusted-proxy setting and
points its production step at the version's rollout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(build): describe how a release promotes dev to master

The dev branch section said "Never merge dev into master", that dev is
master plus one commit, that master pushes publish dev providers and that
code changes go to master first. None of that has held since #1635, #1637
and #1688, and the release runbook now promotes dev. Describe it as #1688
did: a snapshot branch of dev merged into master with a merge commit (an
admin briefly allows merge commits on the squash-only master ruleset),
master's one commit of its own (e9babca) that keeps plain builds on prod
and is reverted on dev by each master-into-dev sync, and dev pushes that
publish DevNet releases through release-dev-branch.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): refactor pass on the 0.10.6 notes and runbook

From the dedicated refactor pass of this preparation (edits A-F; the
optional G and H are not applied). The 101 rendered entries, the version
constant and docs/developer/build.md are unchanged.

- A: the DevNet proof is rollout step 1 and the production platform step 2,
  because production deploys the revision that passed the proof. Before,
  steps 1 and 2 each referred to the other.
- B: the notes state the production gate as a condition. The 2026-10-31
  DevNet status and the Caddy detail stay in the runbook and its evidence
  table, because they stop being true at rollout.
- C: the notes name the superseded statements that state a wrong current
  default (widened Qwen fences, SSD prefix-record precision, Qwen3.8 27B
  tensor-parallel speculation) and the owner's decisions behind the public
  qualifications.
- D: the notes name the MLX stream-fence fix that v0.10.5's pins already
  contain, and carry the per-build SSD checkpoint fact, which the runbook's
  metallib check no longer repeats.
- E: the dev-branch lane drops two statements superseded since 2026-10-28:
  master's verify-source accepts a dev push for environment dev, and pull
  requests into dev need one approval and land as merge commits.
- F: Cluster Runtime Facts separates acceptance (darkbloom-platform#643)
  from derivation (EIGENINFERENCE_CLUSTER_PAIR_APPROVALS_FROM_RELEASES) and
  no longer points at the per-version section, which the next preparation
  replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): release facts leave out another model's catalog ID of a shared artifact

Production's catalog lists the Gemma 4 26B artifact a4722b60 twice:
gemma-4-26b and gemma-4-26b-8bit. The build registers two runtime models
on it that only the manifest tells apart (registered_gemma4_26b and
registered_gemma4_26b_8bit), and only the 8-bit one is qualified on a
pair, so only it is a listed release model. ClusterRuntimeApprovalFacts
.release required every catalog model ID of a listed artifact to be
described as the listed model, and the worker describes gemma-4-26b's
manifest as registered_gemma4_26b. Run against production's catalog and
CDN, the release's facts step therefore failed ("Qualified cluster models
the release cannot describe: gemma-4-26b"), and a production release with
PROD_CLUSTER_RUNTIME_ENABLED=true would stop after signing.

A catalog model ID whose candidates the worker describes only as another
registered model is that model's: a member that installed it runs as that
model, which this release does not qualify. It is now left out and named
on standard error (note: left out, the catalog model ID of another
registered model). A catalog model ID of which the worker describes no
candidate at all still fails the step, and so does an empty result, whose
message now names what was left out.

The new test builds production's shape from the checked-in metadata
fixtures (gemma-4-26b and gemma-4-26b-8bit, one configuration): it fails
on the previous code with the production error and passes now; a second
test checks the note in both directions. The runbook's release step and
the configuration reference state the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): 0.10.6 goes to production without a DevNet proof

The owner dropped the DevNet proof for this release. The notes' gate
bullet said PROD_CLUSTER_RUNTIME_ENABLED is set only after DevNet lists
the dev build's derived approvals and a DevNet pair forms a session
under one, which would misstate in the permanent history how 0.10.6
shipped.

- CHANGELOG.md: the gate is the production coordinator with #643 and its
  follow-up fix for the split edge and Conductor deployment, migration 58,
  the four cluster settings and App Attest serving; a new bullet says the
  release was not proven on DevNet first and that its derived approvals
  and a pair session under one are first checked in production.
- provider-release.md, 0.10.6 rollout: step 1 says there is no DevNet
  proof and why production is the first coordinator to derive approvals;
  step 2 names the split-edge fix; step 3 depends on step 2 only; step 5
  adds the production pair session as the check of the derived approvals.

The 101 rendered entries are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): render the release facts fix's fragment into provider 0.10.6

The release facts fix (cluster runtime facts leave out another model's
catalog ID of a shared artifact) lands before this preparation and adds
one pending fragment. Render it with the other 101 so that changelog.d
holds only its README at the tag:

- CHANGELOG.md: the v0.10.6 block is a fresh
  `changelog.py render --version 0.10.6 --date 2026-10-31` of the 102
  pending fragments (minus its heading line and the blank line after it),
  byte for byte; against the 101-fragment render it only inserts the new
  entry, in filename order. The notes count 102 entries.
- changelog.d/cluster-runtime-facts-another-models-catalog-id.md is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): 0.10.6's production gate is the release source alone

The notes and runbook required what this mainnet-direct release does not
have: a follow-up platform fix for DevNet's split edge and Conductor
deployment (darkbloom-platform#652, deferred; production runs one
combined coordinator) and EIGENINFERENCE_CLUSTER_PAIRS, which production
deliberately leaves unset so that approvals derived from releases are the
only source. The facts rollout order still waited for a DevNet proof, the
pair guide said production serves no approvals, and the runbook promoted
dev to master with a merge commit while 0.10.6 reaches master through
squash-merged pull requests.

- CHANGELOG.md: the gate is #643 with migration 58 and the three lines
  production gets (EIGENINFERENCE_CLUSTER_PAIR_APPROVALS_FROM_RELEASES=true,
  EIGENINFERENCE_CLUSTER_PUBLIC_ROUTING=true,
  EIGENINFERENCE_CLUSTER_PAIR_TRUSTED_TLS_PROXIES=127.0.0.1,::1), with
  EIGENINFERENCE_CLUSTER_PAIRS unset; the notes name the verbatim entry
  that still calls production a coordinator without pair control. The
  101 rendered entries are unchanged.
- provider-release.md, 0.10.6: step 2 sets those lines and drops the
  split-edge prerequisite; step 3 names the 409 cluster_runtime_conflict;
  step 4 merges the clustering PR, the facts fix and this preparation into
  master, each squash-merged, restacked with restack-after-squash.py;
  step 5 tags this preparation's squash commit; the pre-tag check reads
  that commit's subject instead of diffing against a dev merge commit.
- provider-release.md, Cluster Runtime Facts rollout order: step 4 is the
  production order (deploy with those lines and the /health check,
  PROD_CLUSTER_RUNTIME_ENABLED=true, the tag, then the derived
  release/0.10.6/... approvals), without a DevNet proof, with the trap: a
  version first registered without the block never gains one (409).
- two-mac-cluster.md and configuration.md: production derives approvals
  from releases once its coordinator runs #643 with approvals from
  releases; before that deploy it serves none (404). A derived approval
  ends 90 days after its release registered.
- build.md: dev's changes reach master through pull requests into master;
  #1688 was a merge-commit promotion, 0.10.6 a squash-merged pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): 0.10.6 reaches master in two pull requests

The release facts fix is part of the two-Mac clustering pull request now:
master is squash-only and asks for a new approval after every push, so
each stacked pull request costs the approver another round. Rollout step
4 of the 0.10.6 section therefore merges two pull requests, the
clustering one (#1690 and #1692 from dev with master merged in, and the
fixes found while preparing this release, such as the release facts
fix) and then this preparation, restacked once with
restack-after-squash.py after the first squash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(cluster): refactor pass on the release facts fix

Behaviour-preserving cleanup of 35f7b9f, from the dedicated refactor
pass that AGENTS.md requires before the pull request opens. The facts
block, --list-release-models and every message and note stay byte for
byte the same.

- ClusterRuntimeApprovalFacts.release: the left-out list holds the note
  lines it names (leftOut) instead of a list called othersCatalogIDs that
  held reason strings and was mapped to those lines afterwards. The doc
  comment says "whose candidates the worker describes only as another
  registered model", as the docs do, and that the empty-result error
  names what was left out.
- ClusterRuntimeFactsCommand: one note(_:) writes "note: <line>" to
  standard error, for the declared families without a qualification and
  for the catalog IDs release(note:) leaves out, instead of a second copy
  of that format in a closure. The command's doc comment names both.
- ClusterRuntimeApprovalFactsTests: the "another" case of
  releaseNamesEveryCatalogModelItCannotDescribeAndRefusesAnEmptyResult now
  passes through the empty-result error, which names the left-out ID; it
  checks that message's prefix as well as the refusal it already checked.
- provider-release.md, release step 6: "every catalog model ID of a listed
  artifact gets one entry" contradicted the exception the fix added two
  sentences later. It now reads "every catalog model ID of a listed
  artifact that it describes as the listed model gets one entry"; the rest
  of the step is only rewrapped.
- configuration.md: the fix's paragraph is rewrapped (one 108-column
  line); no word changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): refactor pass on the 0.10.6 production-gate text

From the dedicated refactor pass over 27dedfe, 8caeea4 and 72bceb8.
Text only, in docs/operations/provider-release.md:

- The platform evidence row named "the three switches" that only DevNet's
  overlay sets. Since 8caeea4, rollout step 2 lists three other lines
  (with EIGENINFERENCE_CLUSTER_PAIR_TRUSTED_TLS_PROXIES and without
  EIGENINFERENCE_CLUSTER_PAIRS), so the row read as if the overlay set
  those three and "also" the trusted proxies. It now names the switches:
  EIGENINFERENCE_CLUSTER_PAIRS,
  EIGENINFERENCE_CLUSTER_PAIR_APPROVALS_FROM_RELEASES and
  EIGENINFERENCE_CLUSTER_PUBLIC_ROUTING (deploy/gcp/dev/env-overrides at
  df61dd6f).
- Rollout step 1 drops "(mainnet-direct)", a planning label that no other
  page uses; the step already says the release goes to production without
  a DevNet proof.

CHANGELOG.md is unchanged: the 102 rendered entries and the notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): Qwen3.8 27B pairs register with the coordinator by default

With the default [backend] mtp_mode = "auto", the guided setup planned
Qwen3.8 27B tensor parallel with the model's embedded speculative
assistant, which a setup saved for coordinator pairing may not carry
(ClusterConfiguration.validate). The leader's check of a coordinator's
approval ran only the attachment's own checks, so it stopped both parts
and sent the approval, and the other Mac refused it at its save ("A
tensor assistant requires Qwen TP on a row with an inline head, serial
prefill and a local cluster setup"). The pair served on the leader's
local API only, while the setup said it was qualified for public
traffic (finding F1 of the 0.10.6 two-Mac proof).

The assistant stays local-only: no parity qualification covers its
verify windows. The bundled tensor-parallel records of the 27B predate
it, and neither the records, the release's cluster_runtime block nor a
pair's registration has a speculation field.

- The onboarding plans for how the cluster serves: through Darkbloom,
  auto discovers like off (ClusterPlacementTensorAssistantSelection.
  discoveryMode), so the default Qwen setup carries no assistant and
  both Macs accept the approval. darkbloom cluster local keeps it. The
  service's re-plans follow the saved scope, and forwarded planModels
  and adopt carry the asking Mac's scope. An explicit on is kept.
- ClusterApprovalAttachment.attachment runs the whole
  ClusterConfiguration.validate on the setup with the approval
  attached, so the leader refuses an assistant setup before any part
  stops or anything is sent. The refusal names the reason and the
  remedy in 163 characters.
- A plan that decodes with the assistant says "not offered for public
  traffic" instead of "qualified for public traffic".

Tests: ClusterApprovalTensorAssistantTests (real stores, the other
Mac's own approval handling) and the onboarding's public-traffic line
for the registered 27B artifact fail on 35f7b9f with the live F1
message and pass with the fix; discoveryMode, the plain refusal through
the link, the public-traffic line and the CLI scope binding have tests
of their own. The release's model list and cluster_runtime block are
byte-identical (51c77bdb..., 4fd4ea8a...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(cluster): coordinator-side member ends no longer set a pair's approval aside for good

ClusterApprovalCheck.memberQuickEnds counted every coordinator-paired part
end under 120 s except an unreachable coordinator. A registration the
coordinator did not acknowledge in its 10 s negotiation window (a deploy, a
restart, a slow coordinator) counted like a local failure. Three in a row set
the approval aside as failing, and the same build never took it again; a
release-derived approval keeps its ID for the whole release, so the pair
served only the leader's local API until someone intervened (provider bug
hunt 1.4, probe 8bad154d9).

(a) Which ends count
- A quick end whose error is ClusterMemberControlError.negotiationFailed
  leaves the count as it is; a run of 120 s or more still resets it, and an
  unreachable coordinator still resets it. Every other end counts: a changed
  input, a crash without an error line, connectionEnded, roleUnsupported.
- "The coordinator control connection ended or lost trust" never ends a
  coordinator-paired part: `start --cluster-member` runs its loop with
  stopOnDisconnect false, so a dropped connection, an untrusted or offline
  trust_status and a runtime-outdated status leave it reconnecting. That exit
  (memberControlEnded) is the distributed leader part's, which the count never
  includes. A coordinator restart reaches the count only as a registration the
  restarted coordinator does not accept in time: the negotiation case above.
  Per platform master 2847f27dd, "untrusted" is sent only for this Mac's own
  verification (failed or missed attestation challenges, a revoked App Attest
  credential, a failed security check, a replaced connection), so it would
  count; "offline" only accompanies the end of the connection.
- This complements the coordinator fix that ends each pair session before
  its shutdown closes the members' sockets (darkbloom-platform
  fix/coord-shutdown-pair-cancel, 824e82e3c, not yet on master): a deploy
  then ends members cleanly, and this rule still covers older coordinators,
  coordinator crashes and slow negotiation.

(b) A bounded set-aside
- ClusterSetupRecord.ApprovalSetAside gains setAt (wall-clock seconds), which
  the cluster service records (ClusterApprovalCheck.setAside(by:worker:now:)).
  step holds a failing approval aside for ClusterApprovalFallback.failingSeconds
  = 3_600 only; then the same build takes it again. A record without setAt (an
  older build's) or with a time ahead of the clock is past the bound. The count
  starts again because each Mac's part that serves locally resets it, so the
  approval comes back with none.
- The status line says when; two-mac-cluster and the configuration reference
  follow; changelog fragment.

Tests (ClusterApprovalWatchTests): coordinatorSideEndsDoNotReachTheFailingLimit,
localQuickEndsStillSetTheApprovalAside,
aFailingApprovalIsOfferedAgainAnHourAfterItWasSetAside,
aSetAsideInTheCurrentRecordFormatReadsCleanlyAndIsPastTheHour. They fail on
the old rules (12 issues in 5 tests, with a compile shim for the new field)
and pass with the change. The model-approval test now expects an older
build's record to be past the hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): pair Macs do not update themselves; update both by hand

Nothing updates Darkbloom on a Mac set up with `darkbloom cluster` (provider
bug hunt 1.2): ClusterServiceCommand.runSupervisor builds its supervisor with
autoUpdate false, so the update slot never runs; the coordinator-paired part
never starts startAutoUpdateMonitor (ProviderLoop+Serve, solo providers only);
and the single-Mac provider cannot run beside the cluster
(DistributedInstalledProviderExclusion). The docs said otherwise.

- two-mac-cluster: a section "Updating Darkbloom on the pair" with the manual
  procedure, as the code does it: `darkbloom update` on each Mac (UpdateCommand
  installs; its "Restart the provider" line does not apply without a provider
  LaunchAgent); the control leader's ClusterService.checkForUpdate compares
  the pinned worker digests with this Mac's worker file and the other Mac's
  reported facts every 60 s while serving, then stops both parts, plans the
  same model again and serves it ("Darkbloom changed on ...: setting the
  cluster up again for <model>"). The cluster service process itself keeps
  the release it started with until it starts again: a re-run of `darkbloom
  cluster` leaves an unchanged login agent alone, so log out and in (or
  restart). Automatic pair updates are listed as not yet in this build.
- cluster-always-on: the login agent's supervisor runs without the update
  slot; the update-slot row applies to the developer route
  (`start --cluster-member --always-on`) only, with auto_update on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(inference): note that min_p applies on one Mac too

abbe697 made EngineV2Bridge forward an explicit min_p on every single-Mac
slot, as a cluster pair already did (intentional: requests without min_p are
unchanged). The 0.10.6 fragments did not say so, and ChatRequest.min_p still
said it applied on a pair only (provider bug hunt 1.6).

- changelog.d/min-p-single-mac.md: the bug hunt's proposed line.
- ChatRequest.min_p: applied on every slot; the samplers count a value above 1
  as 1 and ignore 0, negative and NaN values; MiMo native media and Nemotron
  Super refuse a non-zero value. Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(cluster): Qwen pairs refuse grammar-constrained JSON before any output; pair updates in the notes

The Qwen pair JSON fix is not part of 0.10.6 (refactor pass #2, finding
M1). Skipping the grammar on a pair would have answered public JSON-mode
requests with no grammar and no answer check, because the provider
streams every coordinator request and validates a streamed answer only
when a grammar was built.

- Two-Mac guide, Qwen section: a JSON response_format request that one
  Mac would answer under a grammar is refused on a Qwen pair before any
  output (constrained_decoding_unsupported, HTTP 400). The coordinator
  moves a public request refused this way to a single Mac, which
  constrains it (darkbloom-platform fix/coord-pair-refusal-failover); the
  owner's local cluster API gets the refusal.
- changelog.d/cluster-pair-update-by-hand.md: pair Macs set up with
  darkbloom cluster do not update themselves yet; run darkbloom update on
  both Macs, then log out and back in, and press m once if the status
  says the assistant is not offered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): render F1, the set-aside fix, min_p and the pair update note into provider 0.10.6

The final clustering branch adds four pending fragments to the 102 this
preparation rendered:

- cluster-qwen-pair-public-without-assistant.md (F1: Qwen3.8 27B pairs
  register with the coordinator by default);
- cluster-pair-coordinator-ends-not-failing.md (a coordinator deploy no
  longer takes a cluster pair off public traffic);
- min-p-single-mac.md (a request's min_p now applies on one Mac too);
- cluster-pair-update-by-hand.md (pair Macs set up with darkbloom cluster
  do not update themselves yet).

The Qwen pair JSON fix is not part of 0.10.6, so it has no entry.

CHANGELOG.md: the v0.10.6 block is a fresh
`changelog.py render --version 0.10.6 --date 2026-10-31` of all 106
fragments pending on the clustering branch (2071bbd), minus its
heading line and the blank line after it, byte for byte. Against the
102-fragment render it only inserts the four entries, in filename order.
The notes count 106 entries. The four fragments are removed, so
changelog.d holds only its README; the version stays 0.10.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(release): re-run the facts dry run before PROD_CLUSTER_RUNTIME_ENABLED

Refactor pass finding m9: rollout step 3 set the variable without asking
for the read-only facts dry run, although a production catalog row the
worker cannot describe would stop the tag's release after signing once
the variable is true. Step 3 now re-runs the release's facts step
(scripts/provider-cluster-runtime-facts.sh <app> darkbloom prod) with an
unsigned app staged from this preparation's source, as the build job
stages it, and requires exit 0 before the variable is set. The order
(the coordinator deploy first, then the variable, then the tag) and the
409 cluster_runtime_conflict trap are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit dd7da3589a804138a46e6a2b58b2600b6f8ff8f2)

* fix(provider): co-resident loads fund every model's KV floor before the proportional split

0.10.5 providers report "loading 'gemma-4-26b-qat-4bit' would leave a model
without its fixed request workspace, admission watermark and 1.0 GB minimum KV
allowance (fleet KV budget 51467271830 B across 7 slots) — refused", and the
same for gpt-oss-20b at 54999766706 B, with every floor far inside the budget.

resliceGrants split the fleet KV budget only in proportion to each slot's
fp16 rate x min(context, 131072). A resident with a small rate but a real
fixed request workspace gets less than its own floor once a seventh model
joins: on a 192 GB Mac with Ternary Bonsai 2 27B, Qwen3.8 27B, Qwen3.6 and
Qwen3.5 35B-A3B, Gemma 4 26B and Nemotron 3.5 Lightning resident, Lightning
(6,144 B/token; nine recurrent generations with its assistant, a floor of at
least 1.587 GB) is offered 1.443 GB, while all seven floors total 9.9 GB of
the 51.5 GB budget.

Given the floors, resliceGrants keeps the proportional result whenever it
clears every floor (configurations that load today keep identical grants).
Otherwise, if the floors fit, each slot gets its floor plus its weighted
share of the rest; if they do not, the proportional result stands and the
floor check refuses as before. Every re-slice passes the floors: ProviderLoop
and StandaloneServer loads with the MTP target-only retry, the managed Super
newcomer, the reserve-raise preflights, native MiMo, and both regrow paths,
so an unload or reserve change cannot shrink a slot below its floor.

Tests: real EngineV2 residents with their fixed workspace reproduce the
refusal through ProviderLoop and StandaloneServer and are admitted after the
fix; a plain regrow cut Lightning to zero serving width and now keeps its
floor. Pure tests pin the reported budgets, unchanged results when nothing
starves, refusal for infeasible or unprovable floors, and Σ ≤ budget. The
Super capacity test that used proportional starvation as its trigger now
asserts that Super loads at its floor, and a genuine shortfall still refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(release): render the KV reslice floor fix into provider 0.10.6

The clustering branch adds one pending fragment to the 106 this
preparation rendered: kv-reslice-slot-floors.md ("Models load when every
model's minimum KV fits").

CHANGELOG.md: the v0.10.6 block is a fresh
`changelog.py render --version 0.10.6 --date 2026-10-31` of all 107
fragments pending on the clustering branch (249101f), minus its
heading line and the blank line after it, byte for byte. Against the
106-fragment render it only inserts that entry, in filename order. The
notes count 107 entries. The fragment is removed, so changelog.d holds
only its README; the version stays 0.10.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(provider): a newcomer's KV floor is checked only when its engine is assembled

The re-slice funds every resident's floor first, but a newcomer has no
engine yet and counts only the base 1 GiB floor. A newcomer with a small
KV rate and its own fixed workspace can therefore still receive less than
its floor and fail at assembly with no_kv_headroom: Nemotron 3.5
Lightning loaded seventh beside the reported residents gets 1.443 GB
against its 1.587 GB floor (serving width 0), unchanged from 0.10.5.

hardware-support.md now states that limit where the floors are described,
and inference.md says the re-slice, not every load, refuses only when the
floors exceed the fleet KV budget. Behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(provider): local server regrow and reserve check keep a starved slot's KV floor

The fix passes slot floors at both regrow paths and both reserve checks,
but only the ProviderLoop pair had a test. Dropping the floors from
StandaloneServer.resliceGrowSurvivors and reserveKeepsSurvivorsServiceable
left all 350 selected tests passing.

The new test mirrors the ProviderLoop one on the same seven-slot scenario:
it first checks that the server's own budget starves Lightning under the
plain proportional split, then expects the reserve check to pass and the
regrow to leave every resident at its floor with serving width, within the
budget. With either floors argument removed it fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(provider): the KV floor changelog entry names the refusal it removes

"A load is refused only when the minimums together exceed the budget"
promised more than the split can check. The model being loaded counts
only the 1 GB base minimum until it is built, so Nemotron 3.5 Lightning
loaded beside several high-rate models can still fail with no KV
headroom, as on 0.10.5. The entry now says the message appears only when
the minimums exceed the budget, and states that limit.

Release preparation already rendered this fragment into CHANGELOG.md;
the matching one-line change there equals changelog.py render of the
new fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jonathan308 <5055076+jonathan308@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: David Tai <dtaipublic@gmail.com>
…lease snapshot

The squash of PR 1694 carries dev's PR 1690 and PR 1692 again, so eight
files conflict. Six files that dev changed only through PR 1692 take
master's version: PR 1694 refined them after PR 1692 merged.

- docs/reference/configuration.md
- ClusterRuntimeApprovalFacts+Release.swift
- DistributedInstalledPairServingGrant.swift
- ClusterRuntimeFactsCommand.swift
- ClusterRuntimeApprovalFactsTests.swift
- ClusterOwnerServingTests.swift

Two files take master's version plus dev's PR 1696 change:

- docs/operations/provider-release.md: master's text in the three
  conflicting paragraphs; PR 1696's shard lines merge cleanly.
- scripts/test-provider-release-pipeline.py: master's file plus PR 1696's
  two tests (qualification shards, cluster helper cache).

The result is the tree of the real-history merge of PR 1695's head and
dev. Package.swift, BuildEnvironmentTests.swift, the version (0.10.6) and
CHANGELOG.md are master's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR 1695 rendered these eight fragments into CHANGELOG.md v0.10.6 and
deleted them. Its merge of the PR 1694 squash added them again, so master
has them. Each line of each fragment is in the v0.10.6 section, and the
next render would add them a second time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-31b

Release dev into master: heartbeat fix, release cluster facts, sharded release qualification (merge commit, not squash)
…red widths

Each rank of a Qwen tensor-parallel pair now logs its decode routes once per
loaded model when the native executor starts (qwen-tp-decode-census-v1): every
projection's route (the batch-invariant kernel, a row-parallel FP32 partial on
it, or MLX's own kernels with the reason) with each shape's layout per vector
count, the residual-norm form, the paged attention geometry and partition size,
the selection, and any arithmetic switch the launcher set. Host values only.

QwenTensorParallelRowsCheck checks the row contract at the registered
Qwen3.8-27B per-rank widths with random affine 4-bit weights (three Gated
DeltaNet layers and one attention layer, the full 248,320-row vocabulary): a
row's logits and history equal its run alone on a one- or eight-lane host,
beside rows of 100 to 4,600 tokens that join and leave, across two KV segments,
while an assistant observes the cohort, and at every position of a four-column
verify window alone and in a cohort. It runs both ranks in one process
(QwenTensorParallelRealGeometryRowsTests, QWEN_TP_REAL_GEOMETRY_GPU=1) and as
two processes over the loopback ring (darkbloom-cluster-tp-check qwen-rows,
native or sealed sums, with the worker's arithmetic environment). On an
M5 Ultra every comparison is bitwise equal, so the plain c8 non-equality seen on
the real pair does not reproduce synthetically; the census and the tool are for
the real-pair and real-checkpoint runs that remain.

No serving arithmetic changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Greedy selection now sums each rank's non-finite logit count beside its
maximum and first global index (as the assistant's greedy choice already does),
and a sampled cohort counts its gathered rows; both ranks read the counts from
the same evaluation that yields the tokens. A non-finite logit on either rank
fails both ranks before any token is chosen, a sampler advances or anything is
published. Before, the rank that saw it failed alone at the decode step's
separate finiteness read and its peer waited in the selection collective; that
read is gone (validateLogits keeps the shape and dtype checks), so a decode step
pays one host synchronization fewer. Every selected token is unchanged.

nativeNonfiniteRowsOnOneRankFailBothRanks puts non-finite logits on rank 1's
vocabulary rows only: against the previous selection the test process trapped
after the wire's 30 s deadline (the peer never met it); now both ranks fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The greedy selection's sealed all-sum now carries six words a row (each
rank's maximum, first global index and non-finite count) where it carried
four. Bind that into the decode agreement fields
(qwen-tensor-parallel-selection-nonfinite-in-sum-v1), as the routed-expert
packed collective and the fenced sums are bound, so a rank whose selection
sums other words refuses to load beside this one instead of meeting it in a
sealed sum of another length. A pair of the same build is unchanged.

nativeNonfiniteSampledRowsOnOneRankFailBothRanks covers the gather path: a
sampled row with logprobs whose non-finite logits sit on rank 1 only fails
both ranks before rank 0 samples or captures a logprob. The non-finite cases
now also check that each rank's failure is selection's own refusal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws check

The census is logged on every load, so it takes the darkbloom- prefix that
every always-on runtime line has (darkbloom-qwen-tp-decode-census-v1); the
unprefixed qwen-tp-*/glm-* lines are timing diagnostics. Its documentation
now says what the line does not show: a Gated DeltaNet layer's four input
projections run as one fused call, SwiGLU fuses only while the decode
fusions are on, and a routed-expert row's switch projections are not listed.

QwenTensorParallelRowsCheck counts a candidate digest that its reference
lacks as a difference instead of skipping it, and marks non-finite logits
rows, refusing to report a marked reference after both ranks' last
collective. Selection now holds the serving finiteness check, and the check
never selects. qwen-rows synthesize refuses a malformed --layers.

Docs: inference.md says when the census is logged, what the rows check
refuses and that qwen-rows run reads a checkpoint without the product's
verified load; test.md lists QWEN_TP_REAL_GEOMETRY_GPU=1 and the qwen-rows
commands, and names MLX_QMV_BATCH_INVARIANT=1 for the QWEN_TP_MTP_GPU=1
runs; the changelog leads with the behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308 jonathan308 added area:provider Provider (Rust, runs on Apple Silicon) area:docs Documentation work specific to a component or feature labels Nov 1, 2026
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 1, 2026 11:03pm UTC
d-inference-console-ui-dev Error Error Nov 1, 2026 11:03pm UTC
d-inference-landing Ready Ready Preview Nov 1, 2026 11:03pm UTC
darkbloom-status Ready Ready Preview Nov 1, 2026 11:03pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 1, 2026 11:03pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head 53faf8e8d0fe against base 84ddfdba6bb7.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Service returned HTTP 409; no automatic paid retry

Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging.

Human review required: CI did not complete the security review. A maintainer must review the saved findings and remaining scope. A green advisory job is not security clearance; do not manually rerun the paid scan.

Failure diagnostics: STATE_WRITE_FAILED

Coverage: 13/84 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned.

Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens.

Saved findings and earlier report · Historical findings are not confirmed resolved.

Bedrock: 4 request(s), 200787 uncached + 0 cache-read + 0 cache-write input / 2637 output tokens; 0 request(s) with unknown usage. OpenRouter backup used 0 time(s). Dollar amounts above cover OpenRouter only; AWS billing is reconciled separately.
Workload allowance: 30 native request(s), including one shared response repair; 500 emergency ceiling. Selected depth and integration rounds are admitted as their scope becomes known.

@davidtai
davidtai changed the base branch from master to dev November 3, 2026 04:05
davidtai
davidtai previously approved these changes Nov 3, 2026

@davidtai davidtai 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.

Approved for the 0.10.7 release (David's order, 2026-11-03). Full-diff review: ~/projects/layr-labs/work/release-0.10.7/provider-lane-review.md. Composition check: draft #1734, CI run 41576184751 green.

@jonathan308
jonathan308 dismissed davidtai’s stale review November 3, 2026 04:28

The merge-base changed after approval.

@davidtai
davidtai merged commit 42b90e0 into dev Nov 3, 2026
36 of 38 checks passed
@davidtai
davidtai deleted the perf/qwen27-tp-decode-loop branch November 3, 2026 04:31

This branch had an error being deployed

2 failed and 3 active deployments
Preview – d-inference-landing — 53faf8e8 Deployed Nov 1, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 53faf8e8 Deployed Nov 1, 2026 by vercel[bot]
Preview – darkbloom-status — 53faf8e8 Deployed Nov 1, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 53faf8e8 Deployed Nov 1, 2026 by vercel[bot]
Preview – d-inference — 53faf8e8 Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation work specific to a component or feature area:provider Provider (Rust, runs on Apple Silicon)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants