fix(build): restore macOS x86_64 compile by removing unguarded Float16 (#875) - #876
Conversation
#875) v0.15.6 added Paraformer, LogitsArgmax, and NeuTTS code that addresses fp16 MLMultiArray storage via Swift.Float16, which is unavailable on macOS x86_64. This broke Intel swift build and downstream universal (arm64 + x86_64) archives even for apps not using those features, since the sources are part of the monolithic FluidAudio target. Replace the Float16-typed accesses with the established portable pattern already used by KokoroAneArrays and ANEMemoryUtils: address the half-precision storage as UInt16 bit patterns and convert with vImage's Planar16F routines, now factored into a shared Float16Conversion enum. The NeuTTS seedState and floatBuffer scalar loops become vectorized vImage passes as a side effect; results are bit-identical. Also add an x86_64 cross-compile job to tests.yml so unguarded Float16 usage fails PR CI instead of surfacing on Intel machines after release. Verified: swift build --arch x86_64 reproduces all errors from the issue on unpatched main and passes with this change; native arm64 build unchanged.
PocketTTS Smoke Test ✅
Runtime: 0m29s Note: PocketTTS uses CoreML MLState (macOS 15) KV cache + Mimi streaming state. CI VM lacks physical GPU — audio quality and performance may differ from Apple Silicon. |
Parakeet EOU Benchmark Results ✅Status: Benchmark passed Performance Metrics
Streaming Metrics
Test runtime: 1m39s • 08/22/2026, 07:57 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
Speaker Diarization Benchmark ResultsSpeaker Diarization PerformanceEvaluating "who spoke when" detection accuracy
Diarization Pipeline Timing BreakdownTime spent in each stage of speaker diarization
Speaker Diarization Research ComparisonResearch baselines typically achieve 18-30% DER on standard datasets
Note: RTFx shown above is from GitHub Actions runner. On Apple Silicon with ANE:
🎯 Speaker Diarization Test • AMI Corpus ES2004a • 1049.0s meeting audio • 40.0s diarization time • Test runtime: 2m 50s • 08/22/2026, 07:58 PM EST |
Offline VBx Pipeline ResultsSpeaker Diarization Performance (VBx Batch Mode)Optimal clustering with Hungarian algorithm for maximum accuracy
Offline VBx Pipeline Timing BreakdownTime spent in each stage of batch diarization
Speaker Diarization Research ComparisonOffline VBx achieves competitive accuracy with batch processing
Pipeline Details:
🎯 Offline VBx Test • AMI Corpus ES2004a • 1049.0s meeting audio • 106.2s processing • Test runtime: 1m 56s • 08/22/2026, 07:58 PM EST |
VAD Benchmark ResultsPerformance Comparison
Dataset Details
✅: Average F1-Score above 70% |
ASR Benchmark Results ✅Status: All benchmarks passed Parakeet v3 (multilingual)
Parakeet v2 (English-optimized)
Streaming (v3)
Streaming (v2)
Streaming tests use 5 files with 0.5s chunks to simulate real-time audio streaming 25 files per dataset • Test runtime: 9m6s • 08/22/2026, 08:04 PM EST RTFx = Real-Time Factor (higher is better) • Calculated as: Total audio duration ÷ Total processing time Expected RTFx Performance on Physical M1 Hardware:• M1 Mac: ~28x (clean), ~25x (other) Testing methodology follows HuggingFace Open ASR Leaderboard |
Supertonic3 Smoke Test ✅
Runtime: 0m58s Note: CI VMs lack a physical Neural Engine; the ANE-bucketed VectorEstimator falls back to CPU here. This validates download + variant resolution + synthesis, not ANE residency/perf. |
Sortformer High-Latency Benchmark ResultsES2004a Performance (30.4s latency config)
Sortformer High-Latency • ES2004a • Runtime: 2m 45s • 2026-08-23T00:06:20.853Z |
Fixes #875.
Root cause
v0.15.6 added three files that address fp16
MLMultiArraystorage viaSwift.Float16, which is unavailable on macOS x86_64:ASR/Shared/LogitsArgmax.swift(shared by SenseVoice CTC + Paraformer)ASR/Paraformer/ParaformerManager.swift(rows(of:))TTS/NeuTts/NeuTtsSynthesizer.swift(seedState,floatBuffer)This broke Intel
swift buildand downstream universal (arm64 x86_64) archives even for apps not using those features, since the sources are part of the monolithicFluidAudiotarget. Everything else in the tree was already portable via the established pattern (UInt16-backed pointers + vImagePlanar16Fconversions, as inKokoroAneArraysandANEMemoryUtils); these files skipped it.Changes
Float16Conversionenum (Shared/Float16Conversion.swift) wrappingvImageConvert_Planar16FtoPlanarF/vImageConvert_PlanarFtoPlanar16F; the three files now address half-precision storage asUInt16bit patterns. No arch guards needed, bit-identical results, and the NeuTTS scalar per-element loops become vectorized passes as a side effect.tests.yml:swift build --arch x86_64cross-compile on the arm64 runner, so this regression class fails PR CI instead of surfacing on Intel machines after release.Verification
swift build --arch x86_64on unpatchedmainreproduces every error from the issue verbatim (Paraformer 477/481, LogitsArgmax 35/44, NeuTTS 170/172/230/231).swift build --arch x86_64and native arm64swift buildcomplete cleanly.swift format lintclean on changed files.