Skip to content

io-safetensors: add androidNative targets (drop unused compile-core/-dag)#845

Merged
michalharakal merged 1 commit into
developfrom
feature/io-safetensors-androidnative
Jul 20, 2026
Merged

io-safetensors: add androidNative targets (drop unused compile-core/-dag)#845
michalharakal merged 1 commit into
developfrom
feature/io-safetensors-androidnative

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Completes androidNative for the SafeTensors weight-loading path (follow-on to #836/#842 for io-core).

What

Adds androidNativeArm32() / androidNativeArm64() to skainet-io-safetensors and removes its
two unused skainet-compile-core / skainet-compile-dag dependencies.

Why it's clean

  1. The compile deps are dead. There is no sk.ainet.compile.* reference anywhere in the
    module (any source set). They were the only commonMain deps lacking androidNative.
  2. No posix in its own nativeMain. createRandomAccessSource and readTextFile are null
    stubs; currentTimeMillis uses TimeSource.Monotonic. So there is no bit-width metadata
    conflict here — unlike io-core, whose posix pread needed the native64Main split (io-core: add androidNativeArm32 via 64-bit-only native64Main source set #842).
    File-backed reads route through io-core's RandomAccessSource.

After dropping the dead deps, commonMain depends only on lang-core + io-core (both
androidNative) + kotlinx, so the targets just needed declaring.

Verification

compileNativeMainKotlinMetadata, compileKotlinAndroidNativeArm32, compileKotlinAndroidNativeArm64,
compileKotlinJvm, and :skainet-io:skainet-io-safetensors:jvmTest all green.

Unblocks on-device SafeTensors loading (the last io module that was jvm/linux-only) — e.g. an eager
on-device Moonshine ASR path on the 32-bit box / arm64 phones.

…dag deps

skainet-io-safetensors was jvm/linux-only, blocking on-device (androidNative)
SafeTensors weight loading. Two independent facts make it a clean add:

1. The commonMain deps on skainet-compile-core and skainet-compile-dag are unused
   (no sk.ainet.compile.* reference anywhere in the module) — they were the only
   deps lacking androidNative. Removed.
2. io-safetensors has no posix in its own nativeMain: createRandomAccessSource and
   readTextFile are null stubs and currentTimeMillis uses TimeSource.Monotonic, so
   there is no bit-width metadata issue (unlike io-core, whose posix pread needed
   the native64Main split in #842). File-backed reads route through io-core's
   RandomAccessSource.

After removing the dead deps, commonMain depends only on lang-core + io-core (both
androidNative) + kotlinx, so androidNativeArm32/Arm64 just needed declaring.

Verified: compileNativeMainKotlinMetadata, compileKotlinAndroidNativeArm32/Arm64,
compileKotlinJvm, and jvmTest all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@michalharakal
michalharakal merged commit a732489 into develop Jul 20, 2026
7 checks passed
@michalharakal
michalharakal deleted the feature/io-safetensors-androidnative branch July 20, 2026 11:28
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