Fix chunk fbank fallback on current runtime - #24
Conversation
…sent compute_chunk_fbank treated 'chunk fits in the 30s model' and 'the 30s model exists' as one condition: for chunk_audio.len() <= 480_000 with fbank_30s == None it fell through to the end of the function and returned the all-zero tensor it had allocated, producing silently wrong embeddings rather than an error. orchestrate.rs already handles this correctly by falling back to the 10s model. Route both call sites through a pure select_fbank_path helper so the choice is explicit and unit-testable.
Port the short-chunk fallback onto current CoreML tensor validation and normalization-scope handling. Return an invariant error when no compatible fbank model is available.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe chunk fbank pipeline now selects an available model explicitly. It returns errors when no compatible model or a selected model is unavailable. Tests cover model selection and fallback behavior. ChangesChunk fbank model selection
Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR corrects CoreML filter-bank model selection so compatible short-model inference is used instead of silently retaining zero-filled features, while preserving normalization and tensor-shape behavior. It also updates the locked Rustls stack to address the identified advisory.
Confidence Score: 5/5The PR appears safe to merge; no outstanding correctness, security, or repository-rule issue was identified. The fallback selection preserves the established 10-second model geometry, bounds copied output to the allocated frame capacity, and returns an explicit error when no compatible model exists. The subsequent lockfile update is limited to the intended Rustls dependency stack. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Chunk audio and normalization scope] --> B{Chunk scope, at most 30s,<br/>and 30s model available?}
B -->|Yes| C[Run 30s fbank model]
B -->|No| D{10s model available?}
D -->|Yes| E[Run stitched 10s fbank windows]
D -->|No| F[Return invariant error]
C --> G[Validate and copy fbank tensor]
E --> G
G --> H[Prepare chunk embedding input]
Reviews (2): Last reviewed commit: "Update rustls for security advisory" | Re-trigger Greptile |
Upgrade rustls to 0.23.45 to address RUSTSEC-2026-0285 and restore the Cargo Deny check.
Closes #16
Carries the original fix from #17 onto the current runtime implementation.
Summary
rustlsto 0.23.45 to resolve RUSTSEC-2026-0285, which blocked Cargo Deny on currentmaster.Root cause
The chunk-scope branch only entered the 10-second path when the audio length or normalization scope rejected the 30-second path. A supported short chunk with no 30-second model therefore returned the preallocated all-zero fbank.
Validation
cargo fmt --allcargo clippy(passes with one existing warning inpowerset.rs)cargo test(137 passed; seven fixture-backed tests could not run because the local model and PLDA fixtures are absent)Summary by CodeRabbit
Bug Fixes
Tests