Skip to content

mic: take non-finite suppressor input as silence; note blob versioning - #280

Merged
RyanTheTide merged 1 commit into
mainfrom
fix/mic-sens-finite
Nov 27, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
fix/mic-sens-finite

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: Two non-blocking review notes from #277:

  • sgv2-core::mic::sens::Run::process now takes non-finite input samples as silence. The engine already zeroes them before its stages, but the suppressor can be driven directly (the mic-parity sens mode does), and a NaN or infinity would then stay in its smoothers and overlap-add. A new test feeds NaN and ±infinity and checks that the output stays finite and recovers to the clean output.
  • packaging/pipewire/README.md notes that the plugin refuses another artifact version: a version-1 mic blob gives silence and health 1. Whatever provisions the blob must recompile it when the plugin changes, rather than keep a stale one.

Tested:

  • At ae4e4b6: sgv2-core mic tests (28, including the new one) pass. cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and tools/check-clean.sh are clean.
  • Finite input is unchanged:
    • Offline: on the saved J616s capture, the output is bit-identical to the merged mic: carry the noise suppressor, exact transform window and beam mode (phase 2) #277 output (max relative error 0.0).
    • Hardware row: M1 Pro (J316s), fleet89, silent, capture only, no install or reboot. The default mic-compile of the Mac's own bundle wrote a full blob, and a fresh 20 s capture processed on the Mac is bit-identical to the x86 render. Restored: next_entry empty, Enforcing, 0 failed units.

Risk: two-way · affects only non-finite suppressor input and a README paragraph. A plain revert undoes it.

Not yet: nothing for this change. The other review note (smoother start-up dip) stays a TODO(SPEC) in the stage report.

The engine already zeroes non-finite input before its stages, but the
suppressor can be driven directly (the mic-parity sens mode does), and a
NaN or infinity would then stay in its smoothers and overlap-add. Zero
such samples at the top of Run::process and test that the output stays
finite and recovers. Document that a mic blob of another artifact version
gives silence, so provisioning recompiles rather than keeping a stale one.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 27, 2026 11:43
@github-actions github-actions Bot added door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at ae4e4b6f: not ready yet

Check Detail
CI at head running running: Rust (ubuntu-24.04)
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA ae4e4b6f, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · affects only non-finite suppressor input and a README paragraph. A plain revert undoes it.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at ae4e4b6f67d5

Blockers: none

Checked:

  • sens.rs: non-finite samples are zeroed in place before either path (bypass or suppression). Without that, one NaN or Inf stays in the smoothers and the overlap-add for good. This matches what the engine already does ahead of its stages (mic/mod.rs:605), so it only changes behaviour for a direct caller of the suppressor. Engine output on real input is unchanged.
  • The new test fails without the fix. With the zeroing loop removed, non_finite_input_is_silence_and_the_state_recovers panics at sens.rs:431 (non-finite output). With it, the test passes, and so does the whole sgv2-core suite (282 + 37 + 15 + 9 + 29 + 5 + 1 + 1 + 4 + 2 passed, 0 failed; one test is ignored, as on main).
  • The README note on blob versioning matches artifact.rs (v2 refuses v1 blobs; the plugin then gives silence and health 1).
  • This is the follow-up to the two non-blocking notes in the #277 review.
Evidence

Buildbox, cargo 1.96.0, cargo test -p sgv2-core at ae4e4b6f67d5, plus a negative run with the zeroing loop deleted (1 failed: the new test).

@RyanTheTide
RyanTheTide merged commit 3344d30 into main Nov 27, 2026
13 checks passed
@RyanTheTide
RyanTheTide deleted the fix/mic-sens-finite branch November 27, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant