Skip to content

fix(diarizer/offline): warn on macOS 14 BNNS-crash-prone builds + document known OS issue (#878) - #885

Open
Alex-Wengg wants to merge 1 commit into
mainfrom
fix/878-offline-diarizer-macos14-bnns-advisory
Open

fix(diarizer/offline): warn on macOS 14 BNNS-crash-prone builds + document known OS issue (#878)#885
Alex-Wengg wants to merge 1 commit into
mainfrom
fix/878-offline-diarizer-macos14-bnns-advisory

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Library-side portion of #878 (the #661/#817 BNNS crash family).

Context

@JulianPscheid's CI matrix in #878 proves the offline diarizer libBNNS crash (EXC_BAD_ACCESS in BNNSGraphContextExecute_v2_platform_memmove) is an Apple OS bug in the macOS 14 line:

  • macos-14 (14.8.7): 1200/1200 crashes — every variant (unpatched v0.15.5, Core ML-owned FBank storage, fully serialized single-model runs), 211 matching .ips artifacts.
  • macos-15 (15.7.7) and macos-26 (26.5.2): 0 crashes, same code, sha256-pinned audio. Comparison run twice.
  • On VMs without an ANE every prediction takes the BNNS CPU path, so the crash is deterministic there; on Apple Silicon only ANE-fallback predictions hit BNNS, which is why it looks intermittent in the field.
  • The serialization proposed in Concurrent SlidingWindowAsrManager + DiarizerManager prediction corrupts shared E5RT/BNNS state (EXC_BAD_ACCESS in libBNNS) on Apple Silicon #661 does not help: single-threaded, single-model runs still crash on macOS 14.

Changes

Since no library-side mitigation exists, the honest fix is diagnosis — same approach as #818 took for the (distinct) 26.4–26.5 Kokoro BNNS bug:

  • OfflineDiarizerManager.initialize(models:) logs a warning on macOS 14 builds pointing at Offline diarizer BNNS crash (#661 family) reproduces deterministically on macOS 14; absent on 15 and 26 #878, so field crashes get attributed to the OS instead of usage patterns or FluidAudio versions. Predicate extracted as isBnnsCrashProneOS(_:onMacOS:) for testability. iOS is unflagged — no reproduction has been reported on the iOS 17 line.
  • OfflineDiarizerOsAdvisoryTests — boundary coverage (13.6 ✗ / 14.0 ✓ / 14.8.7 ✓ / 15.0 ✗ / 26.5.2 ✗; iOS unflagged).
  • Documentation/Diarization/GettingStarted.md — "Known OS issue" note in the Offline VBx section: macOS 14 can crash in BNNS regardless of usage pattern, fixed by updating to macOS 15+; explicitly distinguished from the Kokoro 26.4–26.5 class in KokoroAne.md.
  • Cross-ref comment at the FBank .cpuOnly pin (OfflineDiarizerModels.swift), which is why the diarizer is the component that surfaces this on macOS 14.

Deliberately not changed: FBank routing on macOS 14. The matrix shows every compute-unit configuration crashes there, so a placement tweak would be an unverifiable non-fix; if we want to test whether .cpuAndGPU FBank reduces exposure on real hardware, the reporter's workflow_dispatch harness can take a revision input.

Verification

  • swift build green, swift format lint clean on touched files.
  • Advisory tests run in CI (XCTest unavailable locally).

Closes nothing on its own — #878 disposition (close as OS bug vs. keep open for Apple Feedback tracking) is up for discussion.

🤖 Generated with Claude Code

…ument known OS issue (#878)

Library-side portion of #878 (follow-up to #661/#817 family).

JulianPscheid's CI matrix proved the offline diarizer libBNNS crash
(EXC_BAD_ACCESS in BNNSGraphContextExecute_v2 -> _platform_memmove) is
an Apple OS bug in the macOS 14 line: 1200/1200 crashes on macos-14
runners across every variant (unpatched v0.15.5, Core ML-owned FBank
storage, fully serialized single-model runs), 0/N on macos-15 and
macos-26. On VMs without an ANE every prediction takes the BNNS CPU
path, making the crash deterministic; on Apple Silicon it is
intermittent because only ANE-fallback predictions hit BNNS. No
serialization or compute-unit routing avoids it; Apple fixed it in
macOS 15.

Since no library-side mitigation exists, the honest fix is diagnosis
(same approach as #818 for the separate 26.4-26.5 Kokoro BNNS bug):

- OfflineDiarizerManager.initialize(models:) warns on macOS 14 builds
  pointing at #878, so field crashes get attributed to the OS instead
  of usage patterns or FluidAudio versions. Predicate extracted as
  isBnnsCrashProneOS(_:onMacOS:) for testability; iOS is unflagged
  since no reproduction has been reported on the iOS 17 line.
- OfflineDiarizerOsAdvisoryTests: boundary coverage (13.6 / 14.0 /
  14.8.7 / 15.0 / 26.5.2, iOS unflagged).
- Documentation/Diarization/GettingStarted.md: Known OS issue note in
  the Offline VBx section, distinguishing this bug from the Kokoro
  26.4-26.5 class.
- Cross-ref comment at the FBank .cpuOnly pin, which is why the
  diarizer is the component that surfaces this on macOS 14.

swift build green; swift format lint clean on touched files. Tests run
in CI (XCTest unavailable locally).
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

PocketTTS Smoke Test ✅

Check Result
Build
Model download
Model load
Synthesis pipeline
Output WAV ✅ (146.3 KB)

Runtime: 0m20s

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.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Supertonic3 Smoke Test ✅

Check Result
Build
Model download (incl. VectorEstimatorVariants/ int4 buckets)
Model load
Synthesis pipeline (--ve-variant int4)
Output WAV ✅ (364.7 KB)

Runtime: 0m32s

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.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Parakeet EOU Benchmark Results ✅

Status: Benchmark passed
Chunk Size: 320ms
Files Tested: 100/100

Performance Metrics

Metric Value Description
WER (Avg) 7.03% Average Word Error Rate
WER (Med) 4.17% Median Word Error Rate
RTFx 8.98x Real-time factor (higher = faster)
Total Audio 470.6s Total audio duration processed
Total Time 55.5s Total processing time

Streaming Metrics

Metric Value Description
Avg Chunk Time 0.056s Average chunk processing time
Max Chunk Time 0.111s Maximum chunk processing time
EOU Detections 0 Total End-of-Utterance detections

Test runtime: 1m35s • 08/31/2026, 11:26 PM EST

RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Speaker Diarization Benchmark Results

Speaker Diarization Performance

Evaluating "who spoke when" detection accuracy

Metric Value Target Status Description
DER 15.1% <30% Diarization Error Rate (lower is better)
JER 24.9% <25% Jaccard Error Rate
RTFx 26.08x >1.0x Real-Time Factor (higher is faster)

Diarization Pipeline Timing Breakdown

Time spent in each stage of speaker diarization

Stage Time (s) % Description
Model Download 13.039 32.4 Fetching diarization models
Model Compile 5.588 13.9 CoreML compilation
Audio Load 0.055 0.1 Loading audio file
Segmentation 12.067 30.0 Detecting speech regions
Embedding 20.111 50.0 Extracting speaker voices
Clustering 8.045 20.0 Grouping same speakers
Total 40.234 100 Full pipeline

Speaker Diarization Research Comparison

Research baselines typically achieve 18-30% DER on standard datasets

Method DER Notes
FluidAudio 15.1% On-device CoreML
Research baseline 18-30% Standard dataset performance

Note: RTFx shown above is from GitHub Actions runner. On Apple Silicon with ANE:

  • M2 MacBook Air (2022): Runs at 150 RTFx real-time
  • Performance scales with Apple Neural Engine capabilities

🎯 Speaker Diarization Test • AMI Corpus ES2004a • 1049.0s meeting audio • 40.2s diarization time • Test runtime: 3m 6s • 08/31/2026, 11:29 PM EST

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Offline VBx Pipeline Results

Speaker Diarization Performance (VBx Batch Mode)

Optimal clustering with Hungarian algorithm for maximum accuracy

Metric Value Target Status Description
DER 10.4% <20% Diarization Error Rate (lower is better)
RTFx 10.24x >1.0x Real-Time Factor (higher is faster)

Offline VBx Pipeline Timing Breakdown

Time spent in each stage of batch diarization

Stage Time (s) % Description
Model Download 22.510 22.0 Fetching diarization models
Model Compile 9.647 9.4 CoreML compilation
Audio Load 0.084 0.1 Loading audio file
Segmentation 28.199 27.5 VAD + speech detection
Embedding 102.082 99.6 Speaker embedding extraction
Clustering (VBx) 0.145 0.1 Hungarian algorithm + VBx clustering
Total 102.477 100 Full VBx pipeline

Speaker Diarization Research Comparison

Offline VBx achieves competitive accuracy with batch processing

Method DER Mode Description
FluidAudio (Offline) 10.4% VBx Batch On-device CoreML with optimal clustering
FluidAudio (Streaming) 17.7% Chunk-based First-occurrence speaker mapping
Research baseline 18-30% Various Standard dataset performance

Pipeline Details:

  • Mode: Offline VBx with Hungarian algorithm for optimal speaker-to-cluster assignment
  • Segmentation: VAD-based voice activity detection
  • Embeddings: WeSpeaker-compatible speaker embeddings
  • Clustering: PowerSet with VBx refinement
  • Accuracy: Higher than streaming due to optimal post-hoc mapping

🎯 Offline VBx Test • AMI Corpus ES2004a • 1049.0s meeting audio • 130.4s processing • Test runtime: 2m 24s • 08/31/2026, 11:34 PM EST

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Sortformer High-Latency Benchmark Results

ES2004a Performance (30.4s latency config)

Metric Value Target Status
DER 30.3% <35%
Miss Rate 28.2% - -
False Alarm 0.9% - -
Speaker Error 1.2% - -
RTFx 19.4x >1.0x
Speakers 4/4 - -

Sortformer High-Latency • ES2004a • Runtime: 5m 16s • 2026-09-01T03:35:46.995Z

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

VAD Benchmark Results

Performance Comparison

Dataset Accuracy Precision Recall F1-Score RTFx Files
MUSAN 94.0% 89.3% 100.0% 94.3% 554.8x faster 50
VOiCES 94.0% 89.3% 100.0% 94.3% 490.3x faster 50

Dataset Details

  • MUSAN: Music, Speech, and Noise dataset - standard VAD evaluation
  • VOiCES: Voices Obscured in Complex Environmental Settings - tests robustness in real-world conditions

✅: Average F1-Score above 70%

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

ASR Benchmark Results ✅

Status: All benchmarks passed

Parakeet v3 (multilingual)

Dataset WER Avg WER Med RTFx Status
test-clean 0.57% 0.00% 4.31x
test-other 1.19% 0.00% 3.05x

Parakeet v2 (English-optimized)

Dataset WER Avg WER Med RTFx Status
test-clean 0.80% 0.00% 5.16x
test-other 1.00% 0.00% 3.10x

Streaming (v3)

Metric Value Description
WER 0.00% Word Error Rate in streaming mode
RTFx 0.58x Streaming real-time factor
Avg Chunk Time 1.527s Average time to process each chunk
Max Chunk Time 1.849s Maximum chunk processing time
First Token 1.835s Latency to first transcription token
Total Chunks 31 Number of chunks processed

Streaming (v2)

Metric Value Description
WER 0.00% Word Error Rate in streaming mode
RTFx 0.52x Streaming real-time factor
Avg Chunk Time 1.729s Average time to process each chunk
Max Chunk Time 2.046s Maximum chunk processing time
First Token 1.768s Latency to first transcription token
Total Chunks 31 Number of chunks processed

Streaming tests use 5 files with 0.5s chunks to simulate real-time audio streaming

25 files per dataset • Test runtime: 11m8s • 08/31/2026, 11:43 PM EST

RTFx = Real-Time Factor (higher is better) • Calculated as: Total audio duration ÷ Total processing time
Processing time includes: Model inference on Apple Neural Engine, audio preprocessing, state resets between files, token-to-text conversion, and file I/O
Example: RTFx of 2.0x means 10 seconds of audio processed in 5 seconds (2x faster than real-time)

Expected RTFx Performance on Physical M1 Hardware:

• M1 Mac: ~28x (clean), ~25x (other)
• CI shows ~0.5-3x due to virtualization limitations

Testing methodology follows HuggingFace Open ASR Leaderboard

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