Repository navigation
test(measure): record T5.3 latency and word-start accuracy - #25
Open
prateekchaplot wants to merge 1 commit into
Open
prateekchaplot wants to merge 1 commit into
prateekchaplot wants to merge 1 commit into
Conversation
tests/measure.py starts the real app on an ephemeral port against an isolated data directory and drives generations through the public HTTP API, timing submit, first progress, first sentence, every SSE progress interval, and the completed audio download. It then decodes the WAV and compares each measurable word's reported start with its acoustic onset, counting every excluded or unaligned word instead of dropping it. docs/MEASUREMENTS.md holds the recorded run: 3 texts x 2 voices with the 2,000-character text repeated 3 times, hardware note, raw per-run latency table, NFR-02 and A-3 verdicts, and the manual AC7 listening checklist (pending human review). Results: time-to-first-audio 2,960 ms (lessac) / 3,210 ms (amy) for 1,999 characters; per-sentence SSE p95 191 ms (target < 250 ms); word-start |deviation| p95 15 ms, max 32 ms over 160 measurable onsets, so A-3's +/-100 ms is confirmed and WORD_START_TOLERANCE_MS stays 100.
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.
What this adds
tests/measure.py— starts the real application (create_app) in a backgrounduvicorn thread on an ephemeral port with
TTS_DATA_DIR=.venv/measure-data, then drivesgenerations through the public HTTP API. It records submit, first
progress, firstsentence, every per-sentence
progressinterval, thesucceededevent, and the completedaudio download (the point where the UI can play). It then decodes the returned WAV and
compares each measurable word's reported start with its acoustic onset.
docs/MEASUREMENTS.md— the recorded run, with the hardware note, per-run latencytable, NFR-02 and A-3 verdicts, and the manual AC7 listening checklist.
Results (this machine)
Hardware: 16 logical cores (Intel Family 6 Model 154), 15.8 GiB RAM, Windows 11 build
26300, Python 3.12.2, piper-tts 1.8.0, onnxruntime 1.32.0, CPU inference, single process.
lessac/ 3,210 msamy(first progress at ~90 ms)3 texts (139 / 1,999 / 4,975 chars) × 2 voices, with the 2,000-character text repeated 3
times per voice after one warm-up generation. The app serves the finished WAV, so
time-to-first-audio equals total synthesis time; the first progress event arrives in ~90 ms
and drives the UI while the job runs.
A-3 verdict: confirmed. The ±100 ms word-start tolerance holds with a wide margin, so
tests/e2e/support/env.tskeepsWORD_START_TOLERANCE_MS = 100; no T5.1 change is needed.Honesty about coverage
Only 160 of 3,656 word instances are measurable by signal: 3,168 are excluded because
connected speech leaves no silent gap before the word, and 491 are
aligned=falseby design(FR-05 degraded path). Every exclusion is counted in the report. The automated numbers are a
signal proxy; the manual AC7 listening checklist is still pending human review and lists
8 words (0/25/50/75% through the target text, 4 per voice) to check by ear in the app.
Harness bug found while measuring
Don't convert frame indexes with a nominal 10 ms at 22,050 Hz: 220 samples is 9.977 ms, and
the resulting 0.23% scale error invented a 260 ms "late drift" at 115 s that looked exactly
like a timing defect (it also explained the sentence-4 "A" outlier from the timing-fix PR).
Frame positions now use the exact frame duration, and the drift vanished. This is documented
in the report's Method section so a future reader doesn't re-discover it the hard way.
Verification
python tests/measure.py --runs 3 --out docs/MEASUREMENTS.md(both voices, isolated data dir)pytest tests/unit202 passed;pytest tests/integration16 passedsrc/tts tests(CI scope, includestests/measure.py)git diff --checkDependent tasks: T5.2 consumes these numbers for
docs/KNOWN_LIMITATIONS.md(§14.5 point 4).