fix(vocab): make alignBaseWordsToUTF8Ranges iterative (#961) - #962
Conversation
The exact-alignment search recursed once per base word and passed `ranges + [match]` down each level, so stack depth was linear and live memory quadratic in transcript length. ctcTokenEvaluateCandidates SIGBUSed inside Swift concurrency tasks at ~1-2k words (512 KB stacks), and each level also scanned to the end of the text looking for a second alignment, making time quadratic too. Rewrite as explicit-stack backtracking over a single shared path: - a word can only start inside the delimiter run after the cursor, so candidates per level are those positions, probed with an anchored literal match instead of an unbounded forward search - (wordIndex, cursor) states that produced no complete alignment are memoized, bounding pathological delimiter-only words - uniqueness semantics unchanged: 0 or >=2 alignments -> all nil Differential check against the old recursive implementation: 0 mismatches over 200k randomized texts (quotes, C++, combining marks, repeated words, delimiter-only tokens). 50k words align in 21 ms inside a detached Task; the old code SIGBUSes at 1k in the same harness.
Supertonic3 Smoke Test ✅
Runtime: 0m35s 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. |
PocketTTS Smoke Test ✅
Runtime: 0m27s 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: 2m30s • 09/25/2026, 12:14 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
Sortformer High-Latency Benchmark ResultsES2004a Performance (30.4s latency config)
Sortformer High-Latency • ES2004a • Runtime: 3m 31s • 2026-09-25T16:15:31.778Z |
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 • 142.7s processing • Test runtime: 2m 37s • 09/25/2026, 12:15 PM EST |
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 • 39.4s diarization time • Test runtime: 3m 0s • 09/25/2026, 12:22 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: 9m45s • 09/25/2026, 12:33 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 |
Fixes #961.
alignBaseWordsToUTF8Rangesrecursed once per base word and copied the path at each level, soctcTokenEvaluateCandidatesSIGBUSed inside Swift concurrency tasks at ~1–2k words (linear depth, quadratic memory, quadratic time).Fix
(wordIndex, cursor)states that yielded no alignmentnil)Verification
Task; old code SIGBUSes at 1k in the same harnessTask.detached, plus fail-closed on a truncated word list🤖 Generated with Claude Code