Skip to content
13 min read

Speech is serial: which utterance will your system never say?

A system that talks holds a resource nothing else in your stack holds: it can say exactly one thing at a time, and each thing takes as long as it takes. So it has to decide in advance which utterance it will never say — and we made that decision three different ways in three different systems without noticing it was the same decision.

Vyacheslav Pankratov· Fullstack Developer
Cover art for “Speech is serial: which utterance will your system never say?”
On this page

TL;DR: A system that talks holds a resource nothing else in your stack holds — it can say exactly one thing at a time, and each utterance takes as long as it takes. When it generates speech faster than it can deliver it you have speech queue backpressure with nowhere to put the overflow, so something has to decide which utterance is never said. We made that decision three times in three systems and never noticed it was the same decision. Measured against one burst, the policy that loses nothing is the worst of the three, and the two that do lose things lose the same amount while producing completely different kinds of ignorance.

Every queue you have ever tuned had an escape hatch. A backlog of database writes can be batched. A backlog of HTTP requests can be sharded across more workers. A backlog of video frames can be resolved by dropping frames nobody will consciously miss.

A backlog of speech has none of those. You cannot say two things at once, you cannot say one thing faster without it becoming a different thing, and a listener who is told six facts in a row remembers, at best, the last one. The queue in front of a voice is the only queue in most systems where the resource is strictly serial and the consumer is a human being.

Why a talking system is not a streaming system

The instinct from media work is to reach for the frame-dropping analogy, and it does not transfer.

A video pipeline that falls behind can discard a frame and the viewer's brain fills the gap. The recovery is invisible because the payload is continuous and heavily redundant — each frame is mostly the previous frame. Audio has some of that redundancy at the sample level, which is why a codec can survive loss, but an utterance is not redundant with the utterance before it. "The east door is open" and "the east door is closed" differ in one word and mean opposite things.

So the question is not how to degrade gracefully. It is a scheduling question with a hard constraint: given more things to say than time to say them, which ones are never said, and who decides.

Three policies, and all three are ours

Looking across our own systems, the same decision appears three times, made three different ways, by three different people, none of whom wrote down that they were making it. Two of the three run in production; the third has never been driven, which the FAQ takes up — everything measured below is a measurement of the three POLICIES, which is what the harness reimplements.

Policy Rule Where it came from
unbounded enqueue everything, first in first out, no size bound and no age check a per-language speech chain in a live interpretation service
drop-oldest bounded by size and by age since detection; on overflow, evict the head and log which one died a watcher that speaks alerts over camera feeds
drop-newest high/low watermark with a hysteresis latch; while latched, reject arrivals and keep draining the backlog a browser audio player, applying backpressure from the socket buffer

The third is worth a note, because a hysteresis latch is not a threshold. A plain threshold flaps: it rejects one item, the queue drops below the mark, it accepts, it is over again. The latch sets at a high mark and does not release until the backlog has fallen to a low one, so rejection comes in episodes rather than in single items. That detail turns out to decide everything about what the listener experiences, and nobody chose it for that reason.

What we measured

We reimplemented the three policies in one process and ran them against one identical workload: forty utterances detected 25 ms apart — a burst — against a speaker that takes 150 ms to say each one. The backlog is guaranteed by construction, so the policy is the only variable. Five trials each.

The reported quantity is staleness: spoken_at − detected_at, how old the news was when the listener finally heard it. Not latency. An alert delivered eleven seconds late is not a slow alert; it is an alert about the past, competing for attention with the present.

Policy delivered of 40 mean staleness worst staleness
unbounded 40 2,446.2 ms 4,889.5 ms
drop-oldest 10 109.2 ms 381.3 ms
drop-newest 12 436.4 ms 682.9 ms

Quoted to the decimal results.txt prints, so the comparison is literal rather than rounded. The last digit is scheduler noise and moves on a re-run — the arrival schedule is deterministic and the service time is a sleep, so the spread across the five trials is the floor below which no difference between policies means anything. Nothing in the argument turns on it: the gap is twenty-fold.

The arm that loses nothing is the worst arm

“Bound your queues” is the wrong lesson to leave with. The unbounded policy delivered all forty utterances and delivered them up to 4.9 seconds late — on the only metric a listener has, it lost to both bounded arms by more than twenty times. Losing nothing is not a virtue in a serial resource; it just moves the whole cost into staleness, where nobody is counting it.

Why doesn't the queue that drops nothing win?

Because it converts a loss problem into a truth problem, and the second one is worse.

The unbounded arm delivers every single utterance. It is also, on average, two and a half seconds behind, finishing nearly five seconds behind. Every word it says is correct and describes a world that has moved on. A listener has no way to tell a current statement from a stale one — they arrive in the same voice, in order, with no gap to mark the difference.

This is the same shape network engineers named a decade ago. A queue that never drains does not improve throughput; it adds delay and nothing else, and RFC 8289 calls the result a standing queue — a backlog that persists rather than absorbing a burst, so every arrival inherits the delay of everything ahead of it. The fix there is to drop deliberately rather than to buffer indefinitely, and the argument transfers exactly: the queue that refuses to lose anything is the one that guarantees everything is late.

And in our case it is worse than slow, because of a defect we found while writing this up. The unbounded chain returns nothing on any synthesis exception, not only on a rejected input — so one transient failure from the speech vendor becomes a sequence of retries inside a strictly serial queue, each waiting its turn. The policy that cannot shed load is also the one that turns a blip into an amplifier.

  • drop-oldest
  • drop-newest
Forty utterances, 25 ms apart, against a 150 ms speaker. Both bounded policies discarded roughly three quarters of them — drop-oldest keeps a thin, evenly spaced thread that is never more than 55 ms old until the burst ends; drop-newest keeps three complete episodes, each degrading as it drains. Same amount lost, different kind of ignorance. From rig/speechqueue/results.txt, trial 1.

Sampling or episodes: what the bounded policies actually do

Here is the finding, and it is not "bounded is better".

The two bounded policies lose almost exactly the same amount — thirty of forty against twenty-eight of forty. What differs is which ones, and the shape of the answer is not a matter of degree. These are the utterances each one actually spoke, out of the burst numbered 1 to 40:

Policy what the listener heard
drop-oldest 1, 5, 11, 17, 23, 29, 35, 38, 39, 40
drop-newest 1, 2, 3, 4, 5, 6 · 20, 21, 22 · 38, 39, 40

Those are not one lucky trial. Both sets came back byte-identical in all five runs, which the harness now prints beside them, because a delivered set quoted from a single trial would be the same mistake as a mean quoted from three — and this corpus has made that one already.

drop-oldest samples. It speaks roughly every sixth utterance, evenly spread across the whole event, and it is never more than a few hundred milliseconds behind. The listener gets a thin, continuous, current thread — and never a complete account of anything.

drop-newest delivers episodes. Contiguous runs separated by holes: the first six, silence, three more, silence, the last three. That is the hysteresis latch's signature — set, drain to the low watermark, accept a short run, latch again. The listener gets complete little stories about scattered moments, and no indication that the gaps exist.

Neither is more lossy. They produce different kinds of ignorance, and which one you want is a property of your domain rather than of your queue:

  • If the utterances describe a state that changes — a door, a temperature, a queue depth — you want the sample. Knowing the current value thinly beats knowing an old value completely.
  • If they describe discrete events that must be understood individually — a transaction, a person, a failure with a cause — you want the episodes. Half a story about six things is worse than a whole story about two.

Nobody in our three systems made that choice on those grounds. Each one bounded its queue the way its author happened to think about backlogs, and the kind of ignorance it produced was a side effect.

What we predicted, and what the run refuted

The prediction for this experiment was written and committed on its own, before the harness existed — a changeset containing one file and no code, which is checkable rather than asserted. It made five predictions and flagged the third as the one most likely to fail. The third failed.

Predicted: the two bounded policies would lose disjoint sets from opposite ends — drop-oldest losing the start of the burst, drop-newest losing the end.

Measured: they overlap heavily, and neither loses from an "end". Both deliver the first utterance and the last three; the difference is entirely in the middle, and it is structural rather than positional. Sampling versus episodes is a better finding than the one we guessed, and it could not have been reasoned out from the policy descriptions — which is the argument for running the thing rather than thinking about it.

Here is the whole ledger, by the numbers the file itself uses, because a prediction register you report selectively is a press release:

# Predicted Outcome
1 unbounded delivers everything, staleness grows without bound, last one stale by (K−1) × service held, formula corrected — 40 of 40 and unbounded growth, but the last was stale by 4.9 s against 5.9 s predicted
2 both bounded arms cap staleness near bound × service held — 381.3 ms against 450, 682.9 ms against 750
3 the bounded arms lose disjoint sets from opposite ends REFUTED — they overlap, and neither loses from an end
4 the age bound is not decorative REFUTED — see the next section
5 unbounded is the worst arm under a burst held — by a factor of twenty-two on mean staleness

Two of five failed, not one. Prediction 1's formula was wrong because arrivals and speaking overlap: the speaker is already working through the backlog while the burst is still arriving, so fewer utterances are waiting than the arithmetic assumed. The shape was right and the magnitude was not, which is a correction rather than a refutation — and the distinction is only worth making if the outright failures are named as failures, which is what the next section is for.

The second failure: the bound that never fired

drop-oldest is configured with two bounds: a size limit and a maximum age since detection. The harness records why each utterance was dropped.

All thirty of its drops were size evictions. Not one expiry.

That is prediction 4 falling, by the exact condition the prediction wrote for itself before the harness existed — "falsified if removing the age check changes nothing about which utterances arrive" — and the sentence it used for the failure case was written then, not now: "if the age check never fires, it is a ring buffer wearing a second parameter." Under this workload that is what it is.

Note what does not establish this, because the obvious argument is invalid: the worst staleness delivered was 381.3 ms against a 2,000 ms bound, and that proves nothing either way. An age check drops on the way out, so a firing check would also produce a low delivered maximum — it would have removed the old ones before they were counted. The evidence is the drop reasons, not the delivered distribution. What the size arithmetic does explain is why nothing got old enough: a bound of three against 150 ms of speaking caps the wait near 450 ms, which is a fifth of the way to the age limit.

The case the age bound exists for is the opposite of a burst: a trickle, where the queue is short enough that the size bound stays slack while its contents quietly go stale. We did not test that, so we are not going to tell you the age bound works. What we can say is narrower and more useful: a bound you have never seen fire is a hypothesis, and the workload that would exercise it is the one you have not run.

FAQ

Which policy should I use? The question has no answer without your domain. If your utterances describe a changing state, sample it; if they describe discrete events that must be understood whole, take the episodes. What you should not do is inherit a policy by accident, which is what all three of ours did.

Isn't the real fix to make the speech faster? It moves the threshold and does not remove it. Halving the service time doubles the burst you can absorb, and the burst that arrives twice as fast puts you back where you started. Serial is serial: the only way out is to decide what is not said, or to stop generating utterances you would not choose to hear.

Can I not just prioritise instead of dropping? Yes, and it is the same decision wearing better clothes. A priority queue still has to discard something when it is full; it just discards by importance instead of by arrival. Everything in this article applies to what it discards — including that a priority scheme with an unbounded queue is still an unbounded queue, and will still be five seconds late while being perfectly correct about what mattered most.

How far do these numbers travel? Not far, and deliberately. The arrival shape was chosen rather than observed — we have no recorded distribution of real alert arrivals — and "speaking" in the harness is a timer rather than a speech engine. The ordering of the three policies is robust; the milliseconds are a property of this workload and these bounds.

One of these systems has never run in production, hasn't it? Yes, and it is the drop-oldest one. Its queue, its ageing policy, its metrics and its drop-and-log path are real code with tests, and nothing has ever produced its events — the component that would is not built. Everything above is a measurement of its policy, which is what we reimplemented. Nothing here is a claim about how it behaved in the field, because it has never been in the field.

Three things worth taking away

  1. A talking system makes a decision that most queues do not, and it usually makes it by accident. Which utterance is never said is a product decision, and it ends up encoded in a size constant somebody picked while thinking about memory.
  2. The queue that drops nothing is not the safe choice. It trades a loss you could have designed for a staleness you cannot detect, and it is the arm that turns one transient vendor failure into a serial retry storm.
  3. Losing the same amount is not losing the same thing. Sampling and episodes are opposite answers to "what kind of incomplete knowledge do you want?" — and the policy that produced the answer probably never considered the question.

If a system of yours talks and you cannot say which utterance it will never deliver, that is a cheap thing to find out.

Was this helpful?

// Build it

Running this in production?

Audio has no idle — silence is something you generate, a 20 ms hole is audible, and anything that talks must choose what it will never say. Tell us where the sound goes wrong; we reply within a day with a concrete next step.