feat(app): expose experimental diarization tuning in Settings (#165 phase 5)#180
Open
pasrom wants to merge 2 commits into
Open
feat(app): expose experimental diarization tuning in Settings (#165 phase 5)#180pasrom wants to merge 2 commits into
pasrom wants to merge 2 commits into
Conversation
Adds 5 new persisted settings (clusterThreshold, warmStartFa, warmStartFb, minSegmentDurationSeconds, excludeOverlap) backed by UserDefaults. Defaults mirror FluidAudio's `Clustering.community` and `Embedding.community`. Introduces a small `OfflineDiarizerTuning` value type so `FluidOfflineProcessor` can be configured without depending on AppSettings or UserDefaults — keeping the diarizer plumbing unit-testable. AppState wires settings into the diarizer factory; resetDiarizerTuning() restores all 5 to defaults in one call and is the source of truth shared with the upcoming Settings UI. Implements phase 5 of #165 (variant C: power-user knobs). Co-authored-by: pasrom <[email protected]>
Adds a collapsed-by-default DisclosureGroup at the bottom of the Diarization section that exposes the 5 OfflineDiarizerConfig tunables behind a red warning banner: cluster threshold, warm-start Fa/Fb, min segment duration, exclude overlap. Each control has an inline help icon with a short tooltip explaining its effect. Includes a "Reset to defaults" button (disabled while settings already match defaults) and a small orange dot next to the disclosure label whenever the user is in non-default territory, so the deviation stays visible even when the disclosure is collapsed. Hidden in Sortformer mode since those knobs only apply to the offline diarizer. Co-authored-by: pasrom <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OfflineDiarizerConfigknobs (clusterThreshold,warmStartFa,warmStartFb,minSegmentDurationSeconds,excludeOverlap).OfflineDiarizerTuningstruct decouplesFluidOfflineProcessorfromAppSettings/UserDefaults so the plumbing is unit-testable.Implements phase 5 of #165 (Variant C: power-user, with safety rails).
Choices worth flagging
diarizerMode == .offline. The 5 knobs are all on the offline pipeline; surfacing them while Sortformer is active would be misleading since they have no effect.settings.diarizerTuningIsAllDefaults(a computedBool) for its disabled state. The same flag drives the orange "non-default" dot.Test plan
AppSettingsround-trip + reset tests (newtestDiarizerTuningDefaults,testDiarizerTuningRoundTrip,testResetDiarizerTuningRestoresDefaults).OfflineDiarizerTuning.defaultsmatches FluidAudio'sClustering.community/Embedding.communityexactly (testTuningStructDefaults).OfflineDiarizerTuning.apply(to:)andFluidOfflineProcessor.makeConfigproduce expected configs without disturbing other knobs.swift testgreen outside the pre-existing flakyMenuBarIconSnapshotTests(also failing on stashedmain)../scripts/lint.shclean.Need help on this PR? Tag
@codesmithwith what you need.