Skip to content

swift bindings - #30

Merged
cjpais merged 8 commits into
mainfrom
swift-bindings
Jun 16, 2026
Merged

swift bindings#30
cjpais merged 8 commits into
mainfrom
swift-bindings

Conversation

@cjpais

@cjpais cjpais commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

cjpais and others added 8 commits June 16, 2026 14:06
The committed family.rs was not `cargo fmt --all --check` clean, failing the
rust-gates rustfmt step on PR #30. No semantic change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The swift-{gates,macos,ios} jobs ran on GitHub-hosted runners
(ubuntu-latest / macos-15) and were blocked by the account's GitHub Actions
spending limit ("the job was not started because recent account payments
have failed..."), the same posture the rest of the repo already avoids.
Move them onto the existing fleet: the abihash gate to Blacksmith
(blacksmith-2vcpu-ubuntu-2404) and the macOS build/test + iOS cross-compile
to the self-hosted M4 Mac mini ([self-hosted, macOS, ARM64]).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On macOS 15+ ggml-metal uses residency sets and asserts every GPU resource is
released before its device teardown (ggml-metal-device.m:612). The examples held
the model/session in top-level `let` bindings, which outlive `main`, so the
model was still alive at process exit and the assert aborted with SIGABRT (exit
134) — after transcribing correctly. `swift test` passes because tests scope
their models in methods (freed mid-process); only the examples leaked to exit.

Wrap each example's model/session/stream in a `do {}` so ARC frees the native
resources before the process exits. backend-select is unaffected (CPU-only, no
residency sets). Verified locally on macOS 26.5.1 / real Metal: all five exit 0,
no abort, transcription unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Document the macOS 15+/iOS 18+ ggml-metal residency-set teardown: a Model held
in a top-level/global `let` that outlives `main` is still alive at the backend's
process-exit teardown, which asserts all GPU resources were released first and
aborts. Normal object lifetimes are unaffected; the examples scope their work in
a `do {}` block. We keep residency sets on (real perf benefit, PR ggml-org/
llama.cpp#11427) and ggml unpatched; this is the documented contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cjpais
cjpais merged commit 57f97f8 into main Jun 16, 2026
18 checks passed
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