mlx-bun 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +43 -13
  2. package/THIRD_PARTY_LICENSES.md +9 -0
  3. package/docs/design/colibri-glm52-port.md +1479 -0
  4. package/docs/design/pre-colibri-stabilization.md +329 -0
  5. package/docs/investigations/colibri-oracle-pin.md +1284 -0
  6. package/docs/investigations/indexshare-performance-spike.md +357 -0
  7. package/docs/planning/release-notes-v0.0.12.md +80 -0
  8. package/docs/reference/cli.md +28 -2
  9. package/docs/reference/distribution.md +25 -1
  10. package/docs/reference/embedding.md +5 -2
  11. package/docs/reference/features-matrix.md +4 -2
  12. package/docs/reference/library-api.md +41 -13
  13. package/docs/reference/models.md +49 -2
  14. package/docs/reference/server-api.md +90 -9
  15. package/docs/reference/server-config.md +21 -14
  16. package/docs/reference/training.md +10 -1
  17. package/package.json +1 -1
  18. package/src/anthropic.ts +54 -44
  19. package/src/chat-template.ts +155 -10
  20. package/src/cli.ts +127 -8
  21. package/src/config.ts +71 -26
  22. package/src/diffusion/diffusion-generate.ts +14 -8
  23. package/src/download.ts +103 -12
  24. package/src/eval/ifeval.ts +63 -120
  25. package/src/eval/runner.ts +14 -5
  26. package/src/eval/tasks/ifeval.ts +167 -31
  27. package/src/expert-io.ts +391 -0
  28. package/src/expert-residency.ts +1134 -0
  29. package/src/expert-usage.ts +415 -0
  30. package/src/generate.ts +114 -17
  31. package/src/hf-push.ts +1 -1
  32. package/src/index.ts +14 -2
  33. package/src/jobs/runner.ts +37 -18
  34. package/src/kv-store.ts +147 -8
  35. package/src/lora.ts +77 -14
  36. package/src/media-fetch.ts +198 -56
  37. package/src/mlx/array.ts +43 -0
  38. package/src/mlx/autograd.ts +51 -14
  39. package/src/mlx/checkpoint.ts +46 -13
  40. package/src/mlx/custom-vjp.ts +83 -35
  41. package/src/model/factory.ts +96 -5
  42. package/src/model/gemma4-base.ts +32 -0
  43. package/src/model/glm52-atlas.ts +511 -0
  44. package/src/model/glm52-cache.ts +706 -0
  45. package/src/model/glm52-config.ts +262 -0
  46. package/src/model/glm52-container.ts +305 -0
  47. package/src/model/glm52-coupling.ts +388 -0
  48. package/src/model/glm52-dsa.ts +602 -0
  49. package/src/model/glm52-expert-layout.ts +253 -0
  50. package/src/model/glm52-layout.ts +152 -0
  51. package/src/model/glm52-memory.ts +473 -0
  52. package/src/model/glm52-mla.ts +786 -0
  53. package/src/model/glm52-moe.ts +223 -0
  54. package/src/model/glm52-pilot.ts +537 -0
  55. package/src/model/glm52-reference.ts +445 -0
  56. package/src/model/glm52-residency.ts +557 -0
  57. package/src/model/glm52-resident-weights.ts +135 -0
  58. package/src/model/glm52-streamed-experts.ts +453 -0
  59. package/src/model/glm52-streamed-metal.ts +610 -0
  60. package/src/model/glm52-weights.ts +503 -0
  61. package/src/model/glm52.ts +1153 -0
  62. package/src/model/support.ts +8 -1
  63. package/src/native/expert_io.c +523 -0
  64. package/src/native-pack.ts +6 -4
  65. package/src/responses.ts +62 -49
  66. package/src/serve/batch-scheduler.ts +95 -16
  67. package/src/serve/generation-gateway.ts +41 -16
  68. package/src/server.ts +362 -81
  69. package/src/spec/glm52-mtp-source.ts +392 -0
  70. package/src/spec/serve-loop.ts +99 -18
  71. package/src/spec/source.ts +31 -6
  72. package/src/ssd-cache.ts +6 -2
  73. package/src/tool-call.ts +30 -2
  74. package/src/train/job.ts +0 -10
  75. package/src/train/lora-params.ts +17 -6
  76. package/src/train/trainer.ts +59 -26
  77. package/src/web/app.html +13 -2
  78. package/src/web/app.js +30 -3
  79. package/src/web/src/status.ts +51 -3
  80. package/src/web-tools.ts +54 -2
  81. package/src/weights.ts +82 -19
@@ -0,0 +1,1284 @@
1
+ # Colibri oracle pin for the native GLM-5.2 port
2
+
3
+ - Date recorded: 2026-07-21
4
+ - mlx-bun branch: `codex/colibri-glm52-port`
5
+ - Gate: Phase 21 G0, oracle inventory and model-free capture record
6
+
7
+ This note pins the external behavioral and performance oracle used by
8
+ [`colibri-glm52-port.md`](../design/colibri-glm52-port.md). It does not vendor,
9
+ embed, launch, or ship Colibri. The product remains a native Bun + MLX port.
10
+
11
+ ## Pinned checkout
12
+
13
+ - Repository: `JustVugg/colibri`
14
+ - Local read-only checkout: `/Users/joshrossi/Code/colibri`
15
+ - Commit: `44e489b196c9b7876b3d37a0570ebf1c6f90f54c`
16
+ - Commit date: `2026-07-21T19:04:16+02:00`
17
+ - Commit subject: `Merge #479: CUDA env integration tests (COLI_CUDA modes + expert budget auto-size)`
18
+ - Branch at inspection: `main`
19
+ - Worktree at inspection: clean, including untracked files
20
+ - Ignored build stamp at inspection: `c/.build-config` absent
21
+
22
+ The checkout is an executable oracle for formats, token/logit behavior,
23
+ routing, cache traces, MTP accept/reject behavior, and same-machine
24
+ performance. It is not a source dependency. Any result must carry this exact
25
+ commit; `main`, `latest`, or an unrecorded later commit is not equivalent.
26
+
27
+ ## License and attribution policy
28
+
29
+ The pinned repository contains the Apache License 2.0 in `LICENSE`. It contains
30
+ no tracked `NOTICE` or `COPYRIGHT` file.
31
+
32
+ The native port should reimplement the documented behavior and cite Colibri in
33
+ the design, user documentation, and third-party attribution. If code or other
34
+ copyrightable material is copied or closely derived, the distributed source
35
+ must also:
36
+
37
+ 1. include a copy of Apache-2.0;
38
+ 2. retain applicable copyright, patent, trademark, and attribution notices;
39
+ 3. mark modified copied files prominently; and
40
+ 4. reproduce any future upstream `NOTICE` content that applies to the copied
41
+ material.
42
+
43
+ The Apache license does not grant trademark rights beyond customary
44
+ description of origin. Product naming and artwork are not part of the port.
45
+
46
+ ## Public artifact and disk envelope
47
+
48
+ The pinned project recommends the public Hugging Face artifact
49
+ [`mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp`](https://huggingface.co/mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp).
50
+ It is the same-artifact oracle target for G0 and the initial native loader.
51
+
52
+ - Expected converted size: approximately 372 GB.
53
+ - G0 download-time floor: at least 400 GB actually free on fast local storage.
54
+ - Source conversion path: approximately 756 GB of network traffic, processed
55
+ one roughly 5 GB source shard at a time; the growing output plus one source
56
+ shard is retained, with a default 20 GB free-space stop margin.
57
+ - Previously measured disk preflight, not reverified by this item: about
58
+ 556 GB unallocated plus 123 GB purgeable, or about 679 GB practically
59
+ available on the internal SSD on 2026-07-21.
60
+ - The downloaded artifact is pinned locally at revision
61
+ `3cc8db99b1b13fc79325d987ba3c1c430766b3b8`. The complete metadata manifest
62
+ is recorded below. The initial audit deferred main-shard hashing to preserve
63
+ cold state; the G0 closure section records the later complete verification.
64
+
65
+ The public mirror without the corrected MTP head is not an equivalent
66
+ artifact. The pinned README identifies the correct int8 MTP shard byte sizes
67
+ as:
68
+
69
+ | Shard | Expected bytes |
70
+ |---|---:|
71
+ | first `out-mtp-*` shard | 3,527,131,672 |
72
+ | second `out-mtp-*` shard | 5,366,238,584 |
73
+ | third `out-mtp-*` shard | 1,065,950,496 |
74
+
75
+ These sizes are a preflight signal, not a sufficient integrity check. The
76
+ native loader must validate the complete tensor set, names, dtypes, dimensions,
77
+ and byte counts before allocation.
78
+
79
+ ### Post-download artifact audit (2026-07-22)
80
+
81
+ The artifact downloaded through `mlx-bun get` resolves to:
82
+
83
+ `/Users/joshrossi/.cache/huggingface/hub/models--mateogrgic--GLM-5.2-colibri-int4-with-int8-mtp/snapshots/3cc8db99b1b13fc79325d987ba3c1c430766b3b8`
84
+
85
+ - Local `refs/main` and the exact-revision HF API both report
86
+ `3cc8db99b1b13fc79325d987ba3c1c430766b3b8`.
87
+ - Remote and local inventories match exactly: 150 files and
88
+ `383,760,077,466` bytes (`357.404 GiB`), with no missing/extra files, broken
89
+ links, `.incomplete` files, or locks. The canonical
90
+ `name<TAB>size<TAB>blobId` manifest SHA-256 is
91
+ `d0a400b49ca018bdaf3b7d98686e5bd9ebad121f79580911fec4fe22196747e2`.
92
+ - The model has 141 consecutive main shards (`out-00000` through
93
+ `out-00140`) and three MTP shards. Header-only validation parsed all 144
94
+ safetensors, found no offset/size/JSON errors, and accounted for 118,478
95
+ tensors. The layer-78 MTP family contains 777 U8 payload tensors, 786 F32
96
+ scale/dense tensors, all 256 routed experts, and all required attention,
97
+ shared-expert, `eh_proj`, norm, and shared-head tensors.
98
+ - Direct SHA-256 verification passed for all corrected MTP shards:
99
+ `dc020ddbb87347f7e6711c9e8cd2715ac79a2a9f2b4599ff11b7980a35e3cf88`,
100
+ `172b49be499a1070505cd13718c47c82165c663d6422e537b1335aae28c331bf`,
101
+ and `534a1a2a05188dc372f1e0e4f6d72503cbe86fc9a94f085dc6a6a0941b45975d`.
102
+ `tokenizer.json` also matches its LFS SHA-256, and all five non-LFS metadata
103
+ files recompute to their advertised Git blob identities. This was the
104
+ pre-baseline audit; all 145 LFS payloads were subsequently verified for G0.
105
+ - **DSA is absent from this artifact.** There are zero `out-idx-*` files and
106
+ zero tensor names containing `indexer`, locally and in the remote revision,
107
+ even though `config.json` declares the DSA/IndexShare geometry. Pinned
108
+ Colibri checks for every full-layer `indexer.wq_b.weight` tensor and therefore
109
+ sets `has_dsa=0`. A baseline on this artifact cannot be called a DSA baseline.
110
+
111
+ The audit exposed a downloader integrity bug. The current HF `?blobs=true`
112
+ schema returns LFS digests as `lfs.sha256`; mlx-bun modeled the property as
113
+ `lfs.oid`. Consequently, the original 145 LFS transfers used Git `blobId`
114
+ filenames but did not compare their payloads to the advertised SHA-256. The
115
+ local fix normalizes `sha256` (with legacy `oid` compatibility), rejects an
116
+ invalid digest, uses the digest as the content-addressed blob name, and restores
117
+ streaming SHA-256 verification. The regression suite exercises the real field
118
+ name and the corrupt-payload refusal path. At this point the 141 main payloads
119
+ remained unverified because a deliberate full read would populate the
120
+ filesystem cache. They were hashed after the controlled runtime work; the
121
+ closure evidence below records the result.
122
+
123
+ ## Snapshot metadata contract
124
+
125
+ Runtime-required and behaviorally material files are:
126
+
127
+ | File | Contract |
128
+ |---|---|
129
+ | `config.json` | Required; supplies model geometry, routing, MLA, DSA, and stop metadata. |
130
+ | `tokenizer.json` | Required for chat/serve; byte-level BPE vocabulary, merges, added tokens, and `special` flags are material. |
131
+ | `tokenizer_config.json` | Preserved by the converter; chat-template/tokenizer policy input for the native port. |
132
+ | `generation_config.json` | Optional to the C loader but authoritative for additional EOS IDs; its EOS set is unioned with `config.json`. |
133
+ | `*.safetensors` | Runtime indexes every safetensors file in the snapshot, independent of filename prefix, up to 512 shards. |
134
+ | `model.safetensors.index.json` | Used by selective conversion/download tooling; not required by the C runtime's directory scan. |
135
+
136
+ The native GLM config must cover at least:
137
+
138
+ - `hidden_size`, `num_hidden_layers`, `num_attention_heads`,
139
+ `n_routed_experts`, `num_experts_per_tok`, `n_shared_experts`;
140
+ - `intermediate_size`, `moe_intermediate_size`,
141
+ `first_k_dense_replace`;
142
+ - `q_lora_rank`, `kv_lora_rank`, `qk_nope_head_dim`,
143
+ `qk_rope_head_dim`, `v_head_dim`;
144
+ - `n_group`, `topk_group`, `norm_topk_prob`,
145
+ `routed_scaling_factor`;
146
+ - `rms_norm_eps`, RoPE parameters, `vocab_size`, and every EOS ID; and
147
+ - `index_topk`, `index_n_heads`, `index_head_dim`, plus either explicit
148
+ `indexer_types` or the frequency/offset schedule.
149
+
150
+ GLM-5.2 requires `n_group=1` in the pinned engine. DSA is active only when the
151
+ indexer geometry is valid and every full-indexer layer has its required
152
+ weights. Missing DSA weights disable DSA; the native loader should report this
153
+ as a capability decision rather than silently implying full artifact parity.
154
+
155
+ ## Tensor and shard layout contract
156
+
157
+ The converter emits three logical shard families:
158
+
159
+ - `out-*`: main model, including resident tensors and main routed experts;
160
+ - `out-mtp-*`: MTP layer at index `num_hidden_layers`; and
161
+ - `out-idx-*`: DSA lightning-indexer tensors.
162
+
163
+ The runtime itself keys tensors by name and scans all safetensors files, so the
164
+ prefixes are provenance and tooling conventions rather than routing semantics.
165
+
166
+ Quantized 2-D tensors are stored as:
167
+
168
+ - `<name>`: `U8` packed int8, int4, or int2 bytes; and
169
+ - `<name>.qs`: `F32` scales.
170
+
171
+ Per-row and grouped int4 use the same packed low/high-nibble weight bytes.
172
+ Grouped format is inferred from the scale-array byte count; group sizes in the
173
+ pinned detector are 16, 32, 48, 64, 96, 128, 192, or 256. Norms, the router,
174
+ one-dimensional biases, and `e_score_correction_bias` remain F32. The native
175
+ loader must derive and validate logical `[output,input]` dimensions from the
176
+ config and tensor role instead of trusting a flattened U8 payload.
177
+
178
+ For each routed expert, `gate_proj`, `up_proj`, and `down_proj` plus their
179
+ scales form one expert load. The converted layout is optimized so the three
180
+ weight matrices can be coalesced into one positioned read and exposed as views
181
+ inside an aligned slab; scales occupy a companion F32 slab. A loader may accept
182
+ a non-coalescible fixture for correctness, but the full artifact path must
183
+ preserve and verify the coalesced layout before claiming I/O parity.
184
+
185
+ The resident model includes embeddings, LM head, norms, MLA projections, the
186
+ first dense MLP layers, shared experts, and routers. Main routed experts remain
187
+ disk-backed and enter bounded resident slots on demand.
188
+
189
+ ## Tokenizer and stop contract
190
+
191
+ The pinned tokenizer is byte-level BPE with `ignore_merges=true`, no byte
192
+ fallback, a cl100k-style regex split, and ByteLevel processing without an added
193
+ prefix space. `tokenizer.json` must provide `model.vocab` and `model.merges`.
194
+
195
+ All added tokens are atomic for encode/decode, but `special:true` has a separate
196
+ serving meaning: control tokens such as user/assistant/observation boundaries
197
+ must stop output, while real content markers such as thinking and tool-call
198
+ tokens may be `special:false` and must remain renderable. The native port must
199
+ union EOS IDs from config and generation config and apply the tokenizer's
200
+ control-token policy without swallowing content tokens.
201
+
202
+ ## MTP artifact contract
203
+
204
+ MTP is a separate sparse layer at `model.layers.<num_hidden_layers>`. It is
205
+ usable only as a complete set. The pinned runtime's sentinel check covers
206
+ `eh_proj`, `enorm`, `hnorm`, `shared_head.norm`, attention, norms, router,
207
+ shared-expert tensors, and routed-expert endpoints; model initialization then
208
+ loads the complete MTP attention/shared/routed-expert family.
209
+
210
+ The main conversion skips MTP. A separate `--mtp` pass emits `out-mtp-*` and
211
+ defaults its resident and expert tensors to int8. Per-row int4 is not an
212
+ acceptable substitute: upstream measured roughly 0-4% MTP acceptance because
213
+ `eh_proj`'s asymmetric column scales zero its embedding half. The pinned source
214
+ reports roughly 39-59% acceptance at int8. Group-scaled int4 is a separate
215
+ research option, not the public oracle contract.
216
+
217
+ The native loader must therefore report MTP as active only after verifying the
218
+ complete int8 MTP set. MTP absence, partial shards, int4 dense MTP tensors, or a
219
+ scheduler mode that disables drafting must be visible in capability and runtime
220
+ telemetry.
221
+
222
+ ## Safe model-free target inventory
223
+
224
+ No target in this section was executed while creating this note.
225
+
226
+ | Target | What it covers | Oracle-tree effect |
227
+ |---|---|---|
228
+ | `make -C c check` | Clean, portable CPU build, dependency-free C tests, Python stdlib tests. This is the upstream macOS CI gate. | Deletes/recreates ignored build outputs and writes a build stamp. |
229
+ | `make -C c metal-test` | Int8/int4/int2/F32 matmul, routed SwiGLU, large-batch GEMM, compressed MLA decode, cache writes, and an `S=4` MTP-shaped attention case. | Builds and executes `c/backend_metal_test`. |
230
+ | `python3 tools/convert_fp8_to_int4.py --selftest ...` | Model-free FP8 block-dequant check. | Intended to be output-free, but the pinned CLI needs a dummy `--repo` because it formats `None` before reaching the self-test return. |
231
+ | `python3 tools/convert_fp8_to_int4.py --selftest-nvfp4 ...` | Model-free NVFP4 decode/requant check. | Output-free when dependencies are present; same dummy-`--repo` issue. |
232
+
233
+ The checkout is a read-only oracle, but both Make targets mutate ignored files
234
+ and the Makefile creates `c/.build-config` during parsing. Do not run them in
235
+ place. G0 item 2 must extract the pinned commit to a temporary directory with
236
+ `git archive`, run both targets there, and capture output verbatim in this note.
237
+ That verifies the exact source without modifying the oracle checkout or its Git
238
+ metadata.
239
+
240
+ At inventory time, Apple clang 21, arm64 Xcode clang, GNU make, and Homebrew
241
+ libomp were present. System Python lacked Transformers, Torch, safetensors,
242
+ NumPy, and ml-dtypes. The mlx-lm oracle venv had Transformers 5.12,
243
+ safetensors, and NumPy, but lacked Torch and ml-dtypes.
244
+
245
+ ## Tiny-fixture feasibility
246
+
247
+ Available from the pinned source without full GLM-5.2 weights:
248
+
249
+ - `make_glm_oracle.py`: seed-1234 tiny GLM-MoE with real MLA/DSA geometry,
250
+ optional checkpoint-compatible FP8 emission, unfused per-expert tensors, and
251
+ a 32-position teacher-forcing reference;
252
+ - `make_glm_bench_model.py`: deterministic medium model with configurable
253
+ output directory and optional FP8 layout;
254
+ - local main and DSA conversion passes over those generated safetensors;
255
+ - deterministic synthetic expert layouts in the io_uring test;
256
+ - deterministic real-shape Metal matmul, routed-SwiGLU, and MLA fixtures; and
257
+ - `ROUTE_TRACE`, which emits per-position/per-layer expert IDs and gate weights
258
+ without changing model computation.
259
+
260
+ Limitations that must stay explicit:
261
+
262
+ 1. `make_glm_oracle.py` writes `glm_tiny/` and `ref_glm.json` into its current
263
+ working directory. Run it from temporary storage, never the oracle checkout.
264
+ 2. The generator requires Transformers >=5.11, Torch, and safetensors. The
265
+ inspected Python environments do not currently satisfy that set; provisioning
266
+ dependencies is a separate user-authorized decision. No package installation
267
+ was performed for this inventory.
268
+ 3. The generator does not produce `tokenizer.json`; token-ID teacher forcing is
269
+ feasible, but chat-template parity needs a separately provenance-pinned
270
+ tokenizer fixture.
271
+ 4. The pinned project has no model-free generator for a complete native MTP
272
+ layer. Its tiny generator covers GLM/MLA/DSA, not the layer-`n_layers` MTP
273
+ tensor family. G0 cannot honestly claim the requested MTP fixture by merely
274
+ exporting existing tooling. Add a deterministic derived fixture generator in
275
+ mlx-bun from this pinned tensor contract, or explicitly extend a temporary
276
+ copy of the generator; record that derivation in `fixtures/README.md`.
277
+ 5. The synthetic expert/io_uring fixture is Linux-only. On macOS, use its
278
+ recorded byte layout as provenance and validate the port through the Metal
279
+ fixture and mlx-bun's eventual synthetic expert-file generator.
280
+
281
+ ## Manual G0 baseline checklist
282
+
283
+ This user-directed machine-local run is complete. CI must never repeat the
284
+ full-model work or download the artifact. The 400 GB figure was a pre-download
285
+ capacity floor, not a requirement to retain 400 GB after the 357 GiB artifact
286
+ itself is present.
287
+
288
+ - [x] Record the stable post-download APFS capacity snapshot, including hard
289
+ free space, snapshots, date, and commands.
290
+ - [x] Download the public artifact and record its repository revision, complete
291
+ file manifest, link identities, and byte sizes.
292
+ - [x] Complete cryptographic payload verification for all 141 main shards.
293
+ - [x] Verify `config.json`, tokenizer metadata, generation metadata, main-shard
294
+ headers, and the three corrected int8 MTP shards.
295
+ - [x] Supply or explicitly waive complete DSA `out-idx-*` weights. The
296
+ recommended artifact contains none and therefore runs DSA-disabled.
297
+ - [x] Record machine model, chip, 32 GB memory, macOS/build versions, storage
298
+ device/filesystem, Colibri commit, Metal build flags, and binary hash.
299
+ - [x] Record the final runtime settings and validate the effective plan for
300
+ each baseline cell. Preserve the upstream macOS doctor/profiler
301
+ limitations rather than treating their zero-RAM probe as real hardware.
302
+ - [x] Establish a cleared/quiet machine before the sequence and record
303
+ pre/post memory pressure, compression, and swap for every cell. A
304
+ per-cell process-list snapshot was not captured and is explicitly not
305
+ claimed; unique engine PIDs and the bounded EOF-exit contract are pinned.
306
+ - [x] Run quality-preserving true top-8 defaults. Do not use expert top-p,
307
+ reduced top-k, `CACHE_ROUTE`, or `EXPERT_BUDGET` for the baseline.
308
+ - [x] Measure cold and warm runs with MTP disabled.
309
+ - [x] Measure cold and warm runs with MTP enabled; record draft proposals,
310
+ accepted/rejected tokens, acceptance length, tokens/forward, and whether
311
+ the fixed draft/verify kernel-family contract is active.
312
+ - [x] For every cell capture physical footprint, LRU/pin capacities,
313
+ pin/LRU/load-miss split, resident expert bytes, disk bytes and disk
314
+ service/wait time, TTFT, decode tokens/s, compression, and swap. Dense
315
+ bytes are a fixed verified container/plan constant (`10,877,286,144`),
316
+ not a per-cell runtime counter; the identical artifact/binary/settings
317
+ contract is enforced instead of claiming six absent dense-byte samples.
318
+ - [x] Preserve prompts, seeds, generated token IDs/text, raw logs, and command
319
+ lines. Report medians and run-to-run spread; do not quote loaded-machine
320
+ or one-off numbers.
321
+ - [x] Compare MTP-on and MTP-off wall time, not only tokens/forward.
322
+
323
+ This checklist is the G0 exit evidence. Completing this inventory, the
324
+ model-free targets, disk preflight, or fixtures alone does not satisfy G0.
325
+
326
+ ## Provenance commands
327
+
328
+ Read-only commands used for the pin inspection:
329
+
330
+ ```bash
331
+ git -C /Users/joshrossi/Code/colibri rev-parse HEAD
332
+ git -C /Users/joshrossi/Code/colibri branch --show-current
333
+ git -C /Users/joshrossi/Code/colibri status --porcelain=v1 --untracked-files=all
334
+ git -C /Users/joshrossi/Code/colibri log -1 --format='%H%n%ad%n%s' --date=iso-strict
335
+ git -C /Users/joshrossi/Code/colibri ls-files '*NOTICE*' '*COPYRIGHT*'
336
+ git -C /Users/joshrossi/Code/colibri diff --exit-code -- .
337
+ ```
338
+
339
+ Historical isolated execution pattern used for the now-complete model-free
340
+ suites:
341
+
342
+ ```bash
343
+ COLIBRI_PIN=44e489b196c9b7876b3d37a0570ebf1c6f90f54c
344
+ COLIBRI_TMP="$(mktemp -d)"
345
+ git -C /Users/joshrossi/Code/colibri archive "$COLIBRI_PIN" | tar -x -C "$COLIBRI_TMP"
346
+ make -C "$COLIBRI_TMP/c" check
347
+ make -C "$COLIBRI_TMP/c" metal-test
348
+ ```
349
+
350
+ The complete output was captured before removing the temporary directory, and
351
+ no generated binary was copied into either source checkout. The next section
352
+ records G0 item 2's pass/fail output and toolchain versions.
353
+
354
+
355
+ ## Isolated model-free suite execution (2026-07-22)
356
+
357
+ G0 item 2 ran only against an archive of the pinned oracle. Before extraction,
358
+ the oracle checkout was exactly at
359
+ `44e489b196c9b7876b3d37a0570ebf1c6f90f54c`, with empty porcelain output
360
+ and both worktree and index diff checks returning 0. A user-owned
361
+ `mlx-bun get mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp` download was
362
+ active; no user training, inference, benchmark, Colibri test, or other
363
+ Bun/Python MLX compute process was active. This workflow did not start,
364
+ interrupt, or modify the download.
365
+
366
+ The source was extracted with `git archive` into the validated temporary
367
+ directory
368
+ `/var/folders/t3/bdj253f52sv60p_9rmzm86tr0000gn/T/colibri-g0-pin.XXXXXX.phRD7CaPU1`. It contained no `.git` metadata. Extracted source hashes matched
369
+ the pinned objects:
370
+
371
+ ```text
372
+ c/Makefile b14f9deaf67adc6285facff41914b4bc64089316c83711ae7c7e7dbb731c814a
373
+ c/glm.c 3be1b4dd663667c8fa2cfbbacdada3e545ff5f924737a0f5d058708d7bc5ad9d
374
+ ```
375
+
376
+ Exact extraction and execution commands:
377
+
378
+ ```bash
379
+ COLIBRI_PIN=44e489b196c9b7876b3d37a0570ebf1c6f90f54c
380
+ COLIBRI_TMP='/var/folders/t3/bdj253f52sv60p_9rmzm86tr0000gn/T/colibri-g0-pin.XXXXXX.phRD7CaPU1'
381
+ git -C /Users/joshrossi/Code/colibri archive "$COLIBRI_PIN" | tar -x -C "$COLIBRI_TMP"
382
+ make -C "$COLIBRI_TMP/c" check > "$COLIBRI_TMP/make-check.log" 2>&1
383
+ make -C "$COLIBRI_TMP/c" metal-test > "$COLIBRI_TMP/make-metal-test.log" 2>&1
384
+ ```
385
+
386
+ Recorded toolchain and relevant environment:
387
+
388
+ ```text
389
+ date=2026-07-22T05:03:16Z
390
+ uname=Darwin Joshs-MacBook-Pro-2.local 25.5.0 Darwin Kernel Version 25.5.0: Tue Jun 9 22:18:58 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6000 arm64
391
+ macos_product=macOS 26.5.2 build 25F84
392
+ chip=Apple M1 Max
393
+ memory_bytes=34359738368
394
+ arch=arm64
395
+ xcode=Xcode 26.6;Build version 17F113
396
+ clang_path=/usr/bin/clang
397
+ clang_version=Apple clang version 21.0.0 (clang-2100.1.1.101)
398
+ clang_version=Target: arm64-apple-darwin25.5.0
399
+ clang_version=Thread model: posix
400
+ clang_version=InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
401
+ clangxx_path=/usr/bin/clang++
402
+ clangxx_version=Apple clang version 21.0.0 (clang-2100.1.1.101)
403
+ clangxx_version=Target: arm64-apple-darwin25.5.0
404
+ clangxx_version=Thread model: posix
405
+ clangxx_version=InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
406
+ make_path=/usr/bin/make
407
+ make_version=GNU Make 3.81
408
+ make_version=Copyright (C) 2006 Free Software Foundation, Inc.
409
+ make_version=This is free software; see the source for copying conditions.
410
+ make_version=There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
411
+ make_version=PARTICULAR PURPOSE.
412
+ make_version=
413
+ make_version=This program built for i386-apple-darwin11.3.0
414
+ python_path=/usr/bin/python3
415
+ python_version=Python 3.9.6
416
+ sdk_path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
417
+ relevant_environment:
418
+ oracle_pin=44e489b196c9b7876b3d37a0570ebf1c6f90f54c
419
+ oracle_pre_status=clean
420
+ workload_precheck=user mlx-bun get active; no bun/python training, inference, benchmark, or Metal test process
421
+ extraction=/var/folders/t3/bdj253f52sv60p_9rmzm86tr0000gn/T/colibri-g0-pin.XXXXXX.phRD7CaPU1
422
+ extracted_git_metadata=absent
423
+ makefile_sha256=b14f9deaf67adc6285facff41914b4bc64089316c83711ae7c7e7dbb731c814a
424
+ glm_c_sha256=3be1b4dd663667c8fa2cfbbacdada3e545ff5f924737a0f5d058708d7bc5ad9d
425
+ ```
426
+
427
+ ### `make check`
428
+
429
+ Complete combined stdout/stderr, verbatim:
430
+
431
+ ```text
432
+ /Applications/Xcode.app/Contents/Developer/usr/bin/make clean
433
+ python3 tools/clean.py
434
+ clean: removed 0 files/dirs
435
+ /Applications/Xcode.app/Contents/Developer/usr/bin/make portable
436
+ /Applications/Xcode.app/Contents/Developer/usr/bin/make glm ARCH=
437
+ make[2]: Circular glm <- glm dependency dropped.
438
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function glm.c -o glm -lm -L/opt/homebrew/opt/libomp/lib -lomp
439
+ /Applications/Xcode.app/Contents/Developer/usr/bin/make test
440
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_json.c -o tests/test_json -lm -L/opt/homebrew/opt/libomp/lib -lomp
441
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_st.c -o tests/test_st -lm -L/opt/homebrew/opt/libomp/lib -lomp
442
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function -DST_PREAD_CHUNK=7 tests/test_st_pread.c -o tests/test_st_pread -lm -L/opt/homebrew/opt/libomp/lib -lomp
443
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_tier.c -o tests/test_tier -lm -L/opt/homebrew/opt/libomp/lib -lomp
444
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_grammar.c -o tests/test_grammar -lm -L/opt/homebrew/opt/libomp/lib -lomp
445
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_schema_gbnf.c -o tests/test_schema_gbnf -lm -L/opt/homebrew/opt/libomp/lib -lomp
446
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_decode_batch.c -o tests/test_decode_batch -lm -L/opt/homebrew/opt/libomp/lib -lomp
447
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_idot.c -o tests/test_idot -lm -L/opt/homebrew/opt/libomp/lib -lomp
448
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_i4_grouped.c -o tests/test_i4_grouped -lm -L/opt/homebrew/opt/libomp/lib -lomp
449
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_stops.c -o tests/test_stops -lm -L/opt/homebrew/opt/libomp/lib -lomp
450
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_topp.c -o tests/test_topp -lm -L/opt/homebrew/opt/libomp/lib -lomp
451
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_sample_nan.c -o tests/test_sample_nan -lm -L/opt/homebrew/opt/libomp/lib -lomp
452
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_kv_alloc.c -o tests/test_kv_alloc -lm -L/opt/homebrew/opt/libomp/lib -lomp
453
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_i4_acc512.c -o tests/test_i4_acc512 -lm -L/opt/homebrew/opt/libomp/lib -lomp
454
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_compat_direct.c -o tests/test_compat_direct -lm -L/opt/homebrew/opt/libomp/lib -lomp
455
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_dsa_select.c -o tests/test_dsa_select -lm -L/opt/homebrew/opt/libomp/lib -lomp
456
+ clang -O3 -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include -Wall -Wextra -Wno-unused-parameter -Wno-misleading-indentation -Wno-unused-function tests/test_logit_nan.c -o tests/test_logit_nan -lm -L/opt/homebrew/opt/libomp/lib -lomp
457
+ python3 tools/run_tests.py tests/test_json tests/test_st tests/test_st_pread tests/test_tier tests/test_grammar tests/test_schema_gbnf tests/test_decode_batch tests/test_idot tests/test_i4_grouped tests/test_stops tests/test_topp tests/test_sample_nan tests/test_kv_alloc tests/test_i4_acc512 tests/test_compat_direct tests/test_dsa_select tests/test_logit_nan
458
+ json tests: ok
459
+ safetensors primitive tests: ok
460
+ test_st_pread: chunk loop + honest truncation error: ok
461
+ tier tests: ok
462
+ test_grammar: ok
463
+ test_schema_gbnf: OK
464
+ decode batch helper tests: ok
465
+ idot kernel exactness (neon): ok
466
+ idot driver exactness (neon): ok
467
+ test_i4_grouped: matmul_i4_grouped vs plain-C dequant reference
468
+ gs=64, I multiple of gs ok (S=2 I=512 O=8 gs=64 ng=8, worst rel 3.1e-08)
469
+ gs=64, single row single token ok (S=1 I=128 O=1 gs=64 ng=2, worst rel 9.6e-09)
470
+ gs=64, nibble edges (0x00/0xFF) ok (S=1 I=256 O=4 gs=64 ng=4, worst rel 2.6e-08)
471
+ gs=64, partial last group (I=200) ok (S=2 I=200 O=4 gs=64 ng=4, worst rel 2e-08)
472
+ gs=64, I just over a group (I=65) ok (S=1 I=65 O=3 gs=64 ng=2, worst rel 2e-08)
473
+ gs=64, I one under a group (I=63) ok (S=1 I=63 O=3 gs=64 ng=1, worst rel 2.4e-08)
474
+ gs=64, odd I (I=201) ok (S=2 I=201 O=4 gs=64 ng=4, worst rel 1.5e-08)
475
+ gs=16, odd I (I=33) ok (S=1 I=33 O=2 gs=16 ng=3, worst rel 2.2e-08)
476
+ gs=128 > I=64 (single group) ok (S=1 I=64 O=4 gs=128 ng=1, worst rel 4.5e-08)
477
+ gs=128, I multiple of gs ok (S=2 I=512 O=4 gs=128 ng=4, worst rel 3.7e-08)
478
+ gs=64, batch S=8 ok (S=8 I=320 O=6 gs=64 ng=5, worst rel 7.9e-08)
479
+ test_i4_grouped: ok
480
+ [stop] 5 stop tokens: 100 101 102 103 104 (4 from the tokenizer's special set)
481
+ [stop] 1 stop tokens: 100
482
+ test_stops: stop arming vs incomplete checkpoint metadata
483
+ tokenizer: special flag parsed, <think>/<tool_call> excluded ok
484
+ config eos=[100] + generation_config=[100,101,102] -> 3 stops ok
485
+ generation_config.json absent -> config alone, no crash ok
486
+ both configs mutilated -> tokenizer still stops all 5 control tokens ok
487
+ T=NULL -> config stops only (validation path untouched) ok
488
+ test_stops: ok
489
+ ok [V=1 nuc=0.001 shape=uniform keep=1 sum=1.0000000000]
490
+ ok [V=1 nuc=0.500 shape=uniform keep=1 sum=1.0000000000]
491
+ ok [V=1 nuc=0.900 shape=uniform keep=1 sum=1.0000000000]
492
+ ok [V=1 nuc=0.999 shape=uniform keep=1 sum=1.0000000000]
493
+ ok [V=1 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
494
+ ok [V=1 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
495
+ ok [V=1 nuc=0.900 shape=peaked keep=1 sum=1.0000000000]
496
+ ok [V=1 nuc=0.999 shape=peaked keep=1 sum=1.0000000000]
497
+ ok [V=1 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
498
+ ok [V=1 nuc=0.500 shape=geometric keep=1 sum=1.0000000000]
499
+ ok [V=1 nuc=0.900 shape=geometric keep=1 sum=1.0000000000]
500
+ ok [V=1 nuc=0.999 shape=geometric keep=1 sum=1.0000000000]
501
+ ok [V=1 nuc=0.001 shape=plateau keep=1 sum=1.0000000000]
502
+ ok [V=1 nuc=0.500 shape=plateau keep=1 sum=1.0000000000]
503
+ ok [V=1 nuc=0.900 shape=plateau keep=1 sum=1.0000000000]
504
+ ok [V=1 nuc=0.999 shape=plateau keep=1 sum=1.0000000000]
505
+ ok [V=1 nuc=0.001 shape=sharptail keep=1 sum=1.0000000000]
506
+ ok [V=1 nuc=0.500 shape=sharptail keep=1 sum=1.0000000000]
507
+ ok [V=1 nuc=0.900 shape=sharptail keep=1 sum=1.0000000000]
508
+ ok [V=1 nuc=0.999 shape=sharptail keep=1 sum=1.0000000000]
509
+ ok [V=2 nuc=0.001 shape=uniform keep=1 (ties) sum=1.0000000000]
510
+ ok [V=2 nuc=0.500 shape=uniform keep=1 (ties) sum=1.0000000000]
511
+ ok [V=2 nuc=0.900 shape=uniform keep=2 (ties) sum=1.0000000000]
512
+ ok [V=2 nuc=0.999 shape=uniform keep=2 (ties) sum=1.0000000000]
513
+ ok [V=2 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
514
+ ok [V=2 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
515
+ ok [V=2 nuc=0.900 shape=peaked keep=2 sum=0.9999999702]
516
+ ok [V=2 nuc=0.999 shape=peaked keep=2 sum=0.9999999702]
517
+ ok [V=2 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
518
+ ok [V=2 nuc=0.500 shape=geometric keep=1 sum=1.0000000000]
519
+ ok [V=2 nuc=0.900 shape=geometric keep=2 sum=1.0000000000]
520
+ ok [V=2 nuc=0.999 shape=geometric keep=2 sum=1.0000000000]
521
+ ok [V=2 nuc=0.001 shape=plateau keep=1 (ties) sum=1.0000000000]
522
+ ok [V=2 nuc=0.500 shape=plateau keep=1 (ties) sum=1.0000000000]
523
+ ok [V=2 nuc=0.900 shape=plateau keep=2 (ties) sum=1.0000000000]
524
+ ok [V=2 nuc=0.999 shape=plateau keep=2 (ties) sum=1.0000000000]
525
+ ok [V=2 nuc=0.001 shape=sharptail keep=1 sum=1.0000000000]
526
+ ok [V=2 nuc=0.500 shape=sharptail keep=1 sum=1.0000000000]
527
+ ok [V=2 nuc=0.900 shape=sharptail keep=2 sum=1.0000000000]
528
+ ok [V=2 nuc=0.999 shape=sharptail keep=2 sum=1.0000000000]
529
+ ok [V=8 nuc=0.001 shape=uniform keep=1 (ties) sum=1.0000000000]
530
+ ok [V=8 nuc=0.500 shape=uniform keep=4 (ties) sum=1.0000000000]
531
+ ok [V=8 nuc=0.900 shape=uniform keep=8 (ties) sum=1.0000000000]
532
+ ok [V=8 nuc=0.999 shape=uniform keep=8 (ties) sum=1.0000000000]
533
+ ok [V=8 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
534
+ ok [V=8 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
535
+ ok [V=8 nuc=0.900 shape=peaked keep=1 sum=1.0000000000]
536
+ ok [V=8 nuc=0.999 shape=peaked keep=5 sum=0.9999999900]
537
+ ok [V=8 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
538
+ ok [V=8 nuc=0.500 shape=geometric keep=4 sum=1.0000000447]
539
+ ok [V=8 nuc=0.900 shape=geometric keep=8 sum=1.0000000000]
540
+ ok [V=8 nuc=0.999 shape=geometric keep=8 sum=1.0000000000]
541
+ ok [V=8 nuc=0.001 shape=plateau keep=1 (ties) sum=1.0000000000]
542
+ ok [V=8 nuc=0.500 shape=plateau keep=4 (ties) sum=1.0000000000]
543
+ ok [V=8 nuc=0.900 shape=plateau keep=7 (ties) sum=1.0000000447]
544
+ ok [V=8 nuc=0.999 shape=plateau keep=8 (ties) sum=1.0000000075]
545
+ ok [V=8 nuc=0.001 shape=sharptail keep=1 sum=1.0000000000]
546
+ ok [V=8 nuc=0.500 shape=sharptail keep=3 sum=1.0000000149]
547
+ ok [V=8 nuc=0.900 shape=sharptail keep=7 sum=0.9999999776]
548
+ ok [V=8 nuc=0.999 shape=sharptail keep=8 sum=1.0000000075]
549
+ ok [V=64 nuc=0.001 shape=uniform keep=1 (ties) sum=1.0000000000]
550
+ ok [V=64 nuc=0.500 shape=uniform keep=32 (ties) sum=1.0000000000]
551
+ ok [V=64 nuc=0.900 shape=uniform keep=58 (ties) sum=0.9999999963]
552
+ ok [V=64 nuc=0.999 shape=uniform keep=64 (ties) sum=1.0000000000]
553
+ ok [V=64 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
554
+ ok [V=64 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
555
+ ok [V=64 nuc=0.900 shape=peaked keep=2 sum=1.0000000186]
556
+ ok [V=64 nuc=0.999 shape=peaked keep=39 sum=0.9999999860]
557
+ ok [V=64 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
558
+ ok [V=64 nuc=0.500 shape=geometric keep=32 sum=1.0000000149]
559
+ ok [V=64 nuc=0.900 shape=geometric keep=58 sum=0.9999999814]
560
+ ok [V=64 nuc=0.999 shape=geometric keep=64 sum=0.9999999879]
561
+ ok [V=64 nuc=0.001 shape=plateau keep=1 (ties) sum=1.0000000000]
562
+ ok [V=64 nuc=0.500 shape=plateau keep=5 (ties) sum=1.0000000149]
563
+ ok [V=64 nuc=0.900 shape=plateau keep=13 (ties) sum=0.9999999702]
564
+ ok [V=64 nuc=0.999 shape=plateau keep=35 (ties) sum=0.9999999879]
565
+ ok [V=64 nuc=0.001 shape=sharptail keep=1 (ties) sum=1.0000000000]
566
+ ok [V=64 nuc=0.500 shape=sharptail keep=4 (ties) sum=1.0000000596]
567
+ ok [V=64 nuc=0.900 shape=sharptail keep=10 (ties) sum=0.9999999925]
568
+ ok [V=64 nuc=0.999 shape=sharptail keep=12 (ties) sum=0.9999999925]
569
+ ok [V=257 nuc=0.001 shape=uniform keep=1 (ties) sum=1.0000000000]
570
+ ok [V=257 nuc=0.500 shape=uniform keep=129 (ties) sum=1.0000000563]
571
+ ok [V=257 nuc=0.900 shape=uniform keep=232 (ties) sum=0.9999999963]
572
+ ok [V=257 nuc=0.999 shape=uniform keep=257 (ties) sum=0.9999999998]
573
+ ok [V=257 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
574
+ ok [V=257 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
575
+ ok [V=257 nuc=0.900 shape=peaked keep=11 sum=0.9999999867]
576
+ ok [V=257 nuc=0.999 shape=peaked keep=203 sum=0.9999999721]
577
+ ok [V=257 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
578
+ ok [V=257 nuc=0.500 shape=geometric keep=117 sum=0.9999999702]
579
+ ok [V=257 nuc=0.900 shape=geometric keep=227 sum=0.9999999774]
580
+ ok [V=257 nuc=0.999 shape=geometric keep=257 sum=0.9999999749]
581
+ ok [V=257 nuc=0.001 shape=plateau keep=1 (ties) sum=1.0000000000]
582
+ ok [V=257 nuc=0.500 shape=plateau keep=5 (ties) sum=0.9999999404]
583
+ ok [V=257 nuc=0.900 shape=plateau keep=13 (ties) sum=0.9999999590]
584
+ ok [V=257 nuc=0.999 shape=plateau keep=35 (ties) sum=0.9999999854]
585
+ ok [V=257 nuc=0.001 shape=sharptail keep=1 (ties) sum=1.0000000000]
586
+ ok [V=257 nuc=0.500 shape=sharptail keep=5 (ties) sum=0.9999999553]
587
+ ok [V=257 nuc=0.900 shape=sharptail keep=10 (ties) sum=0.9999999851]
588
+ ok [V=257 nuc=0.999 shape=sharptail keep=12 (ties) sum=0.9999999925]
589
+ ok [V=1519 nuc=0.001 shape=uniform keep=2 (ties) sum=1.0000000000]
590
+ ok [V=1519 nuc=0.500 shape=uniform keep=760 (ties) sum=1.0000000428]
591
+ ok [V=1519 nuc=0.900 shape=uniform keep=1368 (ties) sum=1.0000000075]
592
+ ok [V=1519 nuc=0.999 shape=uniform keep=1518 (ties) sum=1.0000000106]
593
+ ok [V=1519 nuc=0.001 shape=peaked keep=1 sum=1.0000000000]
594
+ ok [V=1519 nuc=0.500 shape=peaked keep=1 sum=1.0000000000]
595
+ ok [V=1519 nuc=0.900 shape=peaked keep=404 sum=0.9999999575]
596
+ ok [V=1519 nuc=0.999 shape=peaked keep=1380 sum=1.0000000113]
597
+ ok [V=1519 nuc=0.001 shape=geometric keep=1 sum=1.0000000000]
598
+ ok [V=1519 nuc=0.500 shape=geometric keep=410 sum=1.0000000135]
599
+ ok [V=1519 nuc=0.900 shape=geometric keep=1118 sum=0.9999999862]
600
+ ok [V=1519 nuc=0.999 shape=geometric keep=1514 sum=1.0000000146]
601
+ ok [V=1519 nuc=0.001 shape=plateau keep=1 (ties) sum=1.0000000000]
602
+ ok [V=1519 nuc=0.500 shape=plateau keep=5 (ties) sum=0.9999999404]
603
+ ok [V=1519 nuc=0.900 shape=plateau keep=13 (ties) sum=0.9999999590]
604
+ ok [V=1519 nuc=0.999 shape=plateau keep=35 (ties) sum=0.9999999854]
605
+ ok [V=1519 nuc=0.001 shape=sharptail keep=1 (ties) sum=1.0000000000]
606
+ ok [V=1519 nuc=0.500 shape=sharptail keep=5 (ties) sum=1.0000000149]
607
+ ok [V=1519 nuc=0.900 shape=sharptail keep=10 (ties) sum=0.9999999702]
608
+ ok [V=1519 nuc=0.999 shape=sharptail keep=12 (ties) sum=1.0000000186]
609
+ ok [guard-off nuc=1.0 keep=256]
610
+ ok [guard-off nuc=0.0 keep=256]
611
+ ok [V=1 keep=1]
612
+
613
+ test_topp: 123 cases run, 0 failure(s)
614
+ test_topp: ok
615
+ [SAMPLE] warning: non-finite logits (NaN/Inf) — falling back to argmax; output may be degraded. This usually means a numerical blow-up upstream.
616
+ logit sani: distribuzione valida, picco vivo ok
617
+ NaN/+Inf iniettato: argmax dei finiti vince, mai 0/NaN ok
618
+ tutti non-finiti: nessun crash, buffer valido ok
619
+ test_sample_nan: ok
620
+ OK kv_alloc re-allocation
621
+ test_i4_acc512: skipped (no AVX-512 on this build)
622
+ compat direct tests: skipped (POSIX has native O_DIRECT)
623
+ ok [nk=1 keep=1 shape=random]
624
+ ok [nk=1 keep=1 shape=peaked]
625
+ ok [nk=1 keep=1 shape=decreasing]
626
+ ok [nk=1 keep=1 shape=increasing]
627
+ ok [nk=1 keep=1 shape=plateau]
628
+ ok [nk=1 keep=1 shape=all-equal]
629
+ ok [nk=2 keep=1 shape=random]
630
+ ok [nk=2 keep=1 shape=peaked]
631
+ ok [nk=2 keep=1 shape=decreasing]
632
+ ok [nk=2 keep=1 shape=increasing]
633
+ ok [nk=2 keep=1 shape=plateau]
634
+ ok [nk=2 keep=1 shape=all-equal]
635
+ ok [nk=8 keep=1 shape=random]
636
+ ok [nk=8 keep=8 shape=random]
637
+ ok [nk=8 keep=1 shape=peaked]
638
+ ok [nk=8 keep=8 shape=peaked]
639
+ ok [nk=8 keep=1 shape=decreasing]
640
+ ok [nk=8 keep=8 shape=decreasing]
641
+ ok [nk=8 keep=1 shape=increasing]
642
+ ok [nk=8 keep=8 shape=increasing]
643
+ ok [nk=8 keep=1 shape=plateau]
644
+ ok [nk=8 keep=8 shape=plateau]
645
+ ok [nk=8 keep=1 shape=all-equal]
646
+ ok [nk=8 keep=8 shape=all-equal]
647
+ ok [nk=64 keep=1 shape=random]
648
+ ok [nk=64 keep=8 shape=random]
649
+ ok [nk=64 keep=1 shape=peaked]
650
+ ok [nk=64 keep=8 shape=peaked]
651
+ ok [nk=64 keep=1 shape=decreasing]
652
+ ok [nk=64 keep=8 shape=decreasing]
653
+ ok [nk=64 keep=1 shape=increasing]
654
+ ok [nk=64 keep=8 shape=increasing]
655
+ ok [nk=64 keep=1 shape=plateau]
656
+ ok [nk=64 keep=8 shape=plateau]
657
+ ok [nk=64 keep=1 shape=all-equal]
658
+ ok [nk=64 keep=8 shape=all-equal]
659
+ ok [nk=2049 keep=1 shape=random]
660
+ ok [nk=2049 keep=8 shape=random]
661
+ ok [nk=2049 keep=256 shape=random]
662
+ ok [nk=2049 keep=1024 shape=random]
663
+ ok [nk=2049 keep=2048 shape=random]
664
+ ok [nk=2049 keep=1 shape=peaked]
665
+ ok [nk=2049 keep=8 shape=peaked]
666
+ ok [nk=2049 keep=256 shape=peaked]
667
+ ok [nk=2049 keep=1024 shape=peaked]
668
+ ok [nk=2049 keep=2048 shape=peaked]
669
+ ok [nk=2049 keep=1 shape=decreasing]
670
+ ok [nk=2049 keep=8 shape=decreasing]
671
+ ok [nk=2049 keep=256 shape=decreasing]
672
+ ok [nk=2049 keep=1024 shape=decreasing]
673
+ ok [nk=2049 keep=2048 shape=decreasing]
674
+ ok [nk=2049 keep=1 shape=increasing]
675
+ ok [nk=2049 keep=8 shape=increasing]
676
+ ok [nk=2049 keep=256 shape=increasing]
677
+ ok [nk=2049 keep=1024 shape=increasing]
678
+ ok [nk=2049 keep=2048 shape=increasing]
679
+ ok [nk=2049 keep=1 shape=plateau]
680
+ ok [nk=2049 keep=8 shape=plateau]
681
+ ok [nk=2049 keep=256 shape=plateau]
682
+ ok [nk=2049 keep=1024 shape=plateau]
683
+ ok [nk=2049 keep=2048 shape=plateau]
684
+ ok [nk=2049 keep=1 shape=all-equal]
685
+ ok [nk=2049 keep=8 shape=all-equal]
686
+ ok [nk=2049 keep=256 shape=all-equal]
687
+ ok [nk=2049 keep=1024 shape=all-equal]
688
+ ok [nk=2049 keep=2048 shape=all-equal]
689
+ ok [nk=4097 keep=1 shape=random]
690
+ ok [nk=4097 keep=8 shape=random]
691
+ ok [nk=4097 keep=256 shape=random]
692
+ ok [nk=4097 keep=1024 shape=random]
693
+ ok [nk=4097 keep=2048 shape=random]
694
+ ok [nk=4097 keep=1 shape=peaked]
695
+ ok [nk=4097 keep=8 shape=peaked]
696
+ ok [nk=4097 keep=256 shape=peaked]
697
+ ok [nk=4097 keep=1024 shape=peaked]
698
+ ok [nk=4097 keep=2048 shape=peaked]
699
+ ok [nk=4097 keep=1 shape=decreasing]
700
+ ok [nk=4097 keep=8 shape=decreasing]
701
+ ok [nk=4097 keep=256 shape=decreasing]
702
+ ok [nk=4097 keep=1024 shape=decreasing]
703
+ ok [nk=4097 keep=2048 shape=decreasing]
704
+ ok [nk=4097 keep=1 shape=increasing]
705
+ ok [nk=4097 keep=8 shape=increasing]
706
+ ok [nk=4097 keep=256 shape=increasing]
707
+ ok [nk=4097 keep=1024 shape=increasing]
708
+ ok [nk=4097 keep=2048 shape=increasing]
709
+ ok [nk=4097 keep=1 shape=plateau]
710
+ ok [nk=4097 keep=8 shape=plateau]
711
+ ok [nk=4097 keep=256 shape=plateau]
712
+ ok [nk=4097 keep=1024 shape=plateau]
713
+ ok [nk=4097 keep=2048 shape=plateau]
714
+ ok [nk=4097 keep=1 shape=all-equal]
715
+ ok [nk=4097 keep=8 shape=all-equal]
716
+ ok [nk=4097 keep=256 shape=all-equal]
717
+ ok [nk=4097 keep=1024 shape=all-equal]
718
+ ok [nk=4097 keep=2048 shape=all-equal]
719
+ ok [nk=8193 keep=1 shape=random]
720
+ ok [nk=8193 keep=8 shape=random]
721
+ ok [nk=8193 keep=256 shape=random]
722
+ ok [nk=8193 keep=1024 shape=random]
723
+ ok [nk=8193 keep=2048 shape=random]
724
+ ok [nk=8193 keep=1 shape=peaked]
725
+ ok [nk=8193 keep=8 shape=peaked]
726
+ ok [nk=8193 keep=256 shape=peaked]
727
+ ok [nk=8193 keep=1024 shape=peaked]
728
+ ok [nk=8193 keep=2048 shape=peaked]
729
+ ok [nk=8193 keep=1 shape=decreasing]
730
+ ok [nk=8193 keep=8 shape=decreasing]
731
+ ok [nk=8193 keep=256 shape=decreasing]
732
+ ok [nk=8193 keep=1024 shape=decreasing]
733
+ ok [nk=8193 keep=2048 shape=decreasing]
734
+ ok [nk=8193 keep=1 shape=increasing]
735
+ ok [nk=8193 keep=8 shape=increasing]
736
+ ok [nk=8193 keep=256 shape=increasing]
737
+ ok [nk=8193 keep=1024 shape=increasing]
738
+ ok [nk=8193 keep=2048 shape=increasing]
739
+ ok [nk=8193 keep=1 shape=plateau]
740
+ ok [nk=8193 keep=8 shape=plateau]
741
+ ok [nk=8193 keep=256 shape=plateau]
742
+ ok [nk=8193 keep=1024 shape=plateau]
743
+ ok [nk=8193 keep=2048 shape=plateau]
744
+ ok [nk=8193 keep=1 shape=all-equal]
745
+ ok [nk=8193 keep=8 shape=all-equal]
746
+ ok [nk=8193 keep=256 shape=all-equal]
747
+ ok [nk=8193 keep=1024 shape=all-equal]
748
+ ok [nk=8193 keep=2048 shape=all-equal]
749
+ ok [keep==nk nk=100]
750
+ ok [keep==1 argmax=19]
751
+ ok [all-equal keep=500 -> positions 0..499]
752
+
753
+ test_dsa_select: 129 cases run, 0 failure(s)
754
+ test_dsa_select: ok
755
+ [SAMPLE] warning: non-finite logits (NaN/Inf) — falling back to argmax; output may be degraded. This usually means a numerical blow-up upstream.
756
+ OK test_logit_nan: argmax_v NaN-skip + dist_build finite-collapse
757
+ python3 -m unittest discover -s tests -p 'test_*.py'
758
+ ......ss.sss........................[api] 127.0.0.1 - "OPTIONS /v1/chat/completions HTTP/1.1" 204 -
759
+ .[api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 200 -
760
+ .[api] 127.0.0.1 - "GET /health HTTP/1.1" 200 -
761
+ .[api] 127.0.0.1 - "POST /v1/completions HTTP/1.1" 200 -
762
+ .[api] 127.0.0.1 - "GET /v1/models HTTP/1.1" 200 -
763
+ [api] 127.0.0.1 - "GET /v1/models HTTP/1.1" 401 -
764
+ .[api] 127.0.0.1 - "GET /profile HTTP/1.1" 200 -
765
+ [api] 127.0.0.1 - "GET /profile HTTP/1.1" 200 -
766
+ .[api] 127.0.0.1 - "POST /v1/completions HTTP/1.1" 400 -
767
+ .[api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 400 -
768
+ .[api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 400 -
769
+ .[api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 200 -
770
+ ....[api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 429 -
771
+ [api] 127.0.0.1 - "POST /v1/chat/completions HTTP/1.1" 200 -
772
+ ......[api] 127.0.0.1 - "GET / HTTP/1.1" 200 -
773
+ [api] 127.0.0.1 - "GET /%2e%2e/dist-private/secret.txt HTTP/1.1" 404 -
774
+ .....[api] tool-calls: 1 total, 1 strict, 0 de-mangled [CLEAN]
775
+ .[api] tool-calls: 1 total, 1 strict, 0 de-mangled [CLEAN]
776
+ .[api] tool-calls: 1 total, 1 strict, 0 de-mangled [CLEAN]
777
+ .......................
778
+ ----------------------------------------------------------------------
779
+ Ran 84 tests in 5.427s
780
+
781
+ OK (skipped=5)
782
+ ```
783
+
784
+ Exit status: `0`.
785
+
786
+ ### `make metal-test`
787
+
788
+ A second workload check immediately before this command found the same
789
+ user-owned download and no user training, inference, benchmark, Colibri test,
790
+ or other Bun/Python MLX compute process.
791
+
792
+ Complete combined stdout/stderr, verbatim:
793
+
794
+ ```text
795
+ clang++ -x objective-c++ -std=gnu++17 -fobjc-arc -O3 tests/test_backend_metal.mm backend_metal.mm -framework Metal -framework Foundation -o backend_metal_test
796
+ ./backend_metal_test
797
+ Metal backend kernel tests:
798
+ int8 gate/up S=1 nerr=2.36e-06 ok
799
+ int4 gate/up S=1 nerr=1.98e-06 ok
800
+ int4 down S=1 nerr=1.03e-06 ok
801
+ int2 gate/up S=1 nerr=1.72e-06 ok
802
+ f32 S=1 nerr=1.77e-06 ok
803
+ int8 gate/up S=4 nerr=2.36e-06 ok
804
+ int4 gate/up S=7 (odd) nerr=1.98e-06 ok
805
+ int4 non-mult-4 dims nerr=3.78e-06 ok
806
+ Metal batched moe_block tests:
807
+ moe decode nb=8 R=8 nerr=2.53e-06 ok
808
+ moe ragged nb=6 R=16 nerr=2.45e-06 ok
809
+ Metal large-batch gemm test:
810
+ gemm S=64 int4 nerr=2.85e-06 ok
811
+ Metal fused attention tests:
812
+ attn S=1 pos=0 nerr=4.04e-06 cache=1.38e-05 ok
813
+ attn S=1 pos=37 nerr=4.19e-06 cache=1.24e-05 ok
814
+ attn S=4 pos=12 (MTP) nerr=5.33e-06 cache=1.34e-05 ok
815
+ attn S=3 pos=0 nerr=5.30e-06 cache=1.31e-05 ok
816
+ metal backend tests: ok
817
+ ```
818
+
819
+ Exit status: `0`.
820
+
821
+ ### Oracle postcondition
822
+
823
+ At `2026-07-22T05:06:07Z`, after both suites completed:
824
+
825
+ ```text
826
+ HEAD=44e489b196c9b7876b3d37a0570ebf1c6f90f54c
827
+ status --short: <empty>
828
+ git diff --quiet exit status: 0
829
+ git diff --cached --quiet exit status: 0
830
+ ```
831
+
832
+ No build, test, or mutating command was run from the oracle checkout, no
833
+ generated artifact was copied back, and no file in that checkout was changed.
834
+
835
+ ## Target-machine disk preflight — in-progress snapshot
836
+
837
+ This is a **moving snapshot, not the final stable G0 disk baseline**. A
838
+ user-owned artifact download was already active throughout the measurement:
839
+
840
+ ```text
841
+ 46623 Tue Jul 21 23:00:44 2026 08:37 bun /Users/joshrossi/.bun/bin/mlx-bun get mateogrgic/GLM-5.2-colibri-int4-with-int8-mtp
842
+ ```
843
+
844
+ The process was observed only. It was not stopped, signalled, reprioritized, or
845
+ otherwise altered. No snapshot was deleted and no space was purged. Capacity
846
+ therefore continued to change while these commands ran; repeat this preflight
847
+ after the download settles and before recording the full-model baseline.
848
+
849
+ ### Timestamp and target identity
850
+
851
+ Command:
852
+
853
+ ```sh
854
+ date '+%Y-%m-%dT%H:%M:%S%z (%Z)'
855
+ system_profiler SPHardwareDataType 2>/dev/null | awk '/Model Name:|Model Identifier:|Chip:|Total Number of Cores:|Memory:/{print}'
856
+ sw_vers
857
+ sysctl -n hw.memsize
858
+ readlink /etc/localtime
859
+ mount | awk '$3 == "/" {print}'
860
+ ```
861
+
862
+ Output:
863
+
864
+ ```text
865
+ 2026-07-21T23:09:50-0600 (CST)
866
+ Model Name: MacBook Pro
867
+ Model Identifier: MacBookPro18,2
868
+ Chip: Apple M1 Max
869
+ Total Number of Cores: 10 (8 Performance and 2 Efficiency)
870
+ Memory: 32 GB
871
+ ProductName: macOS
872
+ ProductVersion: 26.5.2
873
+ BuildVersion: 25F84
874
+ 34359738368
875
+ /var/db/timezone/zoneinfo/America/El_Salvador
876
+ /dev/disk3s3s1 on / (apfs, sealed, local, read-only, journaled)
877
+ ```
878
+
879
+ The qualifying machine is therefore the plan's M1 Max MacBook Pro with 32 GiB
880
+ physical memory, running macOS 26.5.2 in the America/El_Salvador timezone. The
881
+ root is the sealed APFS system snapshot; the writable artifact data resides in
882
+ the same APFS container through `/System/Volumes/Data`.
883
+
884
+ ### Filesystem capacity
885
+
886
+ Measurement window: `2026-07-21T23:09:20-0600` through
887
+ `2026-07-21T23:09:21-0600` (CST, America/El_Salvador).
888
+
889
+ Commands:
890
+
891
+ ```sh
892
+ df -h /
893
+ df -k /
894
+ df -h /System/Volumes/Data
895
+ df -k /System/Volumes/Data
896
+ ```
897
+
898
+ Output:
899
+
900
+ ```text
901
+ Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
902
+ /dev/disk3s3s1 926Gi 12Gi 506Gi 3% 459k 4.3G 0% /
903
+ Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
904
+ /dev/disk3s3s1 971350180 12270752 531096252 3% 458726 4293644559 0% /
905
+ Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
906
+ /dev/disk3s1 926Gi 398Gi 506Gi 45% 4.5M 5.3G 0% /System/Volumes/Data
907
+ Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
908
+ /dev/disk3s1 971350180 417631284 531096252 45% 4512220 5310962520 0% /System/Volumes/Data
909
+ ```
910
+
911
+ The System and Data volumes share the same 506 GiB available APFS-container
912
+ capacity; their different `Used` columns reflect volume roles and are not
913
+ additive.
914
+
915
+ Relevant `diskutil apfs list` command and filtered output:
916
+
917
+ ```sh
918
+ diskutil apfs list | awk '/Container disk3 /{show=1} show && /APFS Container Reference:|Size \\(Capacity Ceiling\\):|Capacity In Use By Volumes:|Capacity Not Allocated:|Physical Store Disk:|Mount Point:|Capacity Consumed:/{print}'
919
+ ```
920
+
921
+ ```text
922
+ APFS Container Reference: disk3
923
+ Size (Capacity Ceiling): 994662584320 B (994.7 GB)
924
+ Capacity In Use By Volumes: 450821074944 B (450.8 GB) (45.3% used)
925
+ Capacity Not Allocated: 543841509376 B (543.8 GB) (54.7% free)
926
+ | APFS Physical Store Disk: disk0s2
927
+ | Mount Point: /System/Volumes/Data
928
+ | Capacity Consumed: 427655487488 B (427.7 GB)
929
+ | Mount Point: Not Mounted
930
+ | Capacity Consumed: 12565250048 B (12.6 GB)
931
+ | Snapshot Mount Point: /
932
+ | Mount Point: /System/Volumes/Preboot
933
+ | Capacity Consumed: 9037856768 B (9.0 GB)
934
+ | Mount Point: Not Mounted
935
+ | Capacity Consumed: 1308078080 B (1.3 GB)
936
+ Mount Point: /System/Volumes/VM
937
+ Capacity Consumed: 20480 B (20.5 KB)
938
+ ```
939
+
940
+ Relevant writable-volume identity from `diskutil info
941
+ /System/Volumes/Data`:
942
+
943
+ ```text
944
+ Device Identifier: disk3s1
945
+ Volume Name: Macintosh HD - Data
946
+ Mount Point: /System/Volumes/Data
947
+ File System Personality: APFS
948
+ Container Total Space: 994.7 GB (994662584320 Bytes) (exactly 1942700360 512-Byte-Units)
949
+ Container Free Space: 543.8 GB (543841349632 Bytes) (exactly 1062190136 512-Byte-Units)
950
+ Device Location: Internal
951
+ Solid State: Yes
952
+ ```
953
+
954
+ ### Purgeable and snapshot evidence
955
+
956
+ Foundation's read-only APFS capacity keys were queried because `df` and
957
+ `diskutil apfs list` expose hard unallocated capacity but do not report one
958
+ stable scalar named “purgeable”:
959
+
960
+ ```sh
961
+ osascript -l JavaScript -e 'ObjC.import("Foundation"); const u=$.NSURL.fileURLWithPath("/"); function g(k){const v=Ref(); const e=Ref(); if(!u.getResourceValueForKeyError(v,k,e)) return "error"; return ObjC.unwrap(v[0]);} JSON.stringify({available:g($.NSURLVolumeAvailableCapacityKey),important:g($.NSURLVolumeAvailableCapacityForImportantUsageKey),opportunistic:g($.NSURLVolumeAvailableCapacityForOpportunisticUsageKey),total:g($.NSURLVolumeTotalCapacityKey)});'
962
+ ```
963
+
964
+ ```json
965
+ {"available":543824449536,"important":590191163121,"opportunistic":643859215665,"total":994662584320}
966
+ ```
967
+
968
+ `available` agrees with the hard `diskutil` value to normal sampling drift.
969
+ The `important` estimate was 46,366,713,585 bytes above hard available at this
970
+ instant, but these Foundation estimates are policy-dependent advisory reclaim
971
+ figures—not guaranteed immediately purgeable bytes—and moved while the download
972
+ was active. They are not needed to pass the hard-space threshold.
973
+
974
+ Read-only snapshot commands:
975
+
976
+ ```sh
977
+ diskutil apfs listSnapshots /
978
+ tmutil listlocalsnapshots /
979
+ ```
980
+
981
+ Output:
982
+
983
+ ```text
984
+ Snapshot for disk3s3s1 (1 found)
985
+ |
986
+ +-- BE13DEB1-389A-4346-A93F-502BBAF6176B
987
+ Name: com.apple.os.update-5B92CE4BA1034457A0921532291F4A4AD939CBE48D3A1381163A9AD3687D5694
988
+ XID: 5287272
989
+ Purgeable: No
990
+ NOTE: This snapshot limits the minimum size of APFS Container disk3
991
+ Snapshots for disk /:
992
+ ```
993
+
994
+ There were no Time Machine local snapshots listed. The sole root-volume OS
995
+ update snapshot is explicitly non-purgeable.
996
+
997
+ ### `>=400 GB` verdict
998
+
999
+ **PASS for this in-progress snapshot:** APFS reported
1000
+ `543,841,509,376` bytes (`543.8 GB`, approximately `506 GiB`) hard unallocated,
1001
+ which is `143.8 GB` above the plan's `>=400 GB` pre-download/pre-conversion
1002
+ threshold without counting advisory reclaimable capacity.
1003
+
1004
+ This is deliberately not treated as the final stable G0 baseline. The active
1005
+ approximately 372 GB artifact transfer can materially change the value. Re-run
1006
+ the same commands after that user-owned transfer completes and before any
1007
+ conversion or full-model oracle measurement.
1008
+
1009
+ ## Stable post-download machine and build preflight (2026-07-22)
1010
+
1011
+ The post-restart target was an Apple M1 Max with 10 cores and 32 GiB unified
1012
+ memory, running macOS 26.5.2 (`25F84`, Darwin 25.5.0). The model is on the
1013
+ internal APFS SSD (`Apple Fabric`). During the stable audit APFS reported about
1014
+ `174.1 GB` hard-free, with no local Time Machine snapshots. Before inference,
1015
+ `memory_pressure -Q` reported 93% free, swap and compressed pages were zero,
1016
+ and no Colibri, MLX, Bun, Python model, or Hugging Face transfer process was
1017
+ active. The 400 GB value above was the satisfied pre-download floor; it is not
1018
+ a post-download runtime requirement.
1019
+
1020
+ The oracle source checkout was returned to a clean, build-artifact-free
1021
+ `44e489b196c9b7876b3d37a0570ebf1c6f90f54c`. A `git archive` of that exact pin
1022
+ was built separately under ignored `runs/colibri-g0/` with:
1023
+
1024
+ ```bash
1025
+ make -C <exact-pin-archive>/c glm METAL=1
1026
+ make -C <exact-pin-archive>/c metal-test
1027
+ ```
1028
+
1029
+ Apple clang 21.0.0 built the engine with `-O3`, Homebrew OpenMP, and
1030
+ `-DCOLI_METAL`. Every standalone Metal int8/int4/int2 matmul, batched MoE,
1031
+ large GEMM, and fused-attention comparison passed. The tested engine SHA-256
1032
+ is `fa2b00cb7b8b5fbfb0c43908567c07fdd2bb9024ec47502697cb01885ca2b501`.
1033
+
1034
+ Colibri's Python doctor correctly analyzes 144 shards, 19,456 experts,
1035
+ `10,877,286,144` dense bytes, `372,848,459,776` expert bytes, and
1036
+ `18,915,328` bytes per typical expert. Its conservative 4K-context plan did
1037
+ not pass on the then-current reclaimable-memory snapshot: auto sizing produced
1038
+ zero cache slots and a forced 25 GB budget exceeded reported availability.
1039
+ Separately, the C profiler's `hw_probe` has no macOS branch and prints
1040
+ `unknown CPU | RAM 0.0 GB total, 0.0 GB available`; the engine's distinct
1041
+ `host_statistics64` safety path does have macOS support. This is an upstream
1042
+ telemetry bug, not evidence that unified memory was unavailable.
1043
+
1044
+ ## Bounded full-model proof run (2026-07-22)
1045
+
1046
+ At the user's explicit direction, the exact-pin Metal engine was run against
1047
+ the complete 357.404 GiB snapshot with a deliberately bounded configuration:
1048
+ 18 GB RAM budget, 128-token context, 19-token deterministic prompt, at most 8
1049
+ generated tokens, true top-8 expert routing, no cache-aware routing, expert
1050
+ budget, pilot, repin, or autopin. Both cells used `COLI_METAL=1`, `DIRECT=1`,
1051
+ `PIPE=1`, six loader workers, `TEMP=0`, `SEED=1`, `PROF=1`, and int4 main
1052
+ expert/dense interpretation. MTP-off set `MTP=0 DRAFT=0`; MTP-on set
1053
+ `MTP=1 DRAFT=3 SPEC_PIN=1`. DSA was off because the artifact has no indexer
1054
+ weights.
1055
+
1056
+ Both cells emitted the same six token IDs (`17 10 17 28 19 13`) and the same
1057
+ correct text: `2+2=4.`
1058
+
1059
+ | Metric | MTP off | MTP on |
1060
+ |---|---:|---:|
1061
+ | Engine load | 3.22 s | 2.44 s |
1062
+ | Prefill, 19 tokens | 20.94 s | 21.04 s |
1063
+ | Decode, 6 tokens | 17.61 s | 14.44 s |
1064
+ | Decode rate | 0.34 tok/s | 0.42 tok/s |
1065
+ | Process wall time | 42.62 s | 38.36 s |
1066
+ | Tokens/forward | 1.00 | 3.00 |
1067
+ | MTP accepted/proposed | 0/0 | 4/6 (67%) |
1068
+ | LRU hit rate | 4.8% | 1.5% |
1069
+ | Expert cache cap | 2/layer | 1/layer |
1070
+ | Expert payload fetched | 64.823 GB | 65.576 GB |
1071
+ | Read service / felt wait | 52.351 / 9.929 s | 56.293 / 9.696 s |
1072
+ | Maximum RSS (`time -l`) | 6.19 GB | 10.56 GB |
1073
+ | Peak footprint (`time -l`) | 14.98 GB | 16.29 GB |
1074
+ | Swap | 0 | 0 |
1075
+
1076
+ For this tiny proof, MTP-on improved reported decode rate by about 23.5%,
1077
+ reduced decode wall time by about 18.0%, and reduced whole-process wall time by
1078
+ about 10.0%. Those deltas are not benchmark claims: this is one sequential
1079
+ pair, only six generated tokens, the cells had different LRU capacities, and
1080
+ the MTP files had been read during integrity verification. It establishes the
1081
+ important facts that the real GLM-5.2 container loads on the 32 GB M1 Max,
1082
+ Metal unified-memory zero-copy executes with no CPU fallback, output is sane,
1083
+ the corrected MTP layer activates, SPEC_PIN activates, and neural drafts are
1084
+ accepted.
1085
+
1086
+ Raw machine-local evidence and SHA-256 values:
1087
+
1088
+ - `runs/colibri-g0/results-20260722/mtp-off.log`:
1089
+ `593a9274f70e7b2f80a5f90bc5d3edea948d77199897464c3ec3134b989f974b`
1090
+ - `runs/colibri-g0/results-20260722/mtp-on.log`:
1091
+ `58d9715d7d81ef94aeaf9a70e1fc1ca2442341c4dcd9c380000dc7bf4bc1bb85`
1092
+ - `mtp-off.stats`:
1093
+ `767abcfd2a21af8797509586b2f0e6ab990fb28ddefd40445ca42cf8d252933d`
1094
+ - `mtp-on.stats`:
1095
+ `c409ed39ecb97b6a9da999a121db372fc25db79f8eacffd4d5afcc589bbd59d1`
1096
+
1097
+ At the time of this bounded proof, G0 remained open pending the repeated
1098
+ matrix, complete main-shard hashes, DSA decision, exact TTFT instrumentation,
1099
+ acceptance-length distribution, and numeric oracle. The closure section below
1100
+ supersedes this historical state.
1101
+
1102
+ ## G0 item 4: model-free capture and derived scaffolding (2026-07-21)
1103
+
1104
+ An incomplete model-free starting package is checked in at
1105
+ [`../../fixtures/colibri-glm52/`](../../fixtures/colibri-glm52/README.md), with
1106
+ an explicit exact-pin capture orchestrator at
1107
+ [`../../scripts/capture-colibri-glm52-oracle.ts`](../../scripts/capture-colibri-glm52-oracle.ts),
1108
+ capture helpers at `scripts/colibri-glm52-capture.{py,c}`, the ordinary
1109
+ standalone generator at
1110
+ [`../../scripts/gen-colibri-glm52-fixtures.ts`](../../scripts/gen-colibri-glm52-fixtures.ts)
1111
+ and consuming model-free tests at
1112
+ [`../../tests/colibri-glm52-fixtures.test.ts`](../../tests/colibri-glm52-fixtures.test.ts).
1113
+ Git is the integrity root. The manifest records reproducibility hashes but does
1114
+ not present itself as an authenticity root.
1115
+
1116
+ The capture script first validates that the external checkout has exact HEAD,
1117
+ empty porcelain, and clean cached/worktree diffs, then executes only a temporary
1118
+ `git archive`. The recorded run used Apple M1 Max ARM64, Apple clang 21.0.0,
1119
+ CPython 3.14.5 with existing NumPy 2.4.6, and Bun 1.3.14. It imported the
1120
+ archived pinned `quant_int8`/`quant_int4_grouped`, and compiled a temporary
1121
+ harness that includes archived `glm.c`/`tier.h`. Direct captured constants are
1122
+ limited to Python quantization, ARM `matmul_q`/`matmul_i4_grouped`, DSA
1123
+ partial-select/tie scans, LFRU score/admission/tie/wrap/decay, and elementary
1124
+ RMSNorm/sigmoid outputs. Exact tree/blob hashes, source SHA-256 values, helper
1125
+ hashes, toolchain, target, and executed commands live in
1126
+ `oracle-capture.json`. No install, download, server, model load, or external
1127
+ checkout mutation occurred.
1128
+
1129
+ The tiny SwiGLU/residual spine, top-8 router composition, LRU trace, and greedy
1130
+ MTP state trace are explicitly `derived_canonical`, not captured Colibri
1131
+ runtime outputs. The MTP scaffold covers partial accept, immediate reject,
1132
+ full accept, accepted-only absorption, next-logit/`hlast` row choice, and
1133
+ logical main-KV rollback. EOS/special-stop handling, length clamps, adaptive
1134
+ guard, grammar precedence, sampling rejection, teacher-forced logits, numeric
1135
+ GLM/MLA/MTP-head/KV values, and neural acceptance remain gaps.
1136
+
1137
+ Residual blocker: item 4 and G0 remain incomplete until a real numeric model
1138
+ oracle is recorded and the required cleared-M1-Max-32-GB same-machine baseline
1139
+ is run. The earlier approximately 679 GB preflight remains the recorded stable
1140
+ capacity note; the later moving download snapshot does not replace it, and a
1141
+ stable refresh after the user-owned transfer settles remains pending.
1142
+
1143
+ ## G0 closure: full oracle and same-machine baseline (2026-07-22)
1144
+
1145
+ This section supersedes the two historical "G0 remains open" statements above.
1146
+ The target machine was restarted and had no competing model/download process,
1147
+ but the initial proof and three MTP-file hashes occurred before the controlled
1148
+ cells. The reproducible classification is therefore:
1149
+
1150
+ - **process-cold/direct-I/O:** a new `glm` process, empty explicit LRU,
1151
+ `DIRECT=1` (macOS `F_NOCACHE`), no pin/autopin/repin/pilot/cache-aware route;
1152
+ - **session-LRU-warm:** request two in the same PID after `RESET` clears KV and
1153
+ leaves the explicit expert LRU resident;
1154
+ - **not boot-cold:** no claim that the filesystem had been untouched since
1155
+ boot. Direct/no-cache expert reads make literal boot cache state irrelevant
1156
+ to the streamed expert payload.
1157
+
1158
+ All controlled cells used the same 32-token prompt, `NGEN=64`, `TEMP=0`,
1159
+ `SEED=1`, `RAM_GB=18`, `CTX=128`, cap 1/layer, Metal unified-memory zero-copy,
1160
+ six direct-I/O workers, true top-8, and int4 main weights. MTP-on changed
1161
+ `MTP/DRAFT` from `0/0` to `1/3`; `SPEC_PIN=1` was pinned in both modes and is
1162
+ operative only with MTP. DSA stayed off.
1163
+
1164
+ ### Earlier standalone decode-separated corroboration
1165
+
1166
+ This three-repeat harness was the first controlled process-cold result. It is
1167
+ retained because it separates prefill from decode, but the final G0 closure
1168
+ aggregate is the stricter six-process/twelve-turn matrix in the next section.
1169
+
1170
+ | Metric (three repeats; median, range where useful) | MTP off | MTP on |
1171
+ |---|---:|---:|
1172
+ | Prefill | 30.42 s | 31.56 s |
1173
+ | Decode, 64 tokens | 164.08 s (158.40-166.56) | 207.83 s (194.21-210.40) |
1174
+ | Decode rate | 0.39 tok/s (0.38-0.40) | 0.31 tok/s (0.30-0.33) |
1175
+ | Whole-process wall | 197.57 s | 243.70 s |
1176
+ | Main forwards / tokens per forward | 63 / 1.02 | 30 / 2.13 |
1177
+ | MTP accepted / proposed | 0/0 | 34/90 every repeat |
1178
+ | LRU hit rate | 2.3% | 1.3% |
1179
+ | Expert payload fetched | 698.902 GB | 983.671 GB |
1180
+ | Peak footprint | 13.60 GB | 16.98 GB |
1181
+ | Process swaps | 0 | 0 |
1182
+
1183
+ MTP cut main forwards by about 52%, but increased expert payload by 40.7%; at
1184
+ this one-slot budget the extra draft/absorb/verify I/O made median decode 26.7%
1185
+ slower (displayed throughput 20.5% lower). Compressor occupancy fell by
1186
+ 27-39 MB in the two complete MTP-off sidecar pairs and rose by only 46-185 MB
1187
+ in MTP-on cells. System swap was 0 before/after five complete cells; MTP-on
1188
+ repeat 3 ended at 0.75 MB with 48 system swapouts. Every process-level
1189
+ `time -l` counter remained zero, and there was no compression or swap spiral.
1190
+
1191
+ ### Authoritative repeated cold/warm matrix and exact TTFT
1192
+
1193
+ The bounded harness speaks the length-prefixed serve protocol, sends one
1194
+ request, consumes END/STAT, sends RESET, repeats the exact prompt, then closes
1195
+ stdin. EOF exits the sole process; it is not a persistent server. Client TTFT
1196
+ is prompt-frame flush to first response byte; engine TTFT is BEGIN to the first
1197
+ token callback. They agree within 1.2 ms, far inside the enforced 50 ms bound.
1198
+ The final matrix is three independent processes per mode, two turns each:
1199
+
1200
+ | Metric (median; range when variable) | MTP off, fresh-process turn | MTP off, LRU-warm turn | MTP on, fresh-process turn | MTP on, LRU-warm turn |
1201
+ |---|---:|---:|---:|---:|
1202
+ | Client TTFT | 29.332 s (29.154-29.730) | 28.431 s (28.058-28.498) | 31.132 s (31.095-31.234) | 31.895 s (31.640-31.936) |
1203
+ | Request elapsed | 190.848 s (186.445-196.556) | 189.761 s (181.318-190.210) | 246.331 s (245.942-247.490) | 241.362 s (225.342-245.478) |
1204
+ | STAT throughput | 0.34 tok/s (0.33-0.34) | 0.34 tok/s (0.34-0.35) | 0.26 tok/s | 0.27 tok/s (0.26-0.28) |
1205
+ | Hit rate | 1.9% | 2.0% | 1.1% | 1.1% |
1206
+ | Expert payload | 836.909 GB | 836.360 GB | 1126.703 GB | 1153.883 GB |
1207
+ | Main forwards / tok-forward | 63 / 1.02 | 63 / 1.02 | 30 / 2.13 | 31 / 2.06 |
1208
+ | MTP accepted / verified / raw | 0 / 0 / 0 | 0 / 0 / 0 | 34 / 87 / 90 | 33 / 90 / 93 |
1209
+
1210
+ Median whole-process peak footprint was 13.631 GB MTP-off (range
1211
+ 13.627-13.631) and 17.475 GB MTP-on (17.474-17.477). Every one of the six
1212
+ processes reported zero swaps. The same pre-existing 0.75 MB of system swap was
1213
+ present before and after every cell; none of the runs added to it.
1214
+
1215
+ All twelve turns returned the exact same 64 token IDs and response SHA-256
1216
+ `494cf30efb6d4d592b5acfc4c8cc310756218bd14dddf3ea4342c9c521e89290`.
1217
+ MTP fresh-process acceptance lengths were `{0:11,1:9,2:5,3:5}` and warm were
1218
+ `{0:11,1:10,2:7,3:3}`. MTP reduced target forwards by about 52%, but its fresh
1219
+ turn took 29.1% longer and fetched 34.6% more expert payload than MTP-off; its
1220
+ warm turn took 27.2% longer and fetched 38.0% more. Preserving a one-slot LRU
1221
+ therefore does not fix the serialized expert-I/O tax, and MTP must be redesigned
1222
+ around overlap/residency before it can produce a net speedup in the port.
1223
+
1224
+ The aggregate also pins the cache/I/O mechanism. Fresh MTP-off had median
1225
+ 667.4 s cumulative read-service work, 117.5 s felt wait, 851 LRU hits, and
1226
+ 44,245 load misses; fresh MTP-on rose to 969.5 s service, 159.1 s felt wait,
1227
+ 664 hits, and 58,459 misses. Warm turns retained 75 experts (off) or 76 (on),
1228
+ 1.4 GB total, with no pinned experts. These worker-cumulative service times
1229
+ can exceed request wall time because six loader workers overlap.
1230
+
1231
+ An operator `mactop` snapshot during the MTP-on run independently showed the
1232
+ same bottleneck shape: about 4.9 GB/s disk reads and 0 B/s writes, only 24% GPU
1233
+ usage, 16.1 GB/s unified-memory bandwidth, 19.91/32 GB memory, and no swap.
1234
+ This is qualitative live telemetry rather than a matrix counter, but it strongly
1235
+ corroborates that current Colibri is feed/I/O limited on this M1 Max—not yet
1236
+ limited by GPU throughput, unified-memory bandwidth, or memory capacity.
1237
+
1238
+ The deterministic aggregate is
1239
+ `runs/colibri-g0/results-20260722/warm-final-v4-matrix.json` (SHA-256
1240
+ `ca706bb22afd18554c7a80654c15b32c1578aeb06fbe847e9c8434bb6c8915af`);
1241
+ its rendered Markdown has SHA-256
1242
+ `fc8cc07613a9a5b97c120f7a2e4ddbf6111bbd99444a0ccae81e63e9d1caff90`.
1243
+ The JSON byte-counts and hashes every manifest, result, prompt, response,
1244
+ stdout, stderr, stats file, and pre/post system sidecar used by the matrix.
1245
+
1246
+ ### Real-model numeric oracle
1247
+
1248
+ A measurement-only patch was applied only to the ignored exact-pin archive,
1249
+ never to `/Users/joshrossi/Code/colibri`. Its SHA-256 is
1250
+ `d9dfffe52c27d54cef0d89eee6a3cd865aed2bacf02e9d856cf31374903ac394`;
1251
+ the instrumented Metal binary is
1252
+ `3869b10708791d0c93b019f557d8917fa328b93047e977e132da6e316dcba84a`.
1253
+ Two runs emitted 140 records / about 54 MB covering sentinel GLM stages, MLA
1254
+ Q/compressed KV, sigmoid router scores and final top-8, main hidden/logits,
1255
+ MTP absorb/fusion/layer/head/logits, and the teacher token-16 decode. The two
1256
+ directories compare byte-for-byte. Main and MTP both choose token 16; their
1257
+ top1-top2 margins are 2.994461 and 3.650726. The tracked 163 KiB compact
1258
+ reduction is `fixtures/colibri-glm52/real-model-oracle.json`.
1259
+
1260
+ ### Artifact integrity and DSA decision
1261
+
1262
+ Every one of 145 LFS payloads (383,760,044,154 bytes) matches the SHA-256 from
1263
+ exact revision `3cc8db99b1b13fc79325d987ba3c1c430766b3b8`; the evidence JSON
1264
+ SHA-256 is `518b03120daac07a42079edb29eb246ba636029a8b49091785d21519cc9ea939`.
1265
+ That schema-v2 evidence also records and validates the prior schema-v1 digest
1266
+ `c532e16f20f0fc4ba9d8e726215fd162c6fbb718d43388a06322304f4e006272`,
1267
+ so the metadata upgrade has an auditable chain rather than replacing the first
1268
+ full payload-hash result.
1269
+ Together with five non-LFS metadata files, all 150 artifact files are now
1270
+ accounted for.
1271
+
1272
+ The public artifact contains no `out-idx-*` files or `indexer.*` tensors. A
1273
+ search found no stock-identical public overlay; the only structurally suitable
1274
+ published indexers derive from a different uncensored/fine-tuned model and are
1275
+ not valid exact-oracle evidence. Exact stock generation would selectively read
1276
+ 20 source shards (99.90 GiB) from `zai-org/GLM-5.2-FP8` and needs a separate
1277
+ Torch environment. G0 therefore explicitly waives full-model DSA for this
1278
+ public-artifact baseline. The exact-pin model-free DSA fixture remains valid;
1279
+ a stock-generated overlay is deferred and must never mutate the HF snapshot.
1280
+
1281
+ **G0 exit: met.** G1 may start. Raw ignored evidence is under
1282
+ `runs/colibri-g0/results-20260722/`; reproducible parsers/harnesses are
1283
+ `scripts/colibri-g0-{report,warm,oracle-report,matrix-report}.ts` and the
1284
+ artifact checker is `scripts/verify-colibri-g0-artifact.ts`.