Skip to content

macOS: CI now, oxa on macOS in 0.2.2 (Seatbelt sandbox), local engine later #35

Open

Description

@n0rpan

Owner (2026-11-16): oxa should run on macOS too. Decided order: 0.2.1 stays Linux; 0.2.2 = oxa on macOS with cloud models and a native sandbox; the local engine on macOS later, after a measurement decides whether a Metal path is needed.

Step 1 now: macOS CI (non-required at first)

  • New job on GitHub-hosted macos-15 (arm64; free for this public repo): build and test the oxa workspace with the release profile and features of the Linux release artefact, minus Linux-only crates/features behind cfg(target_os = "linux").
  • Triggers: pushes to main and PRs touching oxa/; not in the merge queue and not a required check until it has been green on main for a week.
  • Whatever does not compile on macOS gets the smallest cfg gate or a portable replacement, never a silent no-op in a security path.

Step 2 (0.2.2): oxa on macOS

  • Sandbox backend on Seatbelt (sandbox-exec profile generated from the same policy as bubblewrap: workspace writes, credential files denied, network off unless allowed); the same sandbox tests run on both platforms. Hard core: orchestrator read.
  • Replace /proc and cgroup reads with portable equivalents (sysctl / mach APIs) where oxa needs them; paths under ~/Library/Application Support; PTY and process-group handling.
  • Distribution: Homebrew tap or tarball; Apple code signing + notarization (owner provides the Apple Developer account).
  • The developer-love scorecard oxa developer-love scorecard (measured every release) #34 measured on a Mac too.

Step 3 (later): local engine on macOS

Measure CPU-only oxe-server on an M-series Mac against llama.cpp/MLX with Metal on the same model; then decide on a Metal path.

Activity

  1. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    Distribution decision (owner, 2026-11-16): no paid Apple Developer membership for now. oxa ships on macOS via a Homebrew tap (formula with bottles or build from source) and a curl install script; neither sets the quarantine flag, and the ad-hoc signature the Rust linker adds on macOS satisfies Apple Silicon. Developer ID signing + notarization (USD 99/year) only if we later ship browser downloads, a .pkg or a desktop app.

  2. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    Step1 is implemented in oxstack/ox-llm#796 (T3), with compiler failures fixed via small Linux gates/portable directory flags and explicit unsupported sandbox/MCP/inbox refusals. Release test-target compilation and workspace build passed on hosted ARM macOS. The completed diagnostic ran the workspace:3423 pass/253 fail/3 existing ignores; runtime failures span Linux sandbox/process/inbox assumptions and Darwin socket/filesystem behavior. Those remain visible rather than broad test exclusions or weakened safeguards; they belong to the later runtime port, not a macOS product-support claim. Temporary diagnostic removed; final exact release-profile run43948813910 is live and will be watched to completion. Linux1146 touched-crate tests and strict checks pass. No engine/packaging/sign-in/credential implementation or required-gate changes.

  3. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    Step 1 PR oxstack/ox-llm#796 final head e847934: Linux required CI green. macOS release CI completed: release test-target compilation and workspace build pass; runtime tests remain visibly red across 52 targets. This is a compile/CI foothold, not macOS runtime support. Independent T3 review MERGE-OK; owner HARD sandbox read outstanding. No merge performed. Proceeding with the separately requested lane workflow.

  4. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Update from the 2026-11-17 oxe review (oxstack/oxe#17). Proposed replacement for the local-engine part (Step 3) and new issue specs:

    Proposed issue updates

    (i) Replacement for "Step 3" of #35

    Step 3 (0.2.3 to 0.3): local engine on macOS

    No matched Mac measurement exists yet (#241), so this step starts with one.

    1. 0.2.3, engine adapter: implement the server's Engine trait as an HTTP client to an external OpenAI-compatible local server (mlx-lm or llama.cpp with Metal). oxa and the serving layer (prefix reuse, session restore, admission, idle unload) then work on macOS without our kernels.
    2. 0.2.3, measurement: on one Apple silicon Mac, same model family and prompts: (a) CPU-only oxe-server on performance cores, (b) llama.cpp with Metal, (c) MLX, (d) the adapter in front of (b) or (c). Prefill and decode reported separately, with receipts. The CPU engine already builds and passes its model-free tests on an Apple M2 under Linux (engine/docs/PORTABILITY-PROBE-ARM2.md).
    3. Decision rule (proposed thresholds, owner to confirm): if CPU-only is within 1.3x of Metal/MLX on decode and 2x on prefill, ship the CPU engine with performance-core placement. Otherwise build a native MLX backend behind the same trait in 0.3 (mlx-rs or mlx-c), with MLX-format model entries and KV export for the state store.
    4. Linux on Apple silicon (desk C05: InProcessLink: the whole session command set #293): CPU engine plus the adapter in front of an existing accelerated server; no own GPU kernels.

    Distribution stays as decided: Homebrew tap and install script.

    (ii) New issues

    1. engine: architecture guards in the int8-gemm and qwen4exp build scripts. cargo check --workspace fails off aarch64 because both pass ARM -march flags to the host compiler. Mirror the early return in kernels-sys/build.rs. Done when the workspace check passes on x86_64 and macOS runners.
    2. engine: per-machine CPU target and hybrid-aware default placement. Replace the fixed target-cpu=oryon-1 with a documented per-target setting. Default --oxe-cpus to the highest-capacity cores when capacities differ; unchanged when equal. Tests with fake sysfs trees.
    3. oxe: read-only hardware report. oxe doctor --hardware --json: cores, capacities, cpufreq policies and governor, THP mode, thermal zones, memory. No writes, no benchmark. Golden tests on fixture trees.
    4. engine: ExternalEngine adapter. Engine trait over HTTP to an OpenAI-compatible server: streaming, cancel, token counts. Tested against the stub server. Prefix-cache behaviour documented as pass-through.
    5. benchmarks: Mac volunteer run. Make mac_reproduce.py runnable in one command, add a CPU-only oxe arm, publish the receipt format. Closes the Mac half of benchmarks: matched stock-versus-now baselines with JSON receipts, and a Mac volunteer run oxe#8.
    6. engine: decode team size by context length. Optional rule selecting the decode thread count from the active context length; default unchanged. Token-identity test across team sizes. One laptop row decides the default.
    7. engine: weight-arena page-size switch. Expose the existing anonymous-THP and file-collapse options as one switch; record backing and huge-page coverage in the load receipt. One laptop row: decode tok/s, RSS, load time.
    8. engine: cold-reload path. Parallel fault-in of the arena after mapping; documented cache location. Load-phase timings in the receipt. One laptop row for cold and warm reload.
    9. oxa: battery profile (opt-in). Setting that selects a smaller decode team on battery; default unchanged. AC/battery detection tested with fixtures. One laptop row with a power readout before any default change.
  5. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Note (O-443): the local engine's no-swap guard and its launcher are Linux-only (systemd user scope + cgroup v2 MemorySwapMax=0, see https://github.com/oxstack/ox-llm/issues/1010). The macOS path needs its own memory-pressure guard (no cgroups: e.g. RSS/memorystatus checks, wired-memory/mlock limits, MLX unified-memory limits) behind the same platform launcher trait. Track it here when the Mac engine work starts.

  6. oxa-agent commented on Nov 17, 2026

    @oxa-agent
    Contributor

    Local launch memory-policy seam for the macOS plan: oxstack/ox-llm#1011 (issue oxstack/ox-llm#1010) introduces PlatformLauncher for owned-child attachment and a fresh memory baseline before readiness. Linux alone implements the D-Bus/cgroup v2 policy: inherited no-swap reuse or child transient scope, never MemoryMax. A macOS backend must supply its own pressure/admission policy through this seam (for example memorystatus/RSS/wired or MLX unified-memory limits), including fail-closed diagnostics and owned cleanup; Linux cgroup predicates must not be assumed portable. No macOS implementation, new defaults or measurements are claimed here.

  7. oxa-orchestrator commented on Nov 18, 2026

    @oxa-orchestrator
    Contributor

    Owner decision (2026-11-18): an oxa macOS dev build now, for dogfooding. This pulls steps 1-2 forward; 0.2.1 itself stays Linux.

    • Re-land the closed oxstack/ox-llm#796 (tag archive/pr-796) in slices. The first target is a CI job on macos-15 arm64, then a macos-arm64 asset in the rolling dev release with the same checksum, attestation and forward-only rules as Linux.
    • No OS sandbox yet: tools run unsandboxed, with a persistent warning ("no OS sandbox on macOS") and an environment note. The build never claims to be sandboxed. File-tool denials, credential masking, user-only settings and offline mode still apply. Seatbelt remains the 0.2.2 target.
    • The ChatGPT plan sign-in is ported now (atomic, create-only token write). Edits to the sandbox crate and the token code get a human core read.
    • A red macOS build does not block the Linux dev release. The macOS installer verifies attestations and requires gh.
    • Signing stays as decided on 2026-11-16: ad-hoc only, no notarization.
  8. n0rpan commented on Nov 19, 2026

    @n0rpan
    ContributorAuthor

    Triage 2026-11-19: this issue is now tracked in #159 (Cluster: macOS: dev asset, portable process checks, sandbox for unattended runs, priority P1), planned PR 3: "Seatbelt for unattended runs". It will be fixed there together with its related issues, not one by one.

  9. transferred this issue fromon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions