From 058d30bfd0de2ead0d72a4324dd815ba320ca846 Mon Sep 17 00:00:00 2001 From: Sanchit Monga Date: Wed, 2 Sep 2026 02:40:49 -0700 Subject: [PATCH] feat(catalog): Kokoro-82M on the ANE, and pin SDK 0.20.34 The app's first ANE text-to-speech row, and the last of NeuRT's eight served primitives to reach a catalog. Kokoro-82M runs across three Core ML graphs (duration -> decode -> gen) plus two host seams that are not expressible as ANE ops -- the duration->alignment expansion and the harmonic source -- and ships its own G2P lexicon, so no runtime phonemizer is needed. 0.20.34, not 0.20.33, and the distinction matters. The tts_ops slot shipped in .33, but the engine emitted int16 PCM where every other engine emits float32 under the same AUDIO_FORMAT_PCM enum -- which names a CONTAINER and carries no bit depth at all. Consumers reading the documented float32 got half the samples and a saturated waveform, with no error at any layer. Fixed in the 0.20.34 engine, so a row pinned to .33 would have downloaded 146 MB and played garbage. `.tts` sets allowedFrameworks nil, so this row is reachable with no picker change -- unlike the RAG contexts, which had to gain `.coreml` explicitly. swift package resolve runanywhere-swift 0.20.34 (8bd75a29) xcodebuild test ** TEST SUCCEEDED ** 23 passed, 0 failed Verified end to end on the same engine through RCLI, which shares this SDK: 79200 samples, 3.30s @ 24 kHz, 0.00% clipped. --- Package.resolved | 6 ++--- Package.swift | 2 +- RunAnywhereAI.xcodeproj/project.pbxproj | 2 +- .../Core/Services/ModelCatalogBootstrap.swift | 24 +++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Package.resolved b/Package.resolved index eebfd6e..30d7151 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "8c8d876c8a7cb371cf2bcef775986d0f6b40d5aaff481da000c5fca5c9e4707d", + "originHash" : "265319a3e745dcc48d7923b465514f940d8689aae2a78ddbe2a19fef1f415f9a", "pins" : [ { "identity" : "devicekit", @@ -60,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/RunanywhereAI/runanywhere-swift.git", "state" : { - "revision" : "4d1a0480eb80f516da481607fb86a7ad3f566432", - "version" : "0.20.33" + "revision" : "8bd75a291dee4c359a2c118ee317ab8c33dd0238", + "version" : "0.20.34" } }, { diff --git a/Package.swift b/Package.swift index c664122..ac653a4 100644 --- a/Package.swift +++ b/Package.swift @@ -63,7 +63,7 @@ let package = Package( // needs. .package( url: "https://github.com/RunanywhereAI/runanywhere-swift.git", - from: "0.20.33" + from: "0.20.34" ), ], targets: [ diff --git a/RunAnywhereAI.xcodeproj/project.pbxproj b/RunAnywhereAI.xcodeproj/project.pbxproj index 0aac1e5..c02d220 100644 --- a/RunAnywhereAI.xcodeproj/project.pbxproj +++ b/RunAnywhereAI.xcodeproj/project.pbxproj @@ -1031,7 +1031,7 @@ repositoryURL = "https://github.com/RunanywhereAI/runanywhere-swift.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.20.33; + minimumVersion = 0.20.34; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/RunAnywhereAI/Core/Services/ModelCatalogBootstrap.swift b/RunAnywhereAI/Core/Services/ModelCatalogBootstrap.swift index bd75f30..979c6cc 100644 --- a/RunAnywhereAI/Core/Services/ModelCatalogBootstrap.swift +++ b/RunAnywhereAI/Core/Services/ModelCatalogBootstrap.swift @@ -1599,6 +1599,30 @@ enum ModelCatalogBootstrap { logger.info("LoRA adapters skipped: no adapter matches the current catalog") #endif + // The first ANE TEXT-TO-SPEECH row, and NeuRT's last null primitive filled. Kokoro-82M + // across three Core ML graphs (duration -> decode -> gen) plus two host seams that are not + // expressible as ANE ops: the duration->alignment expansion and the harmonic source. Ships + // its own G2P lexicon, so no runtime phonemizer is needed. + // + // Requires SDK 0.20.34, not 0.20.33. The slot shipped in .33, but the engine emitted int16 + // PCM where every other engine emits float32 under the same AUDIO_FORMAT_PCM enum -- which + // names a container and carries no bit depth -- so audio came out half-length and + // saturated with no error anywhere. Fixed in the 0.20.34 engine. + // + // `.tts` sets allowedFrameworks nil, so this row is reachable without a picker change. + await registerArchive( + id: "kokoro-82m-ane", + name: "Kokoro 82M (NeuRT / Neural Engine)", + url: "https://huggingface.co/runanywhere/Kokoro-82M_ANE/resolve/main/" + + "kokoro-82m_ANE.zip", + framework: .coreml, + modality: .speechSynthesis, + archive: .zip, + structure: .nestedDirectory, + // 145.9 MB download; the three graphs plus a 4.3 MB G2P lexicon resident. + memoryRequirement: 400_000_000 + ) + // --- Image generation (CoreML diffusion; Apple only) -------------------- // Apple's palettized Stable Diffusion 1.5. The id matches the built-in // diffusion registry (diffusion_model_registry.cpp) and RCLI's `sd15`