Files
VoiceStudio/tests
Palash Debnath e61078fd09 fix(generate): never send a chunk with nothing to say (#1330)
The chunk splitter could end a chunk on a fragment with no speakable
character in it — a lone ".", "—", or "?" left behind by a boundary
landing just past the last word. The engine renders that to nothing, so
the pass was pure waste and, on a slow CPU, a visible stall.

The splitter now folds an unspeakable fragment back into its neighbour.
Where the fold would push the chunk past max_chars it moves a word
across instead of overflowing, and it never borrows a word that is
itself unspeakable (which would just recreate the dead chunk).
Measured on realistic prose: zero dead chunks, zero over-limit chunks.

Adds tests/test_no_unspeakable_chunks_1330.py — fails before, passes
after, and includes a randomised probe asserting any residual overflow
is punctuation-only and bounded.
2026-08-07 01:30:24 +05:30
..