Preserve LavaSR digital silence - #61
Merged
Merged
Conversation
Tinnci
marked this pull request as ready for review
July 12, 2026 05:33
Copilot stopped reviewing on behalf of
Tinnci due to an error
July 12, 2026 05:33
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR improves LavaSR failure/silence handling and makes CLI evaluation workflows correctly fail when an eval-matrix run fails.
Changes:
- Short-circuit
lavasr-compatinference for exact digital silence to prevent deterministic low-level “texture” output. - Make
audio-super-res eval matrixreturn a non-zero exit code when any run fails, and enforce the same in the Colab evidence workflow. - Add/refresh documentation and changelog entries to reflect the updated behavior and validation evidence.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_lavasr_compat.py | Adds regression test ensuring exact digital silence stays silent and model load is avoided. |
| tests/test_cli.py | Adds test asserting eval matrix returns non-zero exit code when failures occur. |
| src/audio_super_resolution/cli.py | Returns exit code 1 when the eval matrix manifest reports failures. |
| src/audio_super_resolution/backends/lavasr_compat.py | Adds silence short-circuit in enhance() to preserve exact silence. |
| examples/colab_lavasr_validation.py | Treats matrix runs as failed if the manifest indicates failures. |
| docs/ACCELERATORS.md | Records validation/evidence notes for the published tag and silence fix. |
| ROADMAP.md | Updates release milestone status to completed. |
| CHANGELOG.md | Documents the fixes under an Unreleased section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
117
to
+122
| device = resolve_device(self.config.device, supported_devices=LAVASR_CAPABILITY.accelerators) | ||
| _require_torch_runtime() | ||
|
|
||
| prepared_audio, was_mono = _prepare_lavasr_input(audio, sample_rate) | ||
| if not np.any(prepared_audio): | ||
| return _restore_lavasr_output(np.zeros_like(prepared_audio).T, was_mono=was_mono) |
|
|
||
| prepared_audio, was_mono = _prepare_lavasr_input(audio, sample_rate) | ||
| if not np.any(prepared_audio): | ||
| return _restore_lavasr_output(np.zeros_like(prepared_audio).T, was_mono=was_mono) |
| ) | ||
| print(f"Wrote eval matrix {args.output_dir / 'matrix.json'} ({manifest['run_count']} run(s))") | ||
| return 0 | ||
| return 0 if manifest["passed"] else 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The v0.6.0 Colab T4 failure-case matrix passed four of five fixtures. Exact digital silence produced deterministic model output with RMS 0.0001772631 and peak 0.000664089, causing the harness to correctly report silence_hallucination. Five repeated CUDA runs had the same SHA256, while the reference and degraded inputs remained exactly zero. The model output, not degradation, WAV writing, or CUDA variance, was the source.
Fix validation
On the same Colab T4 session, weights, and fixtures, the matrix changed from four passed plus one stability failure to five passed with zero failures. Silence duration drift changed from 0.0026667 seconds to zero.
Checks