Skip to content

fix(app): add KMeans crash recovery for FluidDiarizer#98

Merged
pasrom merged 1 commit intomainfrom
fix/diarizer-kmeans-crash-recovery
Apr 9, 2026
Merged

fix(app): add KMeans crash recovery for FluidDiarizer#98
pasrom merged 1 commit intomainfrom
fix/diarizer-kmeans-crash-recovery

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Apr 9, 2026

Summary

  • Use flexible speaker range (min:1, max:n) instead of exact count to prevent KMeans crash when audio has fewer segments than requested speakers
  • Fall back to auto-detect mode if diarization still fails with the flexible range
  • Extract OfflineDiarizationProcessing protocol for the offline processing step — FluidOfflineProcessor is the production impl, MockOfflineProcessor enables testing retry logic without CoreML models

Inspired by @dagil-nvidia's fork.

Test plan

  • 13 FluidDiarizer tests pass (9 existing + 4 new crash recovery)
  • testRetryWithAutoDetectOnFailure — first call fails, retry with auto-detect succeeds
  • testNoRetryWithoutNumSpeakers — error propagates without retry
  • testNoRetryOnSuccess — no retry when first call succeeds
  • testErrorPropagatesOnRetryFailure — error propagates when both attempts fail
  • Optional: set numSpeakers=10 in Settings, record short meeting, verify log shows auto-detect fallback

@github-actions github-actions bot added the bug Something isn't working label Apr 9, 2026
Use flexible speaker range (min:1, max:n) instead of exact count to
prevent KMeans crash when audio has fewer segments than requested
speakers. Falls back to auto-detect mode if diarization still fails.

Extract OfflineDiarizationProcessing protocol for the offline
processing step. FluidOfflineProcessor is the production impl;
MockOfflineProcessor enables testing retry logic without CoreML models.

Inspired by @dagil-nvidia's fork.
@pasrom pasrom force-pushed the fix/diarizer-kmeans-crash-recovery branch from 7138893 to b7e0513 Compare April 9, 2026 20:20
@pasrom pasrom merged commit dfae782 into main Apr 9, 2026
6 checks passed
@pasrom pasrom deleted the fix/diarizer-kmeans-crash-recovery branch April 9, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant