Skip to content

Provider: a memory_only cache policy per request, and SSD cache records without token IDs - #2575

Merged
jonathan308 merged 39 commits into
devfrom
feat/zdr-cache-policy
Nov 24, 2026
Merged

jonathan308 merged 39 commits into
devfrom
feat/zdr-cache-policy

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A coordinator request can now ask that nothing it sends reaches this Mac's SSD cache, and cached prompts no longer
store token IDs.

  • memory_only per request. The coordinator seals cache_policy inside the request's _darkbloom_cache
    member, either beside the cache identity or alone ({"cache_policy":"memory_only"}).
    • Such a request runs with its prefix cache off, on one Mac and on a pair alike: no prefix lookup, staging, restore,
      capture, donation or write.
    • It sends no SSD-tier prefix_cache_*_v2 evidence and skips the prompt-token piece cache.
    • Its answer and usage are those of an uncached request.
    • An absent value or the exact string "default" keeps today's behaviour; any other value counts as memory_only.
    • The policy is read with or without a nonce or scope, and on a nonce mismatch. A scope still needs the matching
      nonce, as before.
    • A plaintext cache_policy on the frame can only narrow the sealed one.
  • A second gate in every SSD store. With its cache off, a memory_only request makes no SSD read, write or index call. Should
    one run with a cache on (a RAM-only tier is a separate change), its receipt IDs come from their own range
    (MemoryOnlyReceipt: bit 62 set, the seeded engine-ID tag clear), and every entry point of both SSD tiers refuses
    that range.
  • No token IDs on disk.
    • A complete checkpoint now stores a keyed digest of its prefix (HMAC under the lookup key) instead of the
      prefix's token IDs.
    • Its MTP token tensor is checked at write and stored as zeros.
    • A restore proves the prefix against the request's own prompt and rebuilds both from it.
    • A pair's prefix records (.dbpx, versions 3/4) store their MTP history tokens as zeros and refill them from the
      prompt.
  • Old records go away on both sides.
    • Each build keeps its complete-checkpoint files in its own directory and never reads another build's files. After
      an update or a rollback, the other build's files are not reused. They become eligible for removal once unused
      (unmodified) for DARKBLOOM_PREFIX_CACHE_SSD_TTL_SECONDS (1,800 s by default and at most). While the provider runs
      on its own (not as a pair member) and its cache volume has been available since it started, maintenance (every
      60 s, and once each time a model's cache opens) removes them after that, or earlier if the disk budget needs the
      space. Otherwise they remain on disk: while the provider isn't running, serves as a pair member or started without
      its cache volume, until it next runs on its own with that volume available; after the cache location changed,
      because another location isn't walked, until that location is selected again; and when a file or directory can't
      be read (a malformed header, an unreadable or foreign cache record, a symbolic link or a misnamed entry), until the
      cache is cleared or the provider is uninstalled. Empty directories stay. Files written by builds before this
      change can contain prompt token IDs until removed. Requests with cache_policy memory_only are unaffected:
      they never write cache files.
    • Pair records of versions 1/2 are refused and removed when the plan that wrote them loads; 0.10.17 treats versions
      3/4 the same way. After an update, the old build's pair records sit in another plan directory: they are not
      reused, and they expire by TTL like other pair records, under the same conditions.
    • Files of a model the Mac no longer loads are no longer used and become eligible for removal by maintenance once
      past the 30-minute TTL.
  • Pair prefix expiry: the TTL limits reuse. Once due, a record is no longer offered for a new restore. A restore already admitted may finish. Maintenance checks for due, unpinned records on the accessible selected volume. Leases, shutdown, unavailable storage and I/O delays can postpone cleanup; there is no wall-clock file-deletion guarantee.
  • Fixed TTL switch. DARKBLOOM_SSD_KV_TTL_MODE=fixed stops a hit from extending an entry: it is not reused more
    than 30 minutes (or the configured TTL) after it was written. A later maintenance pass removes the file; removal
    has no fixed time. It applies to kv3 and to a pair's ranks (each Mac reads its own setting).
    Unset, empty or sliding keeps today's sliding TTL.
  • cache_policy_v1 is reported in Register runtime_capabilities and in the signed attestation's
    runtimeCapabilities (one detector feeds both). Each Mac of a pair reports it too, beside its hardware
    capabilities (memberRegistrationCapabilities).
  • Local switch. DARKBLOOM_LOCAL_CACHE_POLICY=memory_only serves this Mac's local API the same way, so the
    behaviour can be measured without a coordinator. Both new switches are forwarded by the LaunchAgent.
  • Counters on the local /metrics only:
    • darkbloom_cache_policy_requests_total{policy};
    • darkbloom_memory_only_ssd_refusals_total;
    • darkbloom_memory_only_ssd_tier_touches_total (stays 0).

Before

flowchart LR
  R["Coordinator request<br/>sealed _darkbloom_cache: nonce + scope"] --> H["ProviderLoop.handleInferenceRequest"]
  H --> B["EngineV2Bridge.submit<br/>prefix cache on"]
  B --> L["Engine prefix lookup"] --> S[("SSD tier kv3<br/>stage and restore")]
  B --> P["Prompt-token piece cache"]
  B --> D["Donation at request end"] --> W[("Complete checkpoint .dbk3<br/>manifest: prefix token IDs<br/>MTP tensor: token IDs")]
  B --> E["prefix_cache_*_v2 evidence<br/>rewrites cache-epoch.json"]
  B --> C[("Pair records .dbpx v1/v2<br/>MTP history token IDs")]
  S -.->|"each hit extends the TTL"| S
  C -.->|"expired: deleted only at the next write or load"| C
Loading

After

flowchart LR
  R["Coordinator request<br/>sealed _darkbloom_cache: cache_policy, nonce, scope"] --> H["ProviderLoop.handleInferenceRequest<br/>RequestCachePolicy"]
  H --> Q{"PrefixCacheSubmissionPolicy"}
  Q -->|"memory_only"| M["Prefix cache off: no lookup, stage, capture or donation<br/>no v2 evidence, no piece cache<br/>pair ranks: cache disabled"]
  M -.->|"any SSD entry point"| X["Refused: MemoryOnlyReceipt<br/>counted on local /metrics"]
  Q -->|"default"| B["Unchanged path"]
  B --> S[("SSD tier kv3")]
  B --> W[("Complete checkpoint .dbk3<br/>manifest: keyed prefix digest<br/>MTP tensor: zeros")]
  B --> C[("Pair records .dbpx v3/v4<br/>history tokens: zeros")]
  S -.->|"TTL mode fixed: a hit no longer extends the TTL"| S
  C -.->|"reuse expires; eligible cleanup pass removes due records"| C
  O[("Files of the other format")] -.->|"removed when the cache opens"| S
Loading

Files a request can still leave on disk

A memory_only request leaves none of these. A default request may cause:

File Written when Holds
kv3/<model>/<fanout>/<tag>.dbk3, attention block the request donates its prefix one block's KV rows, encrypted; public header: keyed lookup tag, weight hash, layout epoch, shapes, createdAt
kv3/<complete model>/<fanout>/<tag>.dbk3, complete checkpoint the request donates a checkpoint encrypted manifest (keyed prefix digest, tenant scope, position, tensor layout, codec) and tensors (KV, recurrent state, MTP hidden rows, MTP token tensor as zeros)
<tag>.dbk3.darkbloom-tmp.<UUID> during either write partial ciphertext; removed on failure; a crash orphan becomes eligible for removal after crashTempTTLSeconds
kv3/<model>/cache-epoch.json a model's first load; each SSD-tier prefix_cache_lookup_v2 / prefix_cache_ready_v2 epoch, binding (model ID, hashes, layout epoch, key fingerprint), next evidence sequence number
kv3/.write-budget each charged write 25 hourly byte counts and a checksum
an existing file's mtime a hit, under the sliding TTL –
cluster-prefix-v1/v1-<plan>/rank<r>/<tag>.dbpx, on a pair the request's prefix on that rank encrypted attention rows, recurrent state, MTP hidden rows (history tokens as zeros). The sealed header holds the scope, frontier counts and unkeyed SHA-256 record keys of scope and prompt (digests, not token IDs). No longer offered once due; an eligible cleanup pass can remove the file on accessible storage
cluster-prefix-v1/…/rank<r>/key-check, write-window, staging/<epoch>/… a rank's first record; each record; during a write a keyed tag of a constant; the window's start and byte count; a partial record
cluster-prefix-v1/…/rank<r>/expiry-ttl rank load, independent of requests applied TTL in seconds plus a newline, published by temporary file and rename; read without pairing credentials

None holds a token ID or text. The same table is in docs/reference/ssd-kv-cache.md.

Outside the cache, any request, memory_only included, still causes the following. None holds prompt or output
text, media, token IDs or a prompt digest:

File Written when Holds
~/.darkbloom/usage-history.json (owner-only, the last 4,096 records) each completed coordinator request (ProviderUsageHistory) request ID, session start, completion time, model, input/output/cached/reasoning token counts
~/.darkbloom/daemon-state.json while requests run (DaemonStateFile) each running request's model, 8 hex digits of its request ID's SHA-256, elapsed time, output tokens, speed; token counters; the last request's time
~/.darkbloom/provider.log the background service's output request IDs, prompt token counts, timings
Unified log during the request (ProviderLogger) fixed public lines; a loop-guard stop's public line names the request ID, model and token counts; free-form lines are private, so macOS stores them redacted
~/.darkbloom/cluster/pair-telemetry.json, served-speed.json, on a pair's leader each finished pair request (ClusterPairTelemetry) generation ID, model, mode, prompt/cached/completion token counts, first-token time, speed, outcome, route, ranks
worker.log in a pair's setup folder, on each Mac (owner-only, 4 MiB, rotated) each pair request worker request IDs; prompt, reused and stored token counts
~/.darkbloom/desktop/usage-history.json while the desktop app is open (DesktopUsageArchive) the coordinator's settled records for this Mac: request and job IDs, completion time, token counts, earnings

Both tables are in docs/reference/ssd-kv-cache.md.

Validation

  • Tests (new):
    • RequestCachePolicyTests: parsing (absent, "default", other values, non-object member); no nonce/scope; nonce
      mismatch; frame narrowing; the submission policy; the receipt range, which no seeded engine ID enters; the local
      switch; the capability in registration and attestation; LaunchAgent forwarding; the rank's TTL switch; metric
      names.
    • DistributedServingEligibilityTests.memberRegistersTheCachePolicyCapability: a pair member registers
      cache_policy_v1.
    • NemotronSuperManagedSlotTests (memoryOnlyTextLeavesTheBankAlone, memoryOnlyImagesLeaveTheBankAlone): on
      an owner with a checkpoint bank, a marked text or image request makes no lookup, restores nothing and publishes
      nothing; the unmarked requests around it miss, then hit.
    • MemoryOnlySSDTierTests (serialized):
      • both tiers refuse a memory-only receipt at every entry point;
      • a memory_only request through handleInferenceRequest leaves the SSD directory unchanged (names, sizes,
        mtimes), while an unmarked control writes.
    • CheckpointTokenFreeStorageTests:
      • no token ID in any integer width in a written file's header, manifest or tensors (decrypted);
      • a restore proves the digest and rebuilds the tensor;
      • a wrong token tensor is never written;
      • format 1 chunk 0 is refused;
      • each format's epoch record removes the other's files.
    • SSDPrefixCacheTests: fixed and sliding TTL on both tiers; the mode parser.
    • PrefixDiskTierTests (cluster): v3/v4 records hold zeros and restore exactly, a shared-history record also for
      a shorter prompt that covers its frontier; v1/v2 records are refused and removed; the fixed TTL on a rank; an
      idle rank can clean eligible records without a new write; an expired record is never revived, and a fresh capture can be admitted for replacement.
    • ClusterPrefixRecordExpiryTests: the provider's pass deletes only the tier's expired records of plan folders no
      rank holds; a later running pass removes a due record; it uses the rank's applied TTL stamp (the shorter of it and this Mac's TTL; this Mac's TTL for an empty or malformed
      stamp) on a pinned selection's saved volume and pauses for a changed volume; it repairs a plan without its lock only
      while no rank holds the root; and a new unpair replaces an unusable reclaim marker.
  • Results (local):
    • Earlier local evidence at 12270ef039: 514 provider tests in 70 suites. Two dev-namespace path tests had four assertion failures on the local host; the CI run passed. At that same head 82 cluster tests in seven suites passed.
    • CI on 12270ef039 passed (45153756890); CI also passed on 1e3daa02d1 (45258903123). Final-head CI passed at cd71d2b86f (45261556892), with no failed jobs.
    • On bb13a64d8e, the affected cluster filter passed 86 tests in seven suites and the provider expiry suite passed all three tests. The changed cases cover pinned and refused replacements, lease lifetime after a bounded close, missing lease retry, noncanonical names, saved TTL and descriptor-bound volume selection. Docs, impact and changelog checks passed.
    • At f9e5f1743b: 87 affected cluster tests in seven suites, all four provider expiry/reclaim tests, and all 41 standalone console groups passed locally. Earlier proofs for unchanged checkpoint, wire and engine paths are retained under their measured heads.
    • At 1e3daa02d1: all 33 rank disk tests, 5 provider expiry/reclaim tests, and 41 console groups passed locally. New cases cover changing the selected root, a missing or wrong volume, an old marker without identity, and interruption after plan retirement. Docs/impact/changelog pass.
    • At cd71d2b86f, six provider expiry/reclaim cases, the interrupted-retirement regression, 41 console groups, and docs/impact/changelog checks passed locally. The new case reopens the marker at the publication boundary, holds the returned plan across the first retry, substitutes another root on the same volume and confirms it is untouched.
    • At a6d123e971: the pair-cache cleanup changes (18dffd737b) add cases for a plan that lost its lock file (repaired only while no rank holds the root), an empty or malformed TTL stamp, earlier-format, malformed and multi-link reclaim markers on a new unpair, and a failed unlink on a rank. In CI the expiry/reclaim suite passes at d7510a0614; with cd71d2b86f's pair sources (Red control for #2575: cleanup tests without the fixes (do not merge) #2587) it fails exactly these cases; CI 45286436202 passed on d7510a0614 (attempt 2, after an artifact upload and a fixture download failed in attempt 1; no test failed in either). The new cases ran and passed: the provider pass, lock repair, TTL stamp and reclaim marker cases; both new single-Mac suites and the updated attention TTL case; and the rank tier's failed-retirement and retirement-recovery cases. Only the optional, non-blocking cluster GPU shards were skipped.
    • Single-Mac changes from 3fa5bde712 (signed merge fb16abaf0e): an epoch wipe that stopped early still leaves that model's due and over-budget files to maintenance and repeats at the next load; an entry past its TTL is not counted by a stage, written over as durable, or used as a delta parent, and a complete checkpoint chain past its TTL is not advertised. Tests SSDInterruptedEpochWipeTests and SSDExpiredEntryReuseTests; red control Red control for #2590: tests without the change (do not merge) #2591.
  • Red control: Red control for #2575: tests without the change (do not merge) #2576 at bb4e5d36f3 switches off the policy and format seams on 12270ef039. The expected assertions failed in run 45155436488. That remains evidence for the unchanged paths; the replacement and cleanup changes are covered by the additional regressions above. Red control for #2575: cleanup tests without the fixes (do not merge) #2587 adds only the newest cleanup tests to cd71d2b86f, without their fixes; its CI is running.
  • Mac Studio measurements: pending. All three release binaries passed SHA-256 verification. Every Gemma arm runs offline without its MTP assistant, so decode speed is not comparable with production; only comparisons between arms hold. Release and debug builds of the final head are added for the final-head arms and the update and rollback run. The first A0 attempt stopped before warm-up and contributes no timing sample; no MacBook arm was run. Release builds at dc25f81861 (BASE), 12270ef039 (NEW), and a003d6e9ef (RAM; branches from 3b585299cd)
    run a repeat-prefix replay shaped like OpenRouter traffic (synthetic prompts; 92 requests per arm). It covers:
    • default against memory_only: cached tokens, TTFT, decode speed, peak memory;
    • unmarked requests against the base build;
    • memory_only and the SSD root;
    • update to and rollback from 0.10.17 on one cache root.
  • Docs: make docs-check, make docs-impact-check BASE=origin/dev and make changelog-check pass.

Refactor pass

A separate pass went through the whole diff for behaviour-preserving cleanup (616da8d0c3):

  • one parser for the sealed and frame cache_policy values;
  • one chunk-0 manifest reader for decode and its DEBUG inspector;
  • the stage gate moved into the single function both stage takers call;
  • one release path for refused and withheld donations;
  • the fixed-TTL sites written as the original refresh code under one condition;
  • the local endpoint reads its policy once;
  • tests reuse the checkpoint fixture's donation helper, a cluster TTL test uses the tier's clock instead of sleeping,
    and one exact counter delta that parallel suites can move became a lower bound;
  • five doc stamps.

It kept every name, environment variable, metric, wire key and format. It found that Nemotron Super's image and
video route did not pass the policy on, which is fixed here (1013650a3f) with the tests above.

Independent check

A separate, read-only check went through the whole diff and every place a request can write to disk, on one Mac and
on a pair. It found four things, all fixed here:

  • A pair's shared-history record (version 4) failed to restore for a shorter prompt that covers a kept frontier, and
    was then deleted. That would have changed unmarked requests. Fixed in e1c6ebb4be, with that case in the test.
  • Pair members did not report cache_policy_v1, so no pair could take marked requests. Fixed in 780e6df261.
  • The memory-only receipt range shared its bit with seeded engine IDs, and the docs overstated when that gate
    engages. Fixed in 780e6df261 and d3ee65b997.
  • The per-request file list lacked the daemon state, logs, pair telemetry and worker log. Added in d3ee65b997 and
    above.

A second check of those fixes confirmed them and found only wording, applied in 3dd2a1d50f and 3b585299cd.
Expired pair records outliving the TTL on an idle pair came up separately, and are fixed in 52badeefbb and
3dd2a1d50f. A third check of that fix found that on a pair's Macs the provider's pass looked at the default root and
its own TTL, not those the ranks get, and suggested tightening the races around a record's expiry. Those changes landed on this branch in f1429b13f4, 8887b4e231 and 12270ef039. A further pass found issues with duplicate replacement, shutdown, locks, background settings reads and pathname-based deletion. bb13a64d8e addressed the writer, plan lease and periodic pass. The next check found incomplete unpair reclaim, combined-budget fallback and a log call under the index lock. f9e5f1743b keeps staging and the retry marker on any incomplete inspection, takes the same verified lease for switch-off and unpair, and handles eviction and admission accounting under the mutex without writing logs there. The next pass confirmed the budget, mutex, fixture and reuse wording changes. It found two remaining unpair cases: retrying on a new selection and losing the lease before final directory removal. 1e3daa02d1 records the original selection before reclaiming and renames the verified idle plan before removing its lease. The retirement check passed. The remaining marker issues were addressed in cd71d2b86f: first-return inode binding before cleanup, single-link publication by atomic rename, restart verification, and a distinct incomplete status. An independent read-only check of cd71d2b86f confirmed both changes and passed all three selected regression tests. The restart fixture uses real filesystem operations; it does not simulate physical unplug or sudden power loss. A fresh check of every cleanup, lock and volume path at cd71d2b86f then found four pair-cache cases, fixed in 18dffd737b: a plan that lost its lock file was never cleaned and blocked unpair; an unreadable reclaim marker blocked every later unpair; a malformed TTL stamp skipped a rank; and a failed unlink left a file untracked. On one Mac it found that an epoch wipe that stopped early left a model's files without maintenance, and that an entry past its TTL could still count toward reuse; 1342b58cae and 3fa5bde712 fix those. An independent read-only check of cd71d2b86f..d7510a0614 found no remaining issue beyond wording, applied in 62989397eb and here. It covered the two later test updates: the attention TTL characterization now expects the cutoff before the sweep, and the retirement-recovery case still binds recovery to the exact inode while a rank shares the root.

Limitations

  • Removal of pair cache files is best effort: a held or unverifiable plan, an unreadable TTL stamp, a missing or
    different volume, or an earlier unpair still waiting for its original selection postpones it. A TTL bounds reuse,
    not the time a file is removed.
  • On a pair, memory_only runs with the prefix cache off. A pair partition that keeps such a prefix in RAM only is
    a follow-up.
  • With the cache off, a memory_only request prefills its whole prompt every time. A RAM-only prefix tier for these
    requests is a separate, stacked change.
  • In-flight request data stays in ordinary process memory, which macOS may page to its encrypted swap, as for every
    request.
  • Some digests inside the encryption are unkeyed SHA-256, as before this change: a pair record's keys of scope and
    prompt, and a complete checkpoint's media identity. They are digests, not token IDs; file names are keyed.
  • darkbloom_cache_policy_requests_total counts coordinator requests only; local API requests follow
    DARKBLOOM_LOCAL_CACHE_POLICY and are not counted.

- Parse an optional cache_policy in the sealed _darkbloom_cache member. "default"
  or absent keeps today's behaviour; memory_only, and any other value, runs the
  request with its prefix cache off, so it never reads, writes, stages, donates
  or restores anything on the SSD tier. The policy needs no nonce or scope; a
  plaintext cache_policy on the frame can only narrow it.
- The SSD stores refuse every call made with a memory-only receipt, counted on
  the local /metrics beside requests by policy.
- Complete checkpoints store a keyed digest of their prefix instead of its
  token IDs, and an MTP assistant's token tensor as zeros; a restore rebuilds
  both from the request's prompt. The epoch binding is versioned, so either
  format's files are removed when the other opens the model directory.
- Cluster prefix records (versions 3 and 4) store history tokens as zeros.
- DARKBLOOM_SSD_KV_TTL_MODE=fixed stops a reuse from extending an entry's life.
- Advertise the cache_policy_v1 runtime capability.
Document the sealed cache_policy and its frame rule, cache_policy_v1, every
file a request can leave on disk, the token-free checkpoint and cluster
record formats, DARKBLOOM_SSD_KV_TTL_MODE and DARKBLOOM_LOCAL_CACHE_POLICY,
with a changelog fragment.
Behaviour is unchanged; formats, wire keys, metric names and the
capability string are untouched.

- SSDHybridCheckpointEnvelope: decodeManifest and the DEBUG
  inspectStoredManifestForTesting parse chunk 0 through one
  StoredManifest instead of two copies of the same member lookups. The
  PackedTokens comment says why it copies MLXLMCommon's internal encoder.
- SSDHybridCheckpointStore: takeStaged and takeNativeStaged share the
  memory-only refusal in takeStage. The write path releases a refused
  and a withheld preparation in one branch.
- SSDPrefixCache: the three fixed-TTL refresh sites wrap the original
  refresh code in one `if config.ttlMode.refreshesOnHit` each.
- RequestCachePolicy(decoding:forKey:) holds the absent/present rule the
  sealed member and the plaintext frame both read. The localServing
  comment sits on the function it describes.
- The local endpoint reads DARKBLOOM_LOCAL_CACHE_POLICY once and gives
  the same value to the scheduler engines and the Nemotron Super engine.
- MultiModelBatchSchedulerEngine: the cachePolicy comment now covers
  local requests and the prompt-token piece cache.
- Tests: the checkpoint fixture donates a given source, replacing two
  copied continuations; an inline donation replaces a copied attention
  helper; the handler test no longer expects an exact process-wide count
  of default requests, which other suites also add to; the pair rank's
  fixed-TTL test advances the tier's clock instead of sleeping.
- Docs: restamp the five changed pages that kept an older date.
…x cache off

The image and video route of the Super owner did not pass a request's cache
policy to the bridge, so a memory_only media request on an owner with a
checkpoint bank could restore from and publish to it. The policy now
reaches submitTokenized on that route, as on the text route.

Tests: a marked text and a marked image request on a bank owner make no
lookup, restore nothing and publish nothing; the unmarked requests around
them miss, then hit.
Name the provider's usage-history.json and the desktop app's settled usage
archive beside the cache files one request can leave on disk.
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 23, 2026
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 24, 2026 7:09pm UTC
darkbloom-status Ready Ready Preview Nov 24, 2026 7:09pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 24, 2026 7:09pm UTC

Request Review

A version-4 record keeps one history for all its frontiers. Its restore
sized the token buffer to the record's deepest prompt and filled it from
the request's prompt, so a shorter prompt that covers a kept frontier
failed and the record was deleted. The restore now fills only the
frontier's tokens, the part the view uses.
…eep clear of seeded IDs

A pair member registers and attests cache_policy_v1 beside its hardware
capabilities, since its ranks run a memory_only request with the prefix
cache off and the coordinator needs every member to report it.

Memory-only receipts move to bit 62 with the seeded engine-ID tag clear,
so no engine ID falls in the range. The rank no longer lists TTL_MODE as a
numeric pass-through; the mode reaches it from this Mac's setting. The
handler test checks request counts as lower bounds, since other suites
send requests alongside it.
List the daemon state, provider log, unified log, pair telemetry and
worker log beside the usage records; say that a memory_only request makes
no SSD call and when the receipt range applies; name builds before this
change instead of a release number; and say when the other format's files
of a model that is not loaded go.
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 23, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 23, 2026
jonathan308 added a commit that referenced this pull request Nov 23, 2026
# Conflicts:
#	docs/provider/direct-mode.md
#	provider-swift/Sources/ProviderCore/Inference/PrefixCache/RequestCachePolicy.swift
jonathan308 added a commit that referenced this pull request Nov 23, 2026
Release before sleep and the partial release on a covered refused charge; the up-to-2x admission cost when free memory bounds headroom; budget 0 and oversize exports; duplicates and the fixed TTL; transient heap copies; Nemotron Super and native MiMo in the configuration row; the changelog no longer repeats #2575's piece-cache change.
jonathan308 added a commit that referenced this pull request Nov 23, 2026
…ed control)

The tests of #2573 at b073324 on its base, with test-only adapters that give the base's behaviour: a memory_only request's prefix is never kept, the prompt-token piece cache has no TTL, nothing is counted, and no release point or attach rule exists. Production code is unchanged.
Expired records were deleted only inside the next write or at load, so an
idle pair kept them on disk past the TTL. A running rank now sweeps its
own expired records, and the other plans' it kept at load, every
expirySweepSeconds (60), as the single-Mac tier's whole-root maintenance.
Past its TTL a record is also never restored or kept recent. Comments name
the shared history header version 4.
Every 60 s, on a single Mac and on a pair's Macs, the provider deletes the
expired .dbpx records of plan folders no running rank holds, so a pair that
is not loaded keeps none (ClusterPrefixRecordExpiry). Comments say that a
pair member reports cache_policy_v1 beside its hardware capabilities.
The characterization test recorded that an expired attention block was still staged until the sweep removed it. The stage plan now counts only blocks within their TTL, so the test expects the cutoff in both orders, and that a refused stage leaves the files for the sweep.
List what can postpone or prevent removal on one Mac, and state that after
a switch to the fixed TTL an entry's age counts from its last recorded hit.
A throwing read inside the right side of && does not compile in #expect.
A re-donation checks its own checkpoint's TTL, not the whole chain. State
that a new unpair also replaces a marker it cannot read because of an I/O
error, so an earlier selection's pending cleanup can be dropped.
fix/zdr-ssd-residual at 8f2a14e: the existing characterization now
expects the stage cutoff before the expiry sweep.
@jonathan308 jonathan308 added the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 23, 2026
@github-actions github-actions Bot removed the run-ci Trigger one-shot PR CI run (auto-removed when run starts) label Nov 23, 2026
jonathan308 and others added 7 commits November 23, 2026 15:10
The retirement-recovery case now holds the root as a starting rank does,
then checks that an abandoned plan without its lock file goes once the
root is idle.
trust_status gains an optional coordinator_features list. While the connected
coordinator's latest trust_status lists decode_rate_age_decay, the heartbeat
stops omitting an idle slot's observed_decode_tps after
DARKBLOOM_DECODE_RATE_IDLE_MAX_AGE_SECONDS: it sends the rate and its
observed_decode_tps_age_ms, and the coordinator decays a stale rate toward the
fleet median itself. This removes the alternation between no rate (idle) and
an old one (busy) for such a coordinator.

Absent, malformed or unknown entries, a later trust_status without the entry,
and a disconnect keep today's behaviour; the heartbeat is then unchanged byte
for byte. Older coordinators never send the field and are decoded as before.

Tests: CoordinatorDecodeRateDecayTests (shared wire cases in
Fixtures/Protocol/coordinator_features_wire.json, wire shape, advertisement
lifecycle, heartbeat bytes with and without the feature).
…intenance

Each build keeps its complete-checkpoint files in a directory bound to the
build, so after an update or a rollback the other build's files are never
read. State when maintenance removes them and when they remain, and that
memory_only requests are unaffected. Comment and documentation lines only.
Records of versions 1/2 are refused and removed when the plan that wrote
them loads. After an update the old build's pair records sit in another
plan directory and follow the usual TTL cleanup. Documentation only.
Conflict in docs/developer/serving-performance-qualification.md only: both sentences kept (the decode rate before a slot's first completed request, then the decode_rate_age_decay advertisement).

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — 0ef471c0 Deployed Nov 24, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 0ef471c0 Deployed Nov 24, 2026 by vercel[bot]
Preview – darkbloom-status — 0ef471c0 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant