Skip to content

feat(build): publish androidNativeArm32/Arm64 from the six downstream modules - #1239

Merged
michalharakal merged 2 commits into
developfrom
feat/androidnative-arm32-downstream
Aug 31, 2026
Merged

michalharakal merged 2 commits into
developfrom
feat/androidnative-arm32-downstream

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

Why

skainet-io-core, skainet-lang-core, skainet-compile-core, skainet-io-safetensors and skainet-lang-ksp-annotations already target Android native. The rest of the chain a device consumer needs does not — so SKaiNET-transformers' gemma-iree fails at configuration time, which is what turns SKaiNET-transformers#315 CI red:

Could not determine the dependencies of task
':llm-runtime:gemma-iree:compileKotlinAndroidNativeArm32'.
> Could not resolve sk.ainet.core:skainet-compile-dag
> Could not resolve sk.ainet.core:skainet-compile-opt
> Could not resolve sk.ainet.core:skainet-io-gguf
> Could not resolve sk.ainet.core:skainet-backend-api

What

Adds androidNativeArm32 + androidNativeArm64 to the six remaining modules: skainet-io-gguf, skainet-lang-dag, skainet-compile-dag, skainet-compile-opt, skainet-backend-api, skainet-backend-cpu.

Two notes on how, since the 32-bit target has a reputation:

  • No 64-bit split source set is needed here. skainet-io-core needs one because arm32's posix ssize_t/size_t are Int where every other native target has Long, and mixing widths fails the shared native metadata compile. None of these five hand-declared modules has posix-typed code at all, so that reason doesn't reach them. skainet-backend-api wires the new source sets onto nativeMain by hand, matching how it declares the rest of its hierarchy.
  • skainet-backend-cpu opts in through the convention plugin's existing skainet.targets property — the mechanism was already there, unused — and gets a platformDefaultCpuOpsFactory actual. That actual is a copy of the Linux one rather than a dependsOn(linuxMain): Android native is Linux-based but it is bionic, not glibc, and linuxMain is free to grow code that assumes the latter. Six duplicated lines beat inheriting that silently.

Relationship to #990

This supersedes most of #990, which is 269 commits behind and conflicting:

  • Its skainet-io-core half develop has since landed independently — the target, the native64Main split and the Posix32Pread actual are all on develop already.
  • Its skainet-io-gguf half conflicts with a refactor: RandomAccessSourceFactory's six platform actuals were consolidated into one commonMain file, so the native.kt → native64.kt rename it wants no longer has a file to rename.
  • Its exportMain split is no longer necessary. That existed to keep GgufExportFacade/GGUFWriter off arm32 because they need compile-dag — which this PR gives the target, so the split solves nothing.

What remained of #990 was the downstream target list, which is this PR. Suggest closing #990 in favour of it.

Verification

Check Result
compileKotlinAndroidNativeArm32 — all six modules green (klibs produced)
compileKotlinAndroidNativeArm64 — all six modules green
jvmTest — backend-api, backend-cpu, io-gguf green
repo-wide apiCheck unchanged
transformers :llm-runtime:gemma-iree:compileKotlinAndroidNativeArm32 via composite build green — the task that fails on #315

🤖 Generated with Claude Code

https://claude.ai/code/session_01YKeDSK4JF295y53Uvez954

… modules

skainet-io-core, skainet-lang-core, skainet-compile-core, skainet-io-safetensors
and skainet-lang-ksp-annotations already target Android native. The rest of the
chain a device consumer needs does not, so SKaiNET-transformers' gemma-iree fails
to resolve at configuration time:

    Could not determine the dependencies of task
    ':llm-runtime:gemma-iree:compileKotlinAndroidNativeArm32'.
    > Could not resolve sk.ainet.core:skainet-compile-dag / -compile-opt /
      -io-gguf / -backend-api.

Adds the two targets to skainet-io-gguf, skainet-lang-dag, skainet-compile-dag,
skainet-compile-opt, skainet-backend-api and skainet-backend-cpu.

None of the five hand-declared modules carries posix-typed code, so arm32's
Int-width ssize_t/size_t needs no 64-bit split source set — the reason
skainet-io-core has one does not apply. skainet-backend-api wires the new source
sets onto nativeMain by hand, matching how it declares the rest of its hierarchy.

skainet-backend-cpu opts in through the convention plugin's existing
skainet.targets property and gets a platformDefaultCpuOpsFactory actual. That
actual is a copy of the Linux one rather than a dependsOn(linuxMain): Android
native is Linux-based but bionic, not glibc, and linuxMain is free to grow code
that assumes the latter.

Supersedes most of #990, whose io-core half develop has since landed
independently and whose io-gguf half conflicts with the RandomAccessSourceFactory
consolidation. Its exportMain split is no longer needed either: that existed to
keep export tooling off arm32 because it needs compile-dag, which now has the
target.

Verified: compileKotlinAndroidNativeArm32 and Arm64 green for all six; jvmTest
and repo-wide apiCheck unchanged; and via composite build, transformers'
:llm-runtime:gemma-iree:compileKotlinAndroidNativeArm32 — the task that fails on
SKaiNET-transformers#315 — now succeeds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKeDSK4JF295y53Uvez954
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1239 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

… too

The first pass added the targets to the six modules a device consumer needs, but
only ever compiled their MAIN source sets locally. CI's assemble also configures
the test compilations, and those pull in modules the target set did not reach:

    Could not determine the dependencies of task
    ':skainet-backend-cpu:compileTestKotlinAndroidNativeArm32'.
    > Could not resolve project ':skainet-lang:skainet-lang-models'.

A target set has to close over test dependencies, not just main ones. Adding
androidNative to skainet-lang-models pulls in skainet-compile-json (its own
commonTest needs it), and compile-json's tests need lang-models straight back, so
the two of them close the cycle: main deps of both were already covered.

compile-json also needed a writeExportToFile actual. Its native actuals are all
the same NotImplementedError stub duplicated per target; this one covers both
androidNative targets in a single androidNativeMain file, which the default
hierarchy template groups for us.

Verified with the task CI actually failed on this time: assemble is green, as are
compileTestKotlinAndroidNativeArm32 across the affected modules, apiCheck, and
their jvm suites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKeDSK4JF295y53Uvez954
@github-actions

Copy link
Copy Markdown

📖 Documentation Preview

The documentation has been built successfully for this PR.

Generated Files:

  • Operator documentation: docs/modules/operators/_generated_/
  • JSON schema output: operators.json

Artifacts:

  • Download the documentation-preview-1239 artifact to view the complete documentation locally.

This comment will be updated automatically when the PR is updated.

@michalharakal
michalharakal merged commit 29a6089 into develop Aug 31, 2026
19 checks passed
@michalharakal
michalharakal deleted the feat/androidnative-arm32-downstream branch August 31, 2026 14: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