build: the native macOS build stamps through scripts/env.sh (ADR 0032); close ADR 0037's open items - #328
Merged
Conversation
… amendment); close ADR 0037's open items The v0.34.1 fold shipped one commit under two identities. The fold merge landed 8a7ba94 at 11:56:44 on 2026-09-18, the Metal binary was built from it at 12:00:24, and v0.34.1-dynres was cut on it at 12:49:45. The CUDA image, stamped by scripts/env.sh, reports 0.34.1-dynres-0-g8a7ba94; the Metal binary reports 0.34.0-maxusai-8a7ba949, because build-macos.sh never adopted ADR 0032 — it stamped <base>-maxusai-<sha> with <base> taken from the newest release tag at BUILD time, which for those 49 minutes was still v0.34.0-dynres. build-macos.sh now sources scripts/env.sh in a subshell and takes only VERSION (env.sh's release GOFLAGS would change what it builds). STAMP_ONLY=1 prints the stamp and builds nothing; inert when unset (SPEC H4). mlx-metal-0-34-0 admits both stamps of the deployed build and interim builds on the 0.34.1 lineage, and refuses 0.34.0-dynres-* — a fold build made before its tag — along with point tags and -dirty. The mistake now stops at preflight. release_matrix.py --version is repeatable, so a release whose surfaces carry equivalent stamps names each; one prefix still drops a foreign build's run. ADR 0032 records 0.34.0-maxusai-8a7ba949 = 0.34.1-dynres-0-g8a7ba94 as one build, and does not rebuild the deployed binary to restamp it, following its own 0.33.0 precedent. ADR 0037's consequences are closed: the stamp is resolved by that amendment; OLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0 is now in the Metal launchd environment (re-bootstrapped 17:44:40, verified in the running process's env); the nvfp4 global-scale question and #287 are parked. Tests (test_verdicts.py), written first and watched fail for the right reasons: TestMetalStampFollowsADR0032 admits/refuses, resolves through preflight.resolve_profile, and build-macos.sh == env.sh TestReleaseMatrixEquivalentStamps repeatable --version, in-process and CLI The stamp test runs build-macos.sh with PATH cut to /usr/bin:/bin — git, no cmake, no go — so it CANNOT start a real build even if STAMP_ONLY regresses. Its first draft could, and did: run red before STAMP_ONLY existed, it launched cmake and an MLX compile (inside the worktree, stopped at once). A test whose red state builds the product is a hazard; this one's red state now exits 127. preflight 114/114 (module and script mode, the new classes collected in both); vision-suite client 38, quant_dims 8, rescore 24, summarizers 134. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…lds only git/sed/dirname CI's "Verify the tests pass on a tree carrying preflight/ alone" step copies preflight/ to a temp tree and runs the suite there, to prove the gate ships self-contained. test_build_macos_stamps_exactly_what_env_sh_stamps reaches outside it for build-macos.sh and scripts/env.sh, so it failed there with "cannot open ... build-macos.sh". It now skips when either is absent, the same way the suite's other out-of-tree tests do. The class's other three tests need only expectations.toml and preflight.py and still run. Fixing it showed the "cannot start a real build" claim leaned on /usr/bin:/bin holding no cmake — true on this Mac, not something to rely on for a Linux runner. PATH is now a temp dir holding only git, sed and dirname, everything the script touches before STAMP_ONLY exits, invoked through /bin/sh. Checked by running the script WITHOUT STAMP_ONLY under that PATH: rc=127 at the first build tool, no build/ created. Local, both CI modes: full tree 114 OK (skipped=6, the stamp test runs); simulated preflight/-alone tree 114 OK (skipped=10, the stamp test skipped with its reason). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
glennneuber
pushed a commit
that referenced
this pull request
Sep 19, 2026
…line #328 amended the Apple Silicon sentence — the stamp equivalence under ADR 0032, and the launchd environment does set OLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0 after all. That correction is kept verbatim; this branch contributes only the CUDA line, which moves to the ADR 0036 rebuild stamp. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
glennneuber
added a commit
that referenced
this pull request
Sep 19, 2026
Closes the ADR 0036 record: the deployed stamp on the CUDA host, the production verification, and the retirement-register row. Main merged in twice to keep both deployment lines after #324 and #328 edited the same block. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Resolves the two open consequences ADR 0037 recorded, and the ADR 0032 non-conformance behind one of them.
What went wrong
The v0.34.1 fold shipped one commit under two identities:
8a7ba949v0.34.1-dynrescut on itThe CUDA image, stamped by
scripts/env.sh, reports0.34.1-dynres-0-g8a7ba94. The Metal binary reports0.34.0-maxusai-8a7ba949—build-macos.shnever adopted ADR 0032. It stamped its own<base>-maxusai-<sha>, taking<base>from the newest release tag at build time, stillv0.34.0-dynresfor those 49 minutes. So the release matrix couldn't render both surfaces from one--version, and nothing refused a fold build made before its tag.Fix
build-macos.shstamps throughscripts/env.sh, sourced in a subshell so onlyVERSIONcrosses over (env.sh's releaseGOFLAGSwould change the build).STAMP_ONLY=1prints the stamp and builds nothing; inert when unset (H4).mlx-metal-0-34-0admits both stamps of the deployed build plus interim builds on the 0.34.1 lineage, and refuses0.34.0-dynres-*— a fold build made before its tag — along with point tags and-dirty. The original mistake now stops at preflight.release_matrix.py --versionis repeatable. One prefix still drops a foreign build's run.0.34.0-maxusai-8a7ba949≡0.34.1-dynres-0-g8a7ba94as one build. No rebuild to restamp, per the ADR's own 0.33.0 precedent.OLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0→ now in the Metal launchd env (verified in the running process's environment); global scale + mlx: opt-in dense GEMM for nvfp4 prefill (dequantise to bf16 above a row threshold) #287 → parked.spec/apple-silicon-build.md, which told readers to hand-assemble the stamp.Tests — written first, watched fail for the right reasons
TestMetalStampFollowsADR0032— admits/refuses the right stamps, resolves throughpreflight.resolve_profile(not just the regex), andbuild-macos.sh==env.sh.TestReleaseMatrixEquivalentStamps— repeatable--version, in-process and via the CLI.One thing worth knowing about the stamp test. Its first draft ran
build-macos.shfor real, and in the red state — beforeSTAMP_ONLYexisted — that launched cmake and an MLX compile (inside a worktree, stopped immediately, production untouched). It now runs withPATH=/usr/bin:/bin: git, but no cmake and no go. It cannot start a build even ifSTAMP_ONLYregresses; its red state exits 127.preflight 114/114 (module and script mode — both collect the new classes, per the file's own warning about classes appended after
__main__); vision-suite client 38, quant_dims 8, rescore 24, summarizers 134.🤖 Generated with Claude Code