Skip to content

Phase 5 macOS Intel: source-built ORT + arch-safe extraction [draft, stacks on #4] - #6

Closed
NestorCanales wants to merge 1 commit into
feat/xplat-linuxfrom
feat/xplat-macos-intel
Closed

Phase 5 macOS Intel: source-built ORT + arch-safe extraction [draft, stacks on #4]#6
NestorCanales wants to merge 1 commit into
feat/xplat-linuxfrom
feat/xplat-macos-intel

Conversation

@NestorCanales

Copy link
Copy Markdown
Collaborator

What

Intel-Mac support (epic Phase 5, step 3). Stacks on #4#3#2; review in order — this diff is Intel-only.

The headline artifact

Microsoft stopped publishing mac-Intel ONNX Runtime builds at 1.23, and the epic pins 1.26.0 everywhere — so per the epic's plan, we built it ourselves from the official v1.26.0 source tag (MIT), cross-compiled from the arm64 Mac. It's published as this repo's ort-1.26.0-darwin-x64 release (prerelease-flagged, reproducible build recipe in the notes) and pinned by SHA-256 in the manifest like every other artifact. The dylib was validated by running the repo's integration test as an x86_64 binary under Rosetta before publishing.

Changes

  • assets/manifest.jsondarwin-amd64: our ORT release + official libtokenizers.darwin-x86_64 prebuilt, archive- and member-pinned.
  • assets_embed_darwin_arm64.goassets_embed_darwin.go (localembed && darwin) — both mac arches share the dylib filename; mirrors the Linux single-file pattern from Phase 5 Linux: manifest + embed file + darwin-guarded tray [draft, stacks on #3] #4.
  • Makefilemake build-darwin-amd64: cross-build the Intel app from an arm64 Mac.
  • Bug found & fixed: the runtime extraction dir (~/.agent-memory/runtime/<fingerprint>/) wasn't arch-namespaced — an Intel build (or a home dir migrated from an Intel Mac, a common real scenario) left an x86_64 dylib that poisoned the arm64 build's dlopen. Dirs are now <GOOS>-<GOARCH>-<fingerprint>. Caught live during verification; no shipped users affected (the extraction scheme exists only in this PR stack).
  • CLAUDE.md + epic updated (Phase 5 Intel findings recorded).

Verification (arm64 dev Mac + Rosetta 2)

  • Integration test as an x86_64 binary: PASS — cosine ordering 0.140 < 0.171 < 0.288, matching arm64 and Linux
  • GOARCH=amd64 make assets: downloads from the repo release, both checksums verify
  • Full x86_64 Wails app builds, extracts assets to its own arch dir (coexisting with the arm64 dir — the collision fix proven live), answers an MCP semantic search correctly
  • Native arm64: assets restored, app rebuilt, search OK, go test ./... + go vet green

Remaining in Phase 5

Windows x64 (Rust tokenizer build, needs the Windows PC) + a 10-minute Linux-amd64 runtime smoke on any x64 Linux box.

🤖 Generated with Claude Code

…extraction

Adds darwin-amd64 to assets/manifest.json. The ONNX Runtime dylib is our
own source build of the official v1.26.0 tag (Microsoft's mac-Intel
prebuilts stopped at 1.23), cross-compiled from arm64 and published as
this repo's ort-1.26.0-darwin-x64 release with a reproducible recipe in
its notes; tokenizers ships an official darwin-x86_64 prebuilt. Both are
archive- and member-pinned by SHA-256 like every artifact.

assets_embed_darwin_arm64.go becomes assets_embed_darwin.go
(localembed && darwin) — both mac arches share the dylib name, mirroring
the Linux single-file pattern. New make build-darwin-amd64 target
cross-builds the Intel app from an arm64 Mac.

Fixes an arch-collision bug this work exposed: the runtime extraction dir
was keyed only by provider/model fingerprint, so an Intel build (or a
home dir migrated from an Intel Mac) left an x86_64 dylib that poisoned
the arm64 build's dlopen. Extraction dirs are now namespaced
<GOOS>-<GOARCH>-<fingerprint>; no shipped users affected (the scheme
exists only in this unmerged PR stack).

Verified on the arm64 dev Mac via Rosetta 2: integration test passes as
an x86_64 binary (cosine ordering 0.140 < 0.171 < 0.288, matching arm64
and Linux); GOARCH=amd64 make assets downloads + verifies from the repo
release; the full x86_64 Wails app builds, extracts to its own arch dir
(coexisting with the arm64 dir), and answers an MCP search. Native arm64
build re-verified after restoring assets.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NestorCanales

Copy link
Copy Markdown
Collaborator Author

Consolidated into #2 (single reviewable branch per Bo's review-workflow preference) — all commits from this PR are now in feat/local-embeddings.

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