Skip to content

0.10.12: a stale prefill estimate that keeps refusing gets one idle probe, never an unprojected request (#1956 reworked) - #2024

Merged
jonathan308 merged 17 commits into
release/candidate-0.10.12dfrom
fold/1956-stale-prefill-probe-0112
Nov 12, 2026
Merged

jonathan308 merged 17 commits into
release/candidate-0.10.12dfrom
fold/1956-stale-prefill-probe-0112

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Status

Draft, for provider 0.10.12 (owner, 11-12: "anything you set for .13 lets pull into 12", then "make sure we pull what we can into .12"). Opened by an agent (FOLD-D session; notes in earnings/FOLD-D-1956.md). An independent reviewer follows.

What this builds: the review's recommended design (§5.6)

A full streak re-runs the existing idle-calibration probe. It never admits a customer request without a projection.

The design is small because it reuses the existing probe:

  • It is one extra condition in startModelCalibrationIfNeeded.
  • It adds one cell list (ModelCalibrationPolicy.evidenceRefresh).
  • It runs at most one probe per Mac and model per 120 s.
  • No wire, coordinator, configuration or SDK change.
#1956 as pushed This PR
A full streak (3 refusals) admits the next request of ≤ 1,024 tokens unprojected the next capacity tick that finds the Mac idle at nominal posture re-runs the probe: one solo, uncached cell of 512 prompt + 32 output tokens, no shape warmup. Every rule of the startup probe applies (any foreground request preempts it; a posture change discards it). It publishes as a calibration cell, so it replaces the stale estimate and the anchor
A late retry (300 ms left) after a full streak admitted unprojected, certain to miss refused at once, priced from the estimate (must-fix 1, by construction)
What counts toward the streak any bounded, prefill-only refusal on an idle ordinary engine additionally: the isolated aggregate had expired (> 120 s), no fresh prompt-size bucket priced the prompt, the rate was below the anchor if there is one, and ≥ 5 s of budget was left (DeadlineRefusalStreak.minimumRemainingBudget). Refusals at a fresh rate and late retries never count (must-fix 2)
Long prompts refused, and they leave the streak full; the cap excludes them they count, and the probe re-measures for them: the 1,041-refusal case of the review
Rate limit 1 admission per 120 s after a full streak 1 probe start per 120 s (probeInterval), whether or not the probe is preempted
Observability none (it reports the same unmeasured_prefill as an unmeasured engine) one info line per probe (darkbloom.DeadlineRefusals): Deadline refusals: <model> re-measures stale prefill evidence with one idle probe after 3 refusals at <rate> tok/s (evidence <age> s old, anchor <anchor or none>, last prompt <n> tokens)
Naming expiresStaleEvidence() permitsEvidenceProbe(at:): it permits a probe, not an admission (the review suggested permitsUnprojectedAdmission(at:) for the admit path)
  • Not done: fix(provider): a stale slow prefill estimate stops refusing after three deadline refusals #1956's own kill switch (review should-fix 4). DARKBLOOM_TTFT_ADMISSION_FIXES=0 still turns it off, with the other estimator fixes, and no new key is required.
  • Expected production effect: small. An anchored engine at nominal posture already prices expired evidence at its anchor or above, so its refusals don't count. The probe is for engines with no anchor, and for evidence still stale when posture returns to nominal. Once a probe has measured, it is the anchor, so a Mac really this slow stops counting (it is self-limiting). The log line measures how often it fires.

Tests (red-first, then a refactor pass)

6334dd0cd2 holds the red tests. They use only #1956's own API, so they compile on #1956's code.

c8e7d99b99 is the fix, e35c7d7591 the docs, ec21d8620b the refactor (the log line wrapped) and 57a8b1d1db, the head, the m3 test's deflake. With the fix, 33/33 estimator tests and the GPU test pass. A wider local run (19 suites, 146 tests) passes, including:

  • ModelCalibrationTests and ProductionModelCalibrationTests (bootstrap once per engine is unchanged);
  • IdleCalibrationCoordinatorTests, DeadlineDecisionBridgeTests;
  • ObservedRateDeadlineAdmissionTests, PrefillEvidenceRecoveryTests, DecodeInterleaveDeadlineAdmissionTests.

Mutants (earnings/fold-d-evidence/mutants.txt)

All 8 were killed:

  • m3, the review's survivor (drop recordAdmission() on the projected path);
  • the stale-evidence check, the 5 s floor, the anchor check and the fresh-bucket check;
  • the probe interval, and the probe's streak reset;
  • evidenceRefresh = false, killed by the GPU test.

57a8b1d1db fixes a race in the m3 test. The bridge retires a finished request on its own actor hop, so the next refusal could find the Mac still busy. The test now waits for the retirement: 15 of 15 runs pass, and m3 is still killed.

Merge-check (git merge-tree, re-run on 57a8b1d1db)

Real-Mac check (in-process on Mac A, M5 Ultra; 03:41Z; 5 s; earnings/fold-d-evidence/realmac-run.txt)

  • Setup: a real Ternary Bonsai 2 9B EngineV2 in a production bridge, with the real posture gate. The test was throwaway and never committed. It ran on the ec21d8620b sources; the head differs only in one test.
Step Result
Stale slow evidence, no anchor Seeded 50 tok/s, 300 s old. Nothing due
3 × 1,000 tokens, 12 s budget deadline_unreachable from the real scheduler: prefill_tps 50.0, projected_decode_tokens 0. Streak 1 → 2 → 3
The probe, once Started under the real posture gate and logged its line. Done in 1.52 s at 748 tok/s, which became the anchor. A second start was refused
The next request is priced from it accepted, bounded, prefill_tps 748. First content after 0.38 s
Honest long prompts (3 × 26,408 tokens, 10 s budget, fresh 1,320 tok/s) All refused, streak stays 0. Nothing due even at now + 121 s
Late retry after a full streak (800 tokens, 300 ms left) Refused at once, not counted
A customer request during the probe The probe was preempted (cancelled by request) and published nothing. The customer got first content after 0.17 s with 16 tokens. The interval then held

Round 2 (11-12): retarget, the CI failure, review-2024's should-fixes

Commit What
13bbaad74e Merge of release/candidate-0.10.12d (0b52123a18); no conflicts
e8227d2b0a Tests (red), with inert scaffolding: the switch, the AC gate and the passthrough exist but aren't read yet. 3 of 38 estimator tests fail with 10 issues
6391bf8bce Fix: DARKBLOOM_TTFT_REFUSAL_PROBE (own off switch, default on, forwarded to launchd) and no probe on battery. 111 CPU tests in 14 suites pass
3f83740a3e Head. Docs and changelog: configuration.md row, cli-reference.md passthrough row, inference.md, hardware-support.md, test.md, the fragment

The probe bar. CI run 43150900923 failed ProductionModelCalibrationTests.swift:333: measured > 1_000, while the VM measured 905.45. The probe ran; the absolute bar was wrong. The new bar is hardware-independent:

  • the probe's cell is the anchor;
  • it measured at least twice the stale 50 tok/s, which fits the follow-up 1,000-token prompt in 12 s.

Both still fail on #1956's code. Review should-fix 1 is added too: starting the probe sets probeAvailableAt = start + 120 s and ends the streak (kills g-start-record).

The other three failures in that run are flakes from a degraded runner, not #2024:

  • The runner: shard 1 took 29 min against 7 min in three other runs today. The same selections took 1015–1195 s against 177–285 s. Busy vCPUs averaged 8.57/12 against 1.74–1.99, and the unchanged toy shape warmup took 25 s against 0.5 s, before any probe ran.

  • sends idle heartbeats at the configured interval: spacing 2.075 s against a 2.0 s bound. Its fixture serves no model, so no bridge exists and none of 0.10.12: a stale prefill estimate that keeps refusing gets one idle probe, never an unprojected request (#1956 reworked) #2024's code runs.

  • Leader member serves an encrypted request through its pair slot: no registration within 15 s, before any pair slot existed; the same timeout hit ClusterMemberServeLoopTests. Pairs never probe. "build.db is locked" is SwiftPM's shared build database, contended by the job's parallel swift test processes.

  • bothClipsServeOnTheInstalledFixture → .decodeAllowanceSpent: that is the AVFoundation frame decoder's wall-time allowance (about 6 s for these clips), not an inference budget. The probe can't run in that test:

    • there is no ProviderLoop, the only caller of startModelCalibrationIfNeeded;
    • its requests carry no deadline, so nothing is refused or counted;
    • its budget has its own idle-calibration owner.

    The job's only real probe ran in another process at 04:23:11Z for about 0.6 s, after the slowdown had begun.

Review-2024 §5:

  • Should-fix 4 (own switch): done, as above.
  • Should-fix 5: no probe on battery. A due probe at nominal posture also needs DeadlinePowerPolicyReader.activeSource() == "ac", the existing IOKit reader. A full streak waits for AC power, and the startup calibration is unchanged. No user-activity gate: neither calibration nor ProviderCore has one to reuse.
  • The two surviving mutants: unprojectedAdmissionEndsPartialStreak (the reviewer's patch) kills r-unproj-reset, and cancelledAdmissionEndsPartialStreak (a scripted admission cancellation) kills r-cancel-reset.
  • The nit: "Three estimator corrections and a refusal probe" in inference.md.

Mutants, round 2 (CPU, fold-d-evidence/mutants2.txt): 6 of 6 killed. r-unproj-reset, r-cancel-reset, the switch in counting, the AC check, the launchd passthrough, and the switch parser.

Real-Mac re-check. fold-d-realmac.sh is prepared on 3f83740a3e (CPU only), and check reports ready. It now also exercises the AC gate for real: it starts the probe through the production posture and power gates. It runs only in a slot (FOLD_D_GPU_SLOT=1 … run), for PROOFS.

For the Prepare redo: render changelog.d/deadline-refusal-streak-probe.md (0b52123a18's Prepare doesn't include it).

CI

  • Green: run 43169814730 on 3f83740a3e, attempt 2 (07:16Z). Provider Unit Tests shards 1 and 2 and Provider Tests: success.
    • Shard 1: 986 / 180 / 1,120 / 1,519 tests passed, including staleRefusalStreakRerunsTheProbe.
    • Shard 2: 792 / 894 / 2,842.
  • Attempt 1: every Swift test passed, including the earlier flakes. Two infrastructure failures, re-run with --failed:
    • the prompt-fixture download got a proxy 502 Bad Gateway;
    • an artifact upload never finished.
  • The earlier run 43150900923 on 57a8b1d1db failed: the probe bar (fixed) and flakes on a degraded runner (above).

jonathan308 and others added 12 commits November 11, 2026 19:20
…ate in force

A refused request starts no work, so it measures nothing. On an ordinary
engine with one slow isolated-prefill sample and no calibration anchor,
every later request is projected at that sample's rate and refused until
the 30-minute idle expiry, however old the sample is.

Add failing tests for the intended rule through the real submission path
with a scripted engine (no model, GPU or real throughput):

- three refusals on an idle Mac with evidence older than the freshness
  window are followed by an admission that remeasures the rate;
- a Mac that remeasures as slow goes back to refusing;
- an admitted request that measures nothing does not reopen admission
  straight away;
- a full streak waits for an idle Mac.

And guards that already hold and must keep holding: a request whose
absolute deadline has passed is refused, fresh slow evidence keeps
refusing, the kill switch keeps the previous behavior, and refusals
beside another model's work are not counted.

Co-Authored-By: Claude <noreply@anthropic.com>
A deadline_unreachable refusal admits nothing, so it measures nothing. On
an ordinary engine an isolated prefill estimate that refuses an idle Mac
could therefore only be replaced by the idle rules of
IsolatedPrefillAdmissionRate: the calibration anchor after 120 s at
nominal posture, or no projection after thirty minutes. With no anchor,
with an anchor that is itself slow, or off nominal posture, one slow
sample kept refusing long prompts for the full thirty minutes.

DeadlineRefusalStreak counts consecutive refusals that only the isolated
prefill rate explains: ordinary engine, idle Mac, a bounded projection of
nothing but this request's own prompt, no reviewed calibration and no
native media. After three with no admission in between, evidence older
than the 120 s measurement freshness window stops blocking the next
request that finds the Mac idle. That request is submitted like one with
no measured rate, so its absolute deadline still applies, and its
isolated prefill replaces the expired estimate. Fresh evidence refuses
as measured. An admission that ends a full streak starts a 120 s retry
interval, so a Mac that really is too slow gets one such admission per
interval even when the request ends before it measures.

Unbounded (fail-closed) projections never count, so memory admission is
unchanged. Native engines keep their own recovery probe.
DARKBLOOM_TTFT_ADMISSION_FIXES=0 turns the rule off with the other
estimator corrections. No wire or output change.

Co-Authored-By: Claude <noreply@anthropic.com>
Document the rule in the deadline section of the inference architecture
page and in the hardware-support page's deadline admission rates, list the
new cases in the test guide, extend the DARKBLOOM_TTFT_ADMISSION_FIXES row
and note that `unmeasured_prefill` also covers a measured rate the provider
set aside as expired. Add the changelog fragment.

Co-Authored-By: Claude <noreply@anthropic.com>
The dedicated refactor pass renamed three methods on DeadlineRefusalStreak:
`refused()` to `recordRefusal()`, `admitted(at:)` to `recordAdmission(at:)`
and `estimateExpired(at:)` to `expiresStaleEvidence(at:)`. The first two
mutate and read as queries in the past participle; the third is also true
while evidence is fresh, so it should not sit beside
`isolatedPrefillEvidenceExpired()` under a name that claims the same thing.
Identifiers only: conditions, order and mutation points are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
… streak

A calibration cell wider than one row refreshes its prompt-size bucket
without touching the isolated-prefill aggregate. The refusal streak checks
only the aggregate's age, so with such a bucket fresh it would set aside a
measurement made seconds ago. This test fails until the next commit.

Co-Authored-By: Claude <noreply@anthropic.com>
The refusal streak set aside the isolated-prefill estimate whenever the
aggregate was older than the freshness window. A calibration cell wider
than one row refreshes its prompt-size bucket and not the aggregate, so a
measurement made seconds ago in this prompt's size domain could be set
aside with it. The streak now also requires that no fresh bucket covers
the prompt, which keeps "fresh evidence refuses as measured" true for both
sources the projection reads.

Co-Authored-By: Claude <noreply@anthropic.com>
… only

A full refusal streak admitted the next request of any size without a
time projection. A Mac that is honestly too slow for long prompts would
then run one long prompt to its first-content deadline every 120 seconds
where it used to refuse at once.

Pin the limit the native recovery probe already uses
(`PrefillEvidenceRecovery.maximumPromptTokens`, 1,024 tokens):

- a prompt over the limit is still refused after a full streak, and the
  streak stays full for the next small prompt;
- a slow calibrated Mac refuses long prompts however many it refuses.

The streak tests now submit a 1,000-token prompt so they stay inside the
limit. The two new tests fail until the next commit.

Co-Authored-By: Claude <noreply@anthropic.com>
…only

After a full refusal streak the next request on an idle Mac was submitted
without a time projection whatever its size. Only the absolute deadline
ends such a request, and that deadline grows with the prompt, so a Mac
that is honestly too slow for long prompts ran one long prompt to its
deadline every retry interval where it refused at once before.

The unprojected admission now takes a prompt of at most
PrefillEvidenceRecovery.maximumPromptTokens (1,024), the limit the native
recovery probe already uses. A small prompt is enough to remeasure the
rate. A longer prompt is refused from the expired evidence as before and
leaves the streak full, so the next small prompt is the one admitted.

A Mac that is sent only longer prompts is not helped by the streak: it
refuses until a small request arrives or the 30-minute idle expiry, as
before this branch.

Docs and the changelog fragment state the limit.

Co-Authored-By: Claude <noreply@anthropic.com>
…count, and a full streak must probe

Red on 0e6ac37 + #1956 b4e1d94 (review-1956-1957.md §5 must-fixes 1-3
and the recommended design):

- a full streak still refuses a small request from the stale estimate; no
  request is submitted unprojected (fails: #1956 admits it);
- after a full streak a late retry (300 ms left) is refused at once (fails);
- refusals priced at a fresh rate, late retries (3 s left) and refusals at the
  calibration anchor do not count (fail: #1956 counts all three);
- a projected admission ends a partial streak (passes on #1956; kills its
  surviving mutant m3);
- on a toy Qwen EngineV2, three real refusals over stale evidence re-run one
  solo calibration probe and the next request is priced from it (fails:
  #1956 starts no probe and admits the request unprojected).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…be, never an unprojected request

Review-1956-1957.md §5's recommended design, with must-fixes 1-3:

- No customer request is ever submitted unprojected because of a streak
  (removes #1956's `return nil` admission), so none is admitted that is
  already out of time (must-fix 1 by construction).
- `recordDeadlineRefusal` counts only refusals the stale estimate explains
  (must-fix 2): the isolated aggregate had expired, no fresh prompt-size bucket
  priced the prompt, the rate was below the calibration anchor when there is
  one, and the request still had `minimumRemainingBudget` (5 s): late retries
  never count. The existing idle / bounded / prefill-only / ordinary-engine
  conditions stay.
- A full streak makes `staleEvidenceProbeDue` true; the next capacity tick's
  `startModelCalibrationIfNeeded` then re-runs one solo uncached cell
  (`ModelCalibrationPolicy.evidenceRefresh`: 512 prompt + 32 output tokens, no
  shape warmup) through the existing idle-calibration owner: idle Mac only,
  nominal posture, preempted by any foreground request, published as a
  calibration cell (replaces the estimate and the anchor).
- Starting the probe ends the streak and starts `probeInterval` (120 s): at
  most one probe per Mac and model per interval, preempted or not. It logs one
  `info` line (`darkbloom.DeadlineRefusals`: model, refused rate, evidence
  age, anchor, last prompt tokens).
- `expiresStaleEvidence()` is replaced by `permitsEvidenceProbe(at:)` (what it
  now permits); the admit-path tests become probe tests; m3's test is the red
  commit's `projectedAdmissionEndsPartialStreak`.

No wire, coordinator, configuration or SDK change; `DARKBLOOM_TTFT_ADMISSION_FIXES=0`
still turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fragment is renamed to deadline-refusal-streak-probe.md and rewritten:
the streak re-measures with the idle calibration probe and never admits a
request unprojected. inference.md (deadlines and startup calibration),
hardware-support.md, test.md and configuration.md follow;
prediction-decision-telemetry.md returns to its 0.10.12 text (a streak no
longer produces `unmeasured_prefill`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One logical line, one source line under 120 columns. No behaviour change.

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

vercel Bot commented Nov 12, 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 12, 2026 6:42am UTC
darkbloom-status Ready Ready Preview Nov 12, 2026 6:42am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 12, 2026 6:42am UTC

Request Review

…t's retirement

A refusal counts only on an idle Mac, and the bridge retires a finished request
on its own actor hop after the stream ends. Without the wait the next refusal
could find the request still active and not count (seen once in nine local
runs, under an unrelated mutant). 15 of 15 runs pass with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2024 moves from release/candidate-0.10.12c to release/candidate-0.10.12d,
the merged 0.10.12 candidate in dev (step-3 folds and the redone Prepare).
No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 and others added 3 commits November 11, 2026 22:29
…ts, and a relative probe bar (red)

Review-2024 §5 should-fixes 1, 2 and 4, and the CI failure of run 43150900923.

- `staleRefusalStreakRerunsTheProbe` (GPU): the absolute `measured > 1_000` failed on
  a loaded CI VM that measured 905.45 tok/s although the probe ran. The bar is now
  relative to the stale 50 tok/s (at least twice it, which fits the follow-up
  1,000-token prompt in 12 s) and the probe's cell must be the anchor. Should-fix 1:
  starting the probe ends the streak and sets `probeAvailableAt` to start + 120 s
  (kills g-start-record).
- `unprojectedAdmissionEndsPartialStreak` (the reviewer's sf2 patch) and
  `cancelledAdmissionEndsPartialStreak` (a scripted `CBv2FirstTokenAdmissionCancellation`,
  `PrefillScriptEngine.cancelAfterAdmit`) kill the two surviving reset mutants
  (r-unproj-reset, r-cancel-reset). Both pass on correct code.
- Red, against scaffolding that exists but is not read yet:
  `DARKBLOOM_TTFT_REFUSAL_PROBE` parsing and its launchd passthrough; with it off,
  refusals neither count nor ask for a probe while the estimator corrections stay on;
  on battery a full streak does not probe until AC power returns.

Local run: 38 tests, 3 fail with 10 issues (the three red ones).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s on battery

Review-2024 §5 should-fixes 4 and 5 (the probe's part):

- `DARKBLOOM_TTFT_REFUSAL_PROBE` (default on; `0`/`false`/`no`/`off`, trimmed,
  case-insensitive, turn it off): with it off, refusals neither count nor ask for a
  probe, and the estimator corrections (`DARKBLOOM_TTFT_ADMISSION_FIXES`) stay on.
  Forwarded to the launchd provider job like the other rollbacks
  (`LaunchAgent.inferencePassthroughEnvKeys`). `DeadlineAdmissionFixes.isOn` is the
  shared parser.
- A due probe at nominal posture also needs AC power
  (`DeadlinePowerPolicyReader.activeSource() == "ac"`, the IOKit reader the deadline
  posture monitor already uses; read only once a probe is due). Unknown or battery:
  no probe, Low Power Mode or not; the streak waits for AC. The startup calibration
  is unchanged. No user-activity gate: neither calibration nor the provider has one
  to reuse.

Local run: 111 CPU tests in 14 suites pass, the three red tests included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`DARKBLOOM_TTFT_REFUSAL_PROBE` in configuration.md (its own row) and in
cli-reference.md's launchd passthrough table; inference.md's deadlines section
(the switch, never on battery, no user-activity gate in either calibration) and its
"Three estimator corrections and a refusal probe" (review-2024 nit);
hardware-support.md; test.md's new tests and the relative probe bar; the
changelog fragment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308
jonathan308 merged commit ed1431d into release/candidate-0.10.12d Nov 12, 2026
31 of 34 checks passed

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — 3f83740a Deployed Nov 12, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 3f83740a Deployed Nov 12, 2026 by vercel[bot]
Preview – darkbloom-status — 3f83740a Deployed Nov 12, 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