Skip to content

Phase 5 foundation: per-platform go:embed split [draft, stacks on #2] - #3

Merged
NestorCanales merged 1 commit into
feat/local-embeddingsfrom
feat/xplat-foundation
Jul 27, 2026
Merged

Phase 5 foundation: per-platform go:embed split [draft, stacks on #2]#3
NestorCanales merged 1 commit into
feat/local-embeddingsfrom
feat/xplat-foundation

Conversation

@NestorCanales

Copy link
Copy Markdown
Collaborator

What

The prerequisite for every Phase 5 platform (epic Open Concern #8): one binary can embed only one platform's ONNX Runtime library, so the hardcoded macOS dylib embed moves into per-platform assets_embed_<GOOS>_<GOARCH>.go files. Model + tokenizer stay in the shared embed (identical bytes everywhere).

Stacks on #2 (Phases 0–4) — review that first; this diff is only the foundation.

Changes

  • New assets_embed_darwin_arm64.go — the per-platform piece: ORT embed directive + embeddedORTLib + ortLibFile. Each later platform (Linux, Windows, macOS-Intel) adds one sibling file + manifest entries, nothing else.
  • assets_embed.go — platform-neutral now; extraction reads the lib from the per-platform FS.
  • assets.godylibCandidates gains the versioned libonnxruntime.so.1.26.0 the official Linux tarball ships.
  • Makefile — portable SHA256 (Linux sha256sum / macOS shasum -a 256) so make assets runs in Docker/CI.
  • Tripwire test: ortLibFile must be a name findDylib recognizes.
  • Epic updated (Phase 5 execution decisions recorded).

Verification (darwin-arm64 — zero behavior change)

  • go test ./... green, untagged build stays native-lib-free
  • go vet ./... clean
  • Tagged integration test passes; Phase 0 cosine-distance ordering reproduced (0.134 < 0.170 < 0.283)
  • make build succeeds; packaged app re-extracted its embedded assets from scratch (runtime dir cleared first) and answered an MCP stdio search

Next PRs (per epic Phase 5 plan)

Linux (Docker) → macOS x86_64 (Rosetta) → Windows x64 (Rust tokenizer build).

🤖 Generated with Claude Code

Implements epic Open Concern #8: one binary can embed only one platform's
ONNX Runtime library, so the ORT go:embed moves out of the shared
assets_embed.go into per-platform assets_embed_<GOOS>_<GOARCH>.go files
(darwin-arm64 first; each defines embeddedORTLib + ortLibFile). Model and
tokenizer stay in the shared embed — identical bytes on every platform.
Each later Phase 5 platform lands as one sibling file + manifest entries.

Also, prerequisites for building on Linux at all:
- Makefile: portable SHA256 var (sha256sum on Linux, shasum -a 256 on mac)
- dylibCandidates: add the versioned libonnxruntime.so.1.26.0 the official
  Linux tarball actually ships
- tripwire test: ortLibFile must be a name findDylib recognizes

No behavior change on darwin-arm64: untagged tests green, tagged
integration test passes (Phase 0 distance ordering reproduced), packaged
app re-extracts embedded assets and answers an MCP search.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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