Repository navigation
Prepare paged checkpoints and observed forward receipts for 0.9.0 - #141
Merged
Merged
Conversation
Signed publication snapshot of reviewed source 32206d90ff69b4f42bb7703a18ac88e317358b8a. Original milestone history remains preserved locally. Only dependency publication pins differ: Package.swift.
Append-only signed publication of reviewed source 30ca217c5072c727d0eff29dc92789af5e98f2c9. Preserves the existing publication parent and original milestone history. Only reviewed dependency pins are replaced with their signed publication equivalents.
This was referenced Sep 6, 2026
Append-only signed publication of reviewed source ba5c03ea0ef495aca02c99c7a2dd2b7a32bc7668. Preserves the existing publication parent and original milestone history. Only reviewed dependency pins are replaced with their signed publication equivalents.
Gajesh2007
marked this pull request as ready for review
September 6, 2026 21:39
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
davidtai
added a commit
that referenced
this pull request
Sep 9, 2026
Brings #139 (GPT-OSS prefill pruning, fused experts, per-request timing) and #141 (paged checkpoints, complete-checkpoint prefix reuse, observed forward receipts) onto the Qwen 3.8 Flash-Next runner branch. Every conflict keeps both sides: main's new parameters and fields are threaded through the branch's keep-mask and MTP-audit paths, and the branch's parameters are threaded through main's new call sites. Conflicts and resolutions - Package.swift: keep the branch's sibling-checkout `mlxSwiftDependency` helper and move main's pinned mlx-swift revision 37572f1f into its remote fallback. Every product and target from both sides is retained. - Libraries/MLXLMCommon/Load.swift: keep both new protocols — the branch's `WeightNameFiltering` and main's `IncrementalCheckpointMaterializing`. - Libraries/MLXLLM/Models/Qwen35MTPTopTwo.swift: keep main's delegation to the shared `cbv2TopTwoRows` and keep the branch's `public` access level, which the out-of-fork Qwen 3.8 model files need. - Libraries/MLXLMCommon/ContinuousBatchingV2/AttentionV1.swift: one merged signature per call layer — `keepMask` (branch) beside `metadata`/`packet` (main) on `updateAndAttend`, `updateAndAttendRow` and `attend`, threaded through every call site. - Libraries/MLXLMCommon/ContinuousBatchingV2/LayerCacheV2.swift: pass both `keepMask` and the observation handles to `CBv2AttentionV1.updateAndAttend`. A keep-masked forward now refuses the capture by name (`keep_masked_attention_not_replayable`) instead of beginning one: the replay reference in `CBv2AttentionReplay` attends the whole retained KV with no mask, so a sparse keep mask can never replay from its receipt. - Libraries/MLXLMCommon/ContinuousBatchingV2/CBv2Contracts.swift: keep the branch's prefix-outcome documentation and add main's `pagedStorage` field to `CBv2CapacitySnapshot`, including its initializer parameter and store. - Libraries/MLXLMCommon/ContinuousBatchingV2/EngineLoopV2.swift: take main's resident prefix preview plan, `adoptedHybridTokens`, paged-stage capacity skip, per-row diagnostic and attention confirmations, chained-step `forwardShapes`, and `pagedStorage` gauge, all beside the branch's per-request timing stamps. - Libraries/MLXLMCommon/ContinuousBatchingV2/EngineV2.swift: take main's hybrid and complete prefix-cache lookup routing inside the branch's timed `makePrefixLookup`. - Libraries/MLXLMCommon/ContinuousBatchingV2/SchedulerV2.swift: keep the branch's `enqueuedNanos` and main's `reserveFullSequenceTokens` on `CBv2ScheduledRequest.init` and on `enqueue`. - Libraries/MLXLMCommon/ContinuousBatchingV2/MTP/EngineLoopV2+MTP.swift: call the now-throwing `mtpBuildRoundGraph` with `try`. - Libraries/MLXLMCommon/ContinuousBatchingV2/MTP/EngineLoopV2+MTPExecution.swift: make `mtpBuildRoundGraph` throwing and call `multimodalChunkForward` with `try`, as main does. - Libraries/MLXLMCommon/ContinuousBatchingV2/MTP/EngineLoopV2+MTPFinalize.swift: keep the branch's round-audit comment above the shared `mtp.recordRound` call that carries the audit record. - Libraries/MLXLMCommon/ContinuousBatchingV2/MTP/EngineLoopV2+MTPTargetVerification.swift: take main's per-column evaluation-target list, which adds the logit diagnostic targets, and keep the branch's host-sync counter after it. Manifest capability decode #141 added `supportsRecurrentCheckpointReuse` and `requiresNativePagedKV` to `CBv2ModelCapabilities`. The branch's Engine Protocol v1 manifest fixture, `Tests/MLXRunnersTests/Resources/engine-wire-v1-adapter.manifest.json`, is pinned byte for byte against benchd and states only the six engine flags the v1 wire shape froze (`RunnerManifest.canonicalJSON` still emits exactly those six). The synthesized decoder therefore refused the pinned file and `MockRunner` trapped. `CBv2ModelCapabilities` now has an explicit `init(from:)` that keeps the six frozen flags mandatory and defaults any flag added after the freeze. The fixture bytes and every digest are unchanged. BenchLoad fix `Sources/BenchLoad/main.swift` carried an `@main` type but is named `main.swift`, which makes the module a top-level-code module. `xcodebuild build-for-testing` rejected it with "'main' attribute cannot be used in a module that contains top-level code". The file holds no top-level statements, so it is renamed to `Sources/BenchLoad/BenchLoadMain.swift` — the same shape `Sources/BenchCBv2/BenchCBv2Main.swift` already uses. No behaviour change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
This prepares native paged KV storage, complete prefix checkpoints and recurrent/MTP state handling for the 0.9.0 provider. Allocation-aware reserves, storage ownership and asynchronous retirement share explicit contracts; diagnostics record actual completed target-forward axes so requested batch width cannot stand in for executed width.
Completed-forward receipts survive MTP rollback and cost sampling, scopes are rejected while readback is pending, and the fixtures exercise real tiny-model KV state. The Swift dependency includes the FP32-partial SDPA fix and pins the merged core and C bridge revisions.
Before
After
Source and validation
138abee8eea74b7cc72805f4e10195ba4dad4b71, Swift pind1d40d0ee2de101c5d9a04eb66d9e1b4299c6074. Reversing this single package revision recovers the exact native source tree atf2d79145e040bbc28c6e0e355a19bc8923a70434; no native implementation/test bytes differ from the reviewed candidate.Remaining release validation
Real-model backend/MTP trajectory diagnostics, cache integrity, B2/B4 concurrency, quality and sustained/lifecycle checks retain their separate outcomes. Exact generated wording is diagnostic, not a universal release gate. The D256 precision pass does not relabel a failed full-model trajectory comparison as passing. This native PR is ready for review; remaining release-wide validation is tracked in parent PR ml-explore#851. Signing/package-distribution work is separate.
Companions: core PR #16 and Swift PR #21.
Evidence: candidate D256 precision report, published with the companion parent update.
Merged dependency pins
Current signed HEAD
85e3cfe67fbe721d86683bb2b8bd17f7ddffe2ddpins merged Swift37572f1f10a6c485ac4cc254cad63e8242643a6ffrom Swift PR #21. The merged Swift tree is exactlye79138e9e2dc6d705084c5d3cf365cebac3c8bd3, identical to tested Swift80981062b21ba8ccf4fff40f715dab495b38fb07, including its core/C gitlinks. This append changes only the Package.swift revision; reversing that replacement recovers the previous native tree exactly. No inference implementation or test bytes change, and model tests were not rerun for this pin-only append.