fix(canary): prevent repeated streamed overlap in #375 - #376
Conversation
|
Reviewed with a live reproduction, which is the thing this PR says it still Reproduction
Both halves of #375 are present: "sentences are interrupted" and What this PR does to itThe entire effect across 132 s is two deleted tokens: It removes So on the only end-to-end evidence available, the PR converts one visible defect The mechanism it declines to use already fixes this
That is not a coincidence: the fuzzy matcher's own comment describes this exact Two more concerns with the approachIt reintroduces the thing that was already measured as harmful. The comment
On the diagnosis"The only Canary change in the window is 73bb9b2" is true, but it is a For what it's worth I think the causal story is still plausible in one direction: Suggested path
|
|
Correcting my own review above — its central evidence was invalid, and the I claimed " Byte-identical — including all three artifacts I quoted ( Repeated on 594 s of natural German long-form ( Also byte-identical. What this means for the PRMy measured objections to the implementation still hold on their own terms — The real problem is the same for the PR and for my review: nobody has I've asked the reporter for what's needed on #375. Until that lands I'd hold this. What is still solid
|
Two long-form probes across the reporter's exact bisect endpoints produce byte-identical output, so neither PR #376 nor my review of it was measured against the actual regression. Records what is ruled out by measurement (ggml pointer identical at both endpoints; 73bb9b2 changes nothing on either probe; generation_health is test-only), what was never examined (six audio-input commits in the same window — start there if the reporter's audio is compressed), and the trap that cost two attempts: a file-path-scoped search cannot see cross-cutting changes, and I treated a symptom on main as the regression without diffing it against the good commit on the same file. Also records the pre-existing seam defect found on the way — real, reproducible, present on BOTH endpoints, and deserving its own issue rather than being folded into #375.
…tifacts gone The long-form path was parakeet machinery wearing a canary comment: 8 s chunks / 2 s overlap over a globally-normalized mel, merged by an LCS prefix-drop + word-snap + splice-punctuation heuristics. The comment cited NeMo's FrameBatchMultiTaskAED, which actually joins NON-overlapping chunks with " ".join — and canary-1b-v2's shipped `.transcribe()` does something else again: dynamic 30..40 s RAW-WAVEFORM chunks (size chosen to maximize the last chunk), 1 s overlap, per-chunk PerFeatureZ normalization, and lcs_alignment_merge_buffer (search the last 24 buffer tokens against the next chunk's first 7, keep the matched acoustic event once, trim BOTH sides). Audio within one 40 s chunk is a single pass. This ports that blueprint exactly: - core/canary_chunk_merge.h: longest_common_subsequence_merge + _find_optimal_chunk_size, header-only; tests/test-canary-chunk-merge.cpp pins both against vectors generated from the nemo 2.7.3 Python functions (58 assertions), so the port is validated cross- implementation, not against itself. - canary_transcribe_streamed: blueprint chunking + merge; single detokenize + word rebuild at the end. The old path survives verbatim behind CRISPASR_CANARY_LEGACY_STREAM=1 as the bisection arm (CRISPASR_CANARY_SEAM_DEDUP only applies there). - CLI adapter and session C-ABI both route through the library (the session previously single-passed ALL audio; >40 s single-pass EOSes early — a 59 s file lost everything past ~45 s). Measured (canary-1b-v2-q4_k, CPU): - jfk_x12.wav (the JFK quote x12, 132 s): 12 clean identical repetitions. Legacy gate reproduces "ask not Ask not" x2, "you can do. for your country" x2, "for yourself. your country" x2 on the same binary. - de/fleurs_600s.wav (594 s): zero repeated 2/3/4-grams in 925 words; the "not in time order" warnings drop from per-seam to one 0.36 s cue overlap. - de/fleurs_60s.wav: "T-Rex war. T-Rex war", "der der", "Frauen. Frauen" all gone. Closes the seam-artifact thread from #365/#375 (PR #376 closed — superseded by fixing the blueprint mismatch at the root). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What changed
Canary streamed decoding now removes a conservative multi-token prefix when its token end times are already covered by the previous chunk. This catches reworded overlap that token-ID LCS cannot match, without enabling the broader fuzzy seam dedup or reverting the 73bb9b2 scheduler UAF fix. Single early tokens remain untouched.
Validation
cmake --build /tmp/crispasr-build-375b --target test-asr-overlap-trim canary -j2test-asr-overlap-trim(19 assertions, 8 cases)The reporter did not attach audio/model details, so live reproduction on the HP Z800 input is still needed.