test: stabilize native audio tail parity - #84
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80100abfde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (Math.abs(localFrequency - expectedFrequency) <= frequencyTolerance) { | ||
| lastValidToneCrossingFrame = crossingFrames[index]; |
There was a problem hiding this comment.
Stop advancing the valid tail marker on mixed-tone windows
When an out-of-band tail starts, the rolling 16-cycle window initially contains mostly valid 997 Hz cycles, so its averaged frequency remains within tolerance and this assignment advances lastValidToneCrossingFrame into the bad tail. For example, a phase-continuous 1008 Hz tail of 1,600 frames reports an approximately 998.45 Hz whole-span frequency and only about 933 trailingWithoutValidToneFrames, passing both parity assertions despite exceeding the 1,073-frame limit; the added 2,000-frame test only passes because the tail is long enough to outlast this transition bias. Require the local window to consist entirely of accepted tone intervals, or otherwise avoid moving the marker past the actual frequency transition.
Useful? React with 👍 / 👎.
Description
Stabilizes the Windows native parity harness's final-audio-window analysis without changing either capture backend.
Motivation
Valid 997 Hz captures could intermittently fail the final 250 ms parity gate. AAC tail padding and short integer-frame crossing windows made the estimator phase- and quantization-sensitive, even though both helpers produced non-zero AAC packets, decodable frames, and retained audio through pause/resume/stop.
This change fixes the test estimator rather than weakening the audio-quality contract. It does not modify the Rust or legacy C++ capture runtime.
Type of Change
Related Issue(s)
Release-candidate validation follow-up; no separate issue.
Screenshots / Video
Not applicable. There is no UI change.
Testing
Scope
No runtime helper, exporter, version, release-note, tag, or release change is included.
Checklist