test(align): pin saturation detection and index-capping behavior - #458
Merged
Conversation
The saturation handling that shipped inside 435e280 (alongside the Sortformer threshold change) had no coverage and its rationale never made it into history. These tests pin both behaviors: - findFirstSaturation flags a word stamped past the audio's end and a plateau run anywhere in the sequence, not only trailing; sub-minSize runs and healthy alignments stay untouched, and saturation at word zero reports index 0 so callers know there is no reliable prefix. - Capping raw classify indices to the audio's addressable range BEFORE LIS correction is what keeps genuine timestamps as anchors: a slow upward drift of impossible indices is itself increasing, so uncapped it wins the anchor competition and drags real timestamps toward garbage. The control assertion reproduces that failure uncapped. Observed in the wild on 8 kHz telephone audio, where the classify head emits confident indices far past the file's end; the aligner returned words at 241.7s on a 222.7s recording before the fix. Tests only; no behavior change. Full ForcedAlignerTests: 43/43.
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.
Adds the missing coverage for the forced-aligner saturation handling that shipped in 435e280 (it landed alongside the Sortformer threshold change, so its rationale never made it into history).
What is pinned
findFirstSaturation: flags words stamped past the audio's end and plateau runs anywhere in the sequence (the old walk only saw trailing plateaus); sub-minSize runs and healthy alignments untouched; saturation at word zero reports index 0.Scope honesty: these changes make the aligner robust (no impossible outputs), not accurate on narrowband audio — on 8 kHz telephone material the classify head's per-word precision remains a model limitation; retraining with narrowband augmentation is the follow-up that would address it.
Regression risk: none — tests only. Full ForcedAlignerTests: 43/43; E2E CoreML fixture unchanged (align avg 216ms, RTF 0.011).