Skip to content

Bridge allocator snapshots, footprint policy and buffer ownership - #8

Merged
Gajesh2007 merged 1 commit into
mainfrom
release/0.9.0-validation
Sep 6, 2026
Merged

Gajesh2007 merged 1 commit into
mainfrom
release/0.9.0-validation

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

Swift admission code needs one coherent allocator snapshot and checked backing-size information, but the C boundary currently offers only separate counters and no detached footprint-policy value.

This change bridges the native snapshot and immutable sizing policy, adds checked bound helpers, and exposes metadata for an already evaluated array buffer. Unavailable backing stays explicitly unavailable; inspection does not evaluate an array or synchronize a stream. The generator override preserves the API when bindings are regenerated.

Before

flowchart LR
  Swift[Swift memory caller] --> Separate[Independent C counter calls]
  Array[Lazy MLX array] --> Missing[No checked backing metadata bridge]
  Separate --> Estimate[Caller combines observations]
  Missing --> Estimate
Loading

After

flowchart LR
  Swift[Swift memory caller] --> Snapshot[mlx_get_memory_snapshot]
  Swift --> Policy[mlx_get_allocation_footprint_policy]
  Policy --> Bound[Checked C bound / maximum-extra helpers]
  Array[Already evaluated array] --> Info[mlx_array_get_buffer_info]
  Info --> Availability[Explicit availability and backing metadata]
  Snapshot --> Result[Coherent native observation]
Loading

Reviewed source and signed publication

  • Reviewed source: d4328f2d8d54d711d5419e07ab9fa2f07b512a48.
  • Signed publication head: 8bdeb0f3c5793c54139e86c5437b09abc9ab9b42 on release/0.9.0-validation.
  • This existing signed head is retained because its source tree is already current; no empty commit was added.
  • Normalizing only the signed dependency pins recovers the exact reviewed source tree. Both parent Vercel suppressions remain branch-specific.

Validation and its scope

  • The C implementation is unchanged from the previous signed publication. The reviewed core companion now includes the quantized-bias correction; Swift pins both signed dependencies.
  • Earlier source-matched Apple M3 Max evidence compiled this C source with core 560f57cc and Swift 4b006d8, exercised the C snapshot/footprint/buffer bridge, and passed 83 unique functions / 100 expanded cases in the combined lane. Those results retain the old lower-tuple identity.
  • The corrected runtime artifact's source/resource/build-output review is separate from pending full-model gates. No new C ABI claim, full upstream-suite result or CUDA execution is inferred from that review.

Frozen Gemma controls and their limits

  • On the reviewed 53f3c3d0 / native de30ef98 / Swift c06149b4 / core fab0f39f runtime, cache-off B1 Gemma QAT4 is now exact across contiguous and paged backends in ordinary, automatic and serial-target modes. Serial-target also matches ordinary.
  • Automatic still differs from ordinary on both backends at zero-based index 30. The whole-verifier comparison therefore remains a failure/open gate. These seven complete trajectories reuse one fixture prompt; they are not seven independent quality prompts.
  • The later recurrent-teacher runtime is outside those frozen model controls. No new throughput, B2/B4, SSD-hit, pressure, fleet-model or 0.9.0 default-posture result is inferred from them.

Remaining gates — keep draft

  • Full-model, whole-verifier and 0.9.0 default/release gates remain open. In particular, Gemma automatic-versus-ordinary index 30 and the outstanding Qwen trajectory/state investigations are not waived by backend equality or operator proximity.
  • Complete the exact fleet-model/backend/cache/MTP matrix, capacity/co-residency and pressure coverage, uncontended B1/B2/B4 comparisons, connected/two-host recovery and persistent-key restart evidence on the final bound artifacts.
  • Complete full provider CI compilation and GPU regression for the public-API test fix, applicable platform review, and immutable signed-artifact checks. CUDA execution remains outside the macOS evidence. Historical failed checks are preserved; no new full-suite pass is claimed here.
  • Explicit release, deployment, signing-workflow activation/dispatch and benchmark approval remain separate. Both Vercel configs suppress only release/0.9.0-validation. No production budget, equality criterion or tolerance is relaxed.

Companion review stack

Draft PR Signed head Reviewed source
mlx #15 f8eec2476cdb5263fb6e2a19dd71f2c8b7c0a7d3 fab0f39f69140393b454c32d6f4bf7a9b32f9dcc
mlx-c #8 8bdeb0f3c5793c54139e86c5437b09abc9ab9b42 d4328f2d8d54d711d5419e07ab9fa2f07b512a48
mlx-swift #21 c3ac44766c3e0be2066bbd87a3e26aaa6f410ab0 9561227d55a07db29f70a78aadc5d6b5aaeb10bf
mlx-swift-lm #141 67ac8607b5846e8acfbbdd8f36c0d252d69d0d01 ba5c03ea0ef495aca02c99c7a2dd2b7a32bc7668
d-inference #851 e1d68db84cb1a1e4a6dd10306383bd64bc5d6062 d01b82078e157ae1e66511d2d8db1f2ecf95e857

Evidence navigation

Reports retain their original source, artifact and result identities. Current links are pinned to this signed parent publication.

Signed publication snapshot of reviewed source d4328f2d8d54d711d5419e07ab9fa2f07b512a48. Original milestone history remains preserved locally. Tree-identical to validated source.
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