Detect click/pop discontinuities with bounded PCM evidence - #13
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 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 |
engkimo
left a comment
There was a problem hiding this comment.
The detector contract and bounded evidence projection look good, and the full test/build suite passes. One concurrency issue should be fixed before merge.
observe_stage_audio() reads _stage_pcm_state before acquiring _lock, then later updates that state inside the lock. Concurrent calls for the same stage can both consume the same previous sample/frame offset and overwrite each other, which can lose a chunk-boundary discontinuity, roll back media time, or bypass the 5 ms dedup state. Since this is stateful cross-chunk analysis, please serialize the read → detect → state update sequence for each stage (or otherwise make it atomic), and add a focused concurrent-call regression test.
|
Addressed the concurrency issue in I also added a focused concurrent-call regression test that pauses the first detector invocation, starts a second call for the same stage, verifies the detector invocations are serialized, and confirms both boundaries retain monotonic media times (5 ms and 10 ms). Validation:
|
engkimo
left a comment
There was a problem hiding this comment.
Re-reviewed the concurrency fix. The stage PCM state read, discontinuity detection, dedup decision, and state update are now serialized under the observer lock, and the focused concurrent-call regression test verifies that the second call cannot consume stale state. The observability tests pass locally (29 passed), and the required Python, web build, and security checks are green. Approved.
Closes #4
Summary
Testing
python3 -m ruff check src/voxbench/observability/observer.py src/voxbench/observability/__init__.py src/voxbench/control_plane/run_api.py tests/test_observability.pypython3 -m pytest -q(330 passed, 4 skipped)