Repository navigation
Conversation
Add `CBv2MTPRoundAuditRecord` and `CBv2MTPMetrics.roundAudits`. Every finalized VERIFY round now leaves one snapshot record built at the existing finalize host-sync boundary from values already on the host: the draft ids, the target argmaxes, the accept boundary, the rollback width, and the row's post-round scheduler accounting. No extra MLX evaluation and no new host readback. Retention is bounded at 8192 records with oldest-first eviction. A consumer that reconciles audits against committed streams refuses when the count reaches the cap, because a truncated head cannot prove coverage. No consumer or seam is wired here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
davidtai
added a commit
that referenced
this pull request
Sep 5, 2026
The bench-worker free-run audit reads that journal, so this branch builds on it. No conflicts: #132 touches only the MTP finalize/driver seam and its own tests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
davidtai
added a commit
that referenced
this pull request
Sep 5, 2026
… bag Wire the free-run audit to `CBv2MTPMetrics.roundAudits` (#132), so a free_decode_run response states what the engine journaled rather than what the worker could infer from the tokens it drained. `FreeRunRoundAudit.assemble` groups the records — one per (row, round), in finalize order — by row and reads them position-wise: a row's r-th record IS its r-th round, and a row that stopped early simply has no record past its last one, which is what makes `active_streams_by_round` non-increasing without computing it from anything else. From that: acceptance_lengths per-round committed width (rows must agree; a cohort commits ONE common width, and disagreement refuses) drafted_total sum of every record's k accepted_total sum of min(accepted, confirmed) — the `observedAccepted` the engine's own cumulative counter accumulates committed_total the drained count, which the schema requires equal tokens.len(); the journal's own sum EXCEEDING it refuses, while under-counting is legitimate (a target-only decode step commits without a round) rounds, natural_accepted_by_stream, active_streams_by_round the v1.2 COHORT trio, emitted only in the cohort form depth_clamp_reasons the controller's skip/fallback counts, windowed `spec_decoder` and `verify_replay_disagreements` have no journal field at this pin and stay ABSENT — naming the request's own mode back is not a report, and absent is not 0. A journal at its 8192-record cap REFUSES the response by name: a truncated head cannot prove coverage of the window, mirroring the 125B worker's rule. The window opens after the seed forward, so the seed's records are never counted as the timed run's. Also: bench-worker's runtime-worker gains a repeatable `--resource <name>=<path>`. Each occurrence becomes an entry in RunnerLoadOptions.resources. A name may appear once, the path must exist and be a regular file or a directory, and both refusals fire BEFORE the load — a bad path found after a multi-minute weight load has wasted the box's time to report something argv already knew. Values pass through opaque; the worker never opens them. `RunnerResources` and `RunnerError.resourceMissing` are declared identically to #133 so that branch rebases cleanly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 5, 2026
Author
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.
Upstreams the per-round MTP audit journal that the Qwen 3.8 125B engine has carried as a vendor-local patch since its ed55bee base and never sent back. Verbatim port:
CBv2MTPRoundAuditRecord(requestID, k, draftTokens, targetTokens, accepted, confirmed, rejected, tokensCountAfter, numComputedAfter, generatedAfter, finishReason) and a boundedroundAuditsonCBv2MTPMetrics(retainedRecordCap = 8192, oldest evicted first; a consumer that reconciles audits against committed streams refuses at the cap). Populated at the finalize host-sync boundary from values already on the host; no extra MLX evaluation.Why now: a bench-worker free run must report per-round acceptance lengths and related audit counters from engine state, and fork main keeps only cumulative metrics. The runner scaffold (#131) will read
roundAuditsthrough its round-auditing seam once this lands.Adaptations vs the vendor patch: one renamed local on main (
committedAccepted->observedAccepted) and a comment re-wrap. Diff +109/-2 over MTPContractsV2.swift, EngineLoopV2+MTPFinalize.swift, CBv2MTPRoundDriver.swift.Tests (GPU-free, xcodebuild):
CBv2MTPRoundAuditTests2/2 (depth-2 free run over the deterministic fixture reconciles every record with the committed stream and the cumulative counters; cap evicts oldest-first) andCBv2MTPEngineParityTests13/13 unchanged. Not covered: B>1 audits (requestID disambiguation) beyond the code path.🤖 Generated with Claude Code
Dependencies
This PR: Per-round MTP audit journal.
Depends on: nothing. It can merge first..
Needed by: mlx-swift-lm #131.
Merge order in this repository: #136, #132, #135, #130, #131, #133, #134, #137.
Program map: see
work/darkbloom-runner-contract.mdsection 16 (Runner Program) in the layr-labs workspace.