Repository navigation
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 intoNov 12, 2026
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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
changed the base branch from
release/candidate-0.10.12c
to
release/candidate-0.10.12d
November 12, 2026 06:22
…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
merged commit Nov 12, 2026
ed1431d
into
release/candidate-0.10.12d
31 of 34 checks passed
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.release/candidate-0.10.12d=0b52123a18, the merged 0.10.12 candidate indev. It was merged into this branch with a signed merge commit,13bbaad74e, with no conflicts. The branch started from Release preparation: provider 0.10.12 into dev #1970'srelease/candidate-0.10.12cat0e6ac37885.fix/deadline-refusal-streak-expiry, headb4e1d9425e): its 8 commits, cherry-picked. The only conflicts were two "Last updated" lines, which keep0e6ac37885's dates. No otherdevcommit is included.earnings/review-1956-1957.md(§5), which held fix(provider): a stale slow prefill estimate stops refusing after three deadline refusals #1956 for 0.10.13: the code was correct, but a 55 h production replay found about zero gain, and it could admit a customer request that was already out of time.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:
startModelCalibrationIfNeeded.ModelCalibrationPolicy.evidenceRefresh).DeadlineRefusalStreak.minimumRemainingBudget). Refusals at a fresh rate and late retries never count (must-fix 2)probeInterval), whether or not the probe is preemptedunmeasured_prefillas an unmeasured engine)infoline 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)expiresStaleEvidence()permitsEvidenceProbe(at:): it permits a probe, not an admission (the review suggestedpermitsUnprojectedAdmission(at:)for the admit path)DARKBLOOM_TTFT_ADMISSION_FIXES=0still turns it off, with the other estimator fixes, and no new key is required.Tests (red-first, then a refactor pass)
6334dd0cd2holds the red tests. They use only #1956's own API, so they compile on #1956's code.AdmissionRateEstimatorTests, scripted engine): 5 of the new tests fail on0e6ac37885+ fix(provider): a stale slow prefill estimate stops refusing after three deadline refusals #1956 (11 issues):projectedAdmissionEndsPartialStreakpasses on fix(provider): a stale slow prefill estimate stops refusing after three deadline refusals #1956, as it should, and kills the mutant (below).ProductionModelCalibrationTests.staleRefusalStreakRerunsTheProbe): a real QwenEngineV2refuses 3 × 1,000 tokens at a seeded stale 50 tok/s with no anchor (12 s budget).projection = boundedat the probe's rate. A second start is refused.c8e7d99b99is the fix,e35c7d7591the docs,ec21d8620bthe refactor (the log line wrapped) and57a8b1d1db, 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:ModelCalibrationTestsandProductionModelCalibrationTests(bootstrap once per engine is unchanged);IdleCalibrationCoordinatorTests,DeadlineDecisionBridgeTests;ObservedRateDeadlineAdmissionTests,PrefillEvidenceRecoveryTests,DecodeInterleaveDeadlineAdmissionTests.Mutants (
earnings/fold-d-evidence/mutants.txt)All 8 were killed:
recordAdmission()on the projected path);evidenceRefresh = false, killed by the GPU test.57a8b1d1dbfixes 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 on57a8b1d1db)fold-more-0112.sh's steps: undo the Prepare, then natural merges of Cluster (0.10.12): a stopped pair keeps its last mode on restart #2013cbefdc6c81, DO NOT MERGE: 0.10.12 fold C — #1937 on candidate #1970 (Gemma pipeline keeps the lookahead; a saved serial width is checked whole at load) #2015705041cdc9, Provider: a refused request's inference_error frame names its reason #201637320cbf41, Provider: darkbloom status shows the answers in progress #20173ec9c41d6c, DO NOT MERGE: 0.10.12 fold B — count a held local stream once at the fallback width #2018f689fa5935, DO NOT MERGE: 0.10.12 fold B — Qwen3.5-9B takes 64 images; media gate refusal is media_memory_unavailable #2019f85f581616, DO NOT MERGE: 0.10.12 fold B — loop guard on Super's own text route #20205d5318fee9, 0.10.12: move the SDK pin to mlx-swift-lm main 44ab17555f (#403 paged allocator, #404 MTP events) and re-apply #1961 #2021c682981e25and 0.10.12: Bonsai 2 27B prompts batched again on a single Mac (mlx-swift 1b3520fe94); pairs keep per-row arithmetic #202283f4962351, then this PR. Every step is clean.changelog.d/cluster-onboarding-simpler.md(deleted by the Prepare, modified by Cluster (0.10.12): a stopped pair keeps its last mode on restart #2013). It conflicts the same way with bare0e6ac37885, so it is not this PR's.EngineV2Bridge+Submission.swift(Cluster (0.10.12): a stopped pair keeps its last mode on restart #2013). It auto-merges.Real-Mac check (in-process on Mac A, M5 Ultra; 03:41Z; 5 s;
earnings/fold-d-evidence/realmac-run.txt)EngineV2in a production bridge, with the real posture gate. The test was throwaway and never committed. It ran on theec21d8620bsources; the head differs only in one test.deadline_unreachablefrom the real scheduler:prefill_tps 50.0,projected_decode_tokens 0. Streak 1 → 2 → 3accepted,bounded,prefill_tps 748. First content after 0.38 scancelled by request) and published nothing. The customer got first content after 0.17 s with 16 tokens. The interval then heldRound 2 (11-12): retarget, the CI failure, review-2024's should-fixes
13bbaad74erelease/candidate-0.10.12d(0b52123a18); no conflictse8227d2b0a6391bf8bceDARKBLOOM_TTFT_REFUSAL_PROBE(own off switch, default on, forwarded to launchd) and no probe on battery. 111 CPU tests in 14 suites pass3f83740a3econfiguration.mdrow,cli-reference.mdpassthrough row,inference.md,hardware-support.md,test.md, the fragmentThe 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:Both still fail on #1956's code. Review should-fix 1 is added too: starting the probe sets
probeAvailableAt = start + 120 sand 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 hitClusterMemberServeLoopTests. Pairs never probe. "build.db is locked" is SwiftPM's shared build database, contended by the job's parallelswift testprocesses.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:ProviderLoop, the only caller ofstartModelCalibrationIfNeeded;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:
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.unprojectedAdmissionEndsPartialStreak(the reviewer's patch) kills r-unproj-reset, andcancelledAdmissionEndsPartialStreak(a scripted admission cancellation) kills r-cancel-reset.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.shis prepared on3f83740a3e(CPU only), andcheckreports 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
3f83740a3e, attempt 2 (07:16Z). Provider Unit Tests shards 1 and 2 and Provider Tests: success.staleRefusalStreakRerunsTheProbe.--failed:502 Bad Gateway;57a8b1d1dbfailed: the probe bar (fixed) and flakes on a degraded runner (above).