Skip to content

feat(backend-native-cpu): iOS/macOS Kotlin/Native targets with embedded kernel archives (#959) - #962

Merged
michalharakal merged 1 commit into
developfrom
feature/ios-native-kernel-targets-959
Aug 11, 2026
Merged

michalharakal merged 1 commit into
developfrom
feature/ios-native-kernel-targets-959

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

First of two PRs for #959 (iOS kernel track of #920). Stacked on #961 (the Apple dotprod dispatch — this PR's archives compile at baseline and need that dispatch to be correct on A12); the first commit here is #961's, and this becomes a one-commit diff once it merges.

What's new:

  • Targets: iosArm64(), iosSimulatorArm64(), macosArm64() wired through the existing wireSkainetKernels cinterop/embedding seam — zero changes to the seam itself. Source sets join the hand-wired nativeMain/nativeTest; NativeKnKernelProvider and the 7 parity suites need no code changes.
  • Apple CMake lanes (macOS host only, onlyIf gated): device archive against the iphoneos SDK (min iOS 12.0), simulator against iphonesimulator (min 14.0), macosArm64 plain arm64 (min 11.0, SKAINET_STATIC_ONLY — the FFM dylib still comes from the regular host build). Deployment minimums match K/N's, so the K/N link never warns. No -march: one device archive serves A12 (no dotprod) through A18/M-series via the perf(backend-native-cpu): runtime FEAT_DotProd dispatch for Apple arm64 Q4_K/Q6_K kernels (#958) #961 runtime dispatch.
  • Archive-dir resolution mirrors the Linux pair: injected -PskainetKernelsIosArm64Dir / -PskainetKernelsIosSimulatorArm64Dir / -PskainetKernelsMacosArm64Dir (CI) > macOS-host heuristic (local dev) > bindings-only with the established loud cinterop warning.
  • PR-time CI: the native-cpu-multiarch.yml macos-14 leg now runs macosArm64Test (native on the M-series runner — dispatch fast arm) and iosSimulatorArm64Test (same parity suites in the simulator).
  • Host gating: on non-macOS hosts the whole Apple task family is disabled, so ubuntu CI is deterministic regardless of KGP defaults.

Verified on a Linux host (the highest-risk item — Apple targets joining the commonized cinterop set): :skainet-backend-native-cpu:build and root assemble green, compileKotlinIosArm64 correctly SKIPPED, Linux K/N tests unaffected. The real archive build + simulator/native test execution is exercised by this PR's own macos-14 lane.

Follow-up PR (same issue): publish.yml plumbing (build + upload + inject the three archives at release) and the kernel-support-matrix native-cinterop tier.

aharakal
aharakal previously approved these changes Aug 11, 2026
@michalharakal
michalharakal dismissed aharakal’s stale review August 11, 2026 14:53

The merge-base changed after approval.

@michalharakal
michalharakal requested a review from aharakal August 11, 2026 14:54
aharakal
aharakal previously approved these changes Aug 11, 2026
@michalharakal
michalharakal dismissed aharakal’s stale review August 11, 2026 14:59

The merge-base changed after approval.

…ed kernel archives (#959)

iosArm64 + iosSimulatorArm64 + macosArm64 join the module through the
existing wireSkainetKernels cinterop/embedding seam (#941/#942). Three
Apple CMake lanes (macOS host only; CMake first-class iOS support, no
toolchain file) produce the Mach-O static archives — device: iphoneos
SDK, min iOS 12.0; simulator: iphonesimulator SDK, min 14.0; macOS:
arm64, min 11.0, static-only. No -march is passed: the #958 runtime
FEAT_DotProd dispatch serves A12 through M-series from one archive.

Archive-dir precedence mirrors the Linux pair: injected
-PskainetKernelsIosArm64Dir / -PskainetKernelsIosSimulatorArm64Dir /
-PskainetKernelsMacosArm64Dir > macOS-host heuristic > bindings-only
with a loud cinterop warning. The shared nativeTest parity suites gain
iosSimulatorArm64Test / macosArm64Test on macOS hosts; the multiarch
macos-14 PR lane runs both. On non-macOS hosts the whole Apple task
family is disabled — module build + root assemble verified green on
Linux with the targets declared.

Refs #920
@michalharakal
michalharakal force-pushed the feature/ios-native-kernel-targets-959 branch from ebcfc53 to 3acf18a Compare August 11, 2026 15:10
@michalharakal
michalharakal requested a review from aharakal August 11, 2026 15:22
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.

2 participants