Skip to content

fix(kws): preserve streaming frames across packet and EOS boundaries - #3656

Merged
LauraGPT merged 1 commit into
mainfrom
codex/kws-stream-continuity-20260907
Sep 7, 2026
Merged

fix(kws): preserve streaming frames across packet and EOS boundaries#3656
LauraGPT merged 1 commit into
mainfrom
codex/kws-stream-continuity-20260907

Conversation

@LauraGPT

@LauraGPT LauraGPT commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve all valid KWS frames across arbitrary packet boundaries, including short input and empty EOS. Nonfinal public calls return [], without marking encoder tail state prematurely.
  • Use canonical frontend and encoder windows; preprocess initial real context through normalization/scaling/positions exactly once. Flush only uncommitted frames at EOS.
  • Avoid sending empty input through real SANM convolutions when zero right context remains.
  • Fix shared WavFrontendOnline EOS for zero valid fbank frames and short final LFR context.
  • Preserve nonfinal internal generate_chunk None and optional output files; clarify the public EOS-only result contract.

Verification

  • Before fix: the initial seven-method regression reported 10 failing subcases and 25 errors; an additional real SANM convolution test reproduced the zero-context EOS crash.
  • Final and exact signed-head CPU runs: 40 tests, 184 subtests passed across KWS plus related frontend/VAD tests.
  • Tests retain actual AutoModel configuration resets, audio frontend, positional encoding, SCAMA overlap and a small real SANM convolution layer. Deterministic context-sensitive windows verify partition consistency.
  • Official iic/speech_sanm_kws_phone-xiaoyun-commands-online weights: all checkpoint keys matched. On the same positive WAV, candidate file/array/960-sample/irregular packets have identical 76x256 encoder-frame hashes and keyword result. Synthetic silence is rejected. The baseline complete-file positive also detects the keyword; scores change, so no accuracy improvement is claimed.
  • Independent source/log review completed; runtime source hashes, logs, audio/weight SHA256s and rollback bundles are retained. Source commit is signed with DCO.
  • Expanded Python 3.11 CPU CI includes all six regression files.

Boundaries

Results remain utterance-final, not per-packet wake events. Accumulated encoded output still grows with utterance length, so callers must send EOS. Direct generate_chunk final calls intentionally include remaining right context. Export wiring is unchanged but export execution was not run. Actual-model evidence is a CPU functional smoke comparison of one positive sample plus synthetic silence, not a natural-negative, accuracy, latency, microphone or GPU benchmark. No PyPI release, website deploy or issue closure is part of this PR.

Signed-off-by: zhifu gao <zhifu.gzf@alibaba-inc.com>
@LauraGPT
LauraGPT merged commit 4035552 into main Sep 7, 2026
1 check passed
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