Skip to content

Feature/skainet 0.40 0.39 migration kernelrace - #30

Merged
michalharakal merged 4 commits into
developfrom
feature/skainet-0.40-0.39-migration-kernelrace
Aug 12, 2026
Merged

michalharakal merged 4 commits into
developfrom
feature/skainet-0.40-0.39-migration-kernelrace

Conversation

@michalharakal

Copy link
Copy Markdown
Contributor

No description provided.

michalharakal and others added 4 commits August 12, 2026 21:14
skainet-transformers hasn't caught up to the core 0.40.x line yet (tops out
at 0.39.1 on Maven Central), so the version target is mixed:

- Core-only samples (SinusApproximator, MNISTDemo, GloVeEmbeddings,
  TinyTransformer, MnistJavaDemo, skainet-ui) -> SKaiNET 0.40.1
- KllamaDemo (uses skainet-transformers) -> SKaiNET/transformers 0.39.1,
  the latest matched pair

Every KMP build also needs Kotlin 2.3.21 -> 2.4.10, since 0.39.1 and 0.40.1
klibs both declare that floor. Along the way, sk.ainet.core:skainet-data-basic
was renamed to skainet-data-simple starting at 0.36.0 (MnistJavaDemo,
SinusApproximator, MNISTDemo catalogs); GloVeEmbeddings' Gradle wrapper was
bumped from 9.0 to the repo-standard 9.5.1. KllamaDemo needed no source
changes -- the 0.39.1 compatibility typealiases cover the 0.34.1 API surface
it uses. Every sample was rebuilt and tested (JVM/wasm/js/android + relevant
unit tests) against the new versions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
AndroidNeonLlmDemo showed SKaiNET's hand-written ARM NEON kernels with an
Android-only NEON-vs-scalar A/B race, but every other sample in this repo is
Kotlin Multiplatform. This turns it into KernelRace: Android stays the focus
(the race itself is inherently Android-only kernel-SPI territory), and the
same engine now also runs on Desktop and in the browser as a KMP app. iOS is
deferred until the multiplatform structure is proven out.

- shared/: engine, model resolution and ChatViewModel are platform-neutral
  commonMain code with expect/actual seams per platform (LlamaRuntimeBuilder
  for runtime construction, ModelProvider for Android download/cache/asset
  vs. Desktop cache vs. Wasm's bundled-at-build-time bytes). ChatViewModel
  depends on a GenerativeEngine interface and an injectable dispatcher
  specifically so it's unit-testable with a fake on every target.
- composeApp/: shared UI on the skainet-ui design system, with a
  kernelControls slot so the Android-only race UI (KernelRaceApp's kernel
  pinning, the NEON/SCALAR chips, the split-screen race button) never leaks
  into common code.
- Real test coverage: PromptTemplate/TokenStats/ModelResolver unit tests, a
  ChatViewModel test suite (fake engine, virtual-time coroutine scheduler),
  and a GgufSmokeTest that loads the actual SmolLM2 GGUF and generates
  tokens end to end when the model is present locally.
- CI workflow (first build CI in this repo): JVM/Android unit tests, Android
  debug APK assembly, and a wasm compile check on every PR touching
  KernelRace/ or skainet-ui/.

Verified end to end: clean builds pass on Android/JVM/wasmJs, the Android
debug APK packages the NEON .so libs, and the wasm production webpack build
correctly bundles the ~145 MB GGUF via Compose resources.

The original AndroidNeonLlmDemo snapshot remains available at the
2026_08_arm_android git tag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The samples page only ever showed a card for samples with a wasm build:
generate-samples-page.py unconditionally emitted a demoUrl for every
webapp.json it found. CLI-only and Android-only samples had no way to
appear at all.

- distDirs/build are now optional; a card only needs id/name/description.
- demoUrl is emitted only when distDirs is non-empty; samples without one
  get a "How to run" button linking to the source instead of a dead "Try
  Demo".
- New "platforms" array renders as chips on every card (web, android, ios,
  desktop, cli, ...), reusing the existing pill styling.
- Added platforms to the four existing webapp.json files and a new
  MnistJavaDemo/webapp.json (the first CLI-only sample on the page).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The repo's root .gitignore excludes *.jar, which silently dropped
gradle-wrapper.jar when KernelRace was created (AndroidNeonLlmDemo never had
it committed either -- it just never ran in CI). Every sample that runs in
CI (TinyTransformer, KllamaDemo, ...) force-adds this jar past the .gitignore
rule; KernelRace needs the same, or ./gradlew has nothing to execute.

Fixes the KernelRace CI failure on PR #30: "Unable to access jarfile
.../KernelRace/gradle/wrapper/gradle-wrapper.jar".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@michalharakal
michalharakal merged commit b401351 into develop Aug 12, 2026
1 of 2 checks passed
@michalharakal
michalharakal deleted the feature/skainet-0.40-0.39-migration-kernelrace branch August 12, 2026 19:26
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