Repository navigation
test(engine): stabilize rate duration ratio integration check - #12
Merged
Merged
Conversation
Piper 1.8's duration predictor is stochastic and sublinear, so the nominal 0.8x ratio for rate 1.25 is never reached: a 3-run mean measured 0.814-0.913 against a [0.72, 0.88] band, failing about 40% of the time regardless of the code under test. Average 7 runs per rate to tighten the estimate to 0.855-0.896 and assert a clearly audible speed-up against the measured [0.78, 0.93] band.
prateekchaplot
added a commit
that referenced
this pull request
Nov 20, 2026
Record PR #12 on branch fix/integration-rate-flake as the separate maintenance fix for the pre-existing stochastic duration-predictor flake.
prateekchaplot
added a commit
that referenced
this pull request
Nov 20, 2026
* feat(history): complete dal delete and eviction consistency - delete the row before its audio file so a failure in between can never leave a row referencing a missing file (ARCHITECTURE 7.7) - refuse to delete in-flight generations via ActiveGenerationError - defer and retry file removals the OS refuses (Windows file locks) - guarantee strictly increasing created_at so history and eviction order follow insertion order - enforce the 8.2 settings key set and add seed_settings for lazy seeding * chore(tasks): record t1.5 progress and decisions Track T1.5 on branch arch/tts/t1.5 (Doing until the PR is merged), drop the finished T1.4/T1.5 rows from Remaining, and record the ordering, deletion, and settings decisions plus their downstream contracts for T1.6, T2.2, and T2.3. * chore(tasks): link the rate ratio flake fix pull request Record PR #12 on branch fix/integration-rate-flake as the separate maintenance fix for the pre-existing stochastic duration-predictor flake.
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.
Fixes the flaky
test_rate_scales_duration_within_ten_percentintegration check.Problem
The check asserts that rate 1.25 produces audio ~0.8x as long as rate 1.0, using a 3-run mean and a
[0.72, 0.88]band. Piper 1.8's duration predictor is stochastic and sublinear, so the nominal 0.8x is never reached:The band cut through the middle of the observed distribution, so the check failed roughly 40% of the time regardless of the code under test.
onnxruntime.set_seed()does not make the predictor deterministic — each run still differs — so the randomness cannot be pinned from the test side.Fix
[0.78, 0.93], centred on the measured 0.87 and documenting it in the test comment.The check still asserts what the task actually needs — that the rate setting has a clearly audible effect — and still fails if the mapping breaks (no speed-up gives ~1.0; an inverted or extreme mapping falls outside the band). The
rate -> length_scale = 1/ratemapping itself is already pinned by the unit testtest_maps_rate_and_volume_to_synthesis_config.Verification
pytest tests/integration/test_piper_engine.py::test_rate_scales_duration_within_ten_percent— 10/10 passed (was 6/10)pytest tests/integration— 6 passed, three consecutive runspytest tests/unit— 87 passedruff check src/tts tests,ruff format --check src/tts tests,mypy --strict src/tts,git diff --check— cleanThis is a maintenance fix outside the §14 task breakdown; it only touches the integration test that T1.2 introduced. T5.3 still measures the real rate/duration scaling before the numbers are documented.