Skip to content

fix(examples): qualify judged STT phrases at the agent's speech onset - #626

Merged
akirilyuk merged 3 commits into
mainfrom
fix/barge-onset-phase-qualification
Nov 25, 2026
Merged

akirilyuk merged 3 commits into
mainfrom
fix/barge-onset-phase-qualification

Conversation

@akirilyuk

Copy link
Copy Markdown
Owner

Why

The 0.23.1 release gate failed at the adaptive-VAD barge-in step: the barge phrase "excuse me please" was not recognized. Replaying the captured audio offline reproduces the miss deterministically. The sender audio is clean.

The cause is the phrase qualification sweep. It always put the speech onset 300 ms into a fresh recognizer stream. The live agent pads its STT pre-roll to capacity (drain_padded_to_capacity, 700-750 ms), so speech starts about 450-650 ms in. The kroko streaming model's first-word reading depends on where the onset falls on its ~1.28 s partial grid. At the agent's onset "excuse me please" misses about 0.5-1% of syntheses; at 300 ms it was clean.

What changed

  • phrase_sweep --lead-range-ms agent: a seeded lead per synthesis across AGENT_ONSET_RANGE_MS (450-650 ms). The result records leadRangeMs and leadSeed.
  • Every phrase the gate judges in clean scenes is requalified at n=3000 in that range (seed 20261125). Two failed and are replaced:
    • barge-in scenes: "excuse me please" → "sorry I have a question" (3000/3000, min similarity 1.0)
    • third judged concurrent leg: "victor seven eight nine" (keyword missing 1/3000) → "golf sixteen seventeen eighteen" (3000/3000)
  • The qualification guard (stt-phrase-qualification.test.ts) fails when a judged clean record lacks the agent onset range or a seed. It reads the range from phrase_sweep.rs, so the two stay in lockstep. Babble records are unchanged.
  • The noisy-bystander scene still uses both old phrases through its pre-generated speaker fixtures. Swapping those needs regenerated fixtures and is left for a separate change.

Verification

start:roundtrip-barge-in ran 20 times with the default VAD and 20 times with SHERPA_VAD_PROVIDER=adaptive: 40/40 green.

Verified locally and via CI; no extra manual steps.

phrase_sweep --lead-range-ms agent draws a seeded lead per synthesis in
AGENT_ONSET_RANGE_MS (450-650 ms), where the live agent's STT stream puts
the speech onset after drain_padded_to_capacity pads the pre-roll. The
fixed 300 ms lead never covered that position. The result JSON records
leadRangeMs and leadSeed.
…place two

With the onset at 450-650 ms, "excuse me please" missed about 0.5-1% of
syntheses, which failed the adaptive-VAD barge-in step of the release gate.
The barge-in scenes now use "sorry I have a question" (3000/3000 clean).
"victor seven eight nine" lost its keyword once in 3000, so the third
judged concurrent leg is now "golf sixteen seventeen eighteen" (3000/3000).

Every judged clean phrase is requalified at n=3000 in that range
(seed 20261125). The qualification guard fails a judged clean record
without the agent onset range and a seed.
… fix docs

Extract onsetQualificationDefect and use it in the judged-phrase loop, so
the refusal test exercises the same check (legacy, 300 ms and seedless
records). README and ROUNDTRIP.md name the new barge phrase and the
onset-range clean sweep; S3 caller phrases stay babble-qualified. The
phrase_sweep doc points at stt_pre_roll.rs for drain_padded_to_capacity.
@akirilyuk
akirilyuk merged commit df4d7e0 into main Nov 25, 2026
9 checks passed
@akirilyuk
akirilyuk deleted the fix/barge-onset-phase-qualification branch November 25, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant