Skip to content

obs-filters: preserve unity expansion through digital silence - #86

Draft
chriscoveries wants to merge 3 commits into
review/base-087a25c7dfrom
fix/review-expander-unity
Draft

chriscoveries wants to merge 3 commits into
review/base-087a25c7dfrom
fix/review-expander-unity

Conversation

@chriscoveries

@chriscoveries chriscoveries commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Scope

One scalar calculation on 087a25c7d977ad3fbcc12a572d95ec05042824de. At a supported 1:1 Expander ratio, silence produces an infinite dB difference. Multiplying it by zero creates NaN, so fmaxf selects -60 dB and audio fades up after silence. Guard zero slope while preserving output gain and carried attack/release state. The upward compressor and non-unity expressions are unchanged.

Fork-only owner review. No upstream-connected branch, public API, Rust source or workflow changes. Author: Chriscoveries [email protected].

RED / GREEN

  • Test-only RED: 22b975228c528280edb1e95fcb4587450d9bbd2b.
  • GREEN source: fd67a46f6832d0b54ba6e26997c8dde5a28e453f.
  • Final handoff: ca8dc907fec5074d7ddb61ca07979d135b9dac8a, subject starts with review:.

Observed failing assertions:

ratio_one_silence_keeps_zero_gain: silence changed gain at ratio 1:1
ratio_one_silence_then_signal_is_passthrough: silent blocks accumulated attenuation
ratio_one_silence_then_signal_is_passthrough: signal after silence differs from input times output gain
expander unity: checks=360744 failures=360742
exit=1

The gain-history case also tests release toward unity from existing attenuation; the non-unity/upward guard passes before and after.

Observed GREEN on Clang 17, C11, -Wall -Wextra -Werror -fno-fast-math -ffp-contract=off:

-O2 -DNDEBUG: expander unity: checks=360744 failures=0
-O1 -g -fsanitize=address,undefined: expander unity: checks=360744 failures=0

Coverage: five sample rates, 1/2/6/8 channels, RMS and peak detection, two output gains, consecutive silence-to-signal blocks and existing ballistics state. The production file was checked against its original Git blob 077451e74b0c0302ce1cf5c9c1931c3c673d7157; the fixed blob is c65ca03cd3ad2e534ead3588a02d113e2cd3aaf0.

Validation boundary

Local runs compiled the complete production filter using an OBS dependency facade for allocation and unused settings/property interfaces. That facade is not included in the patch. The checked-in CTest uses real OBS headers and links libobs, but native OFF/ON linkage has not run here. The source/test arithmetic is validated; native linkage and formatting remain gates.

On the configured Mac:

bash test/review/expander-unity/run-macos.sh OFF_BUILD ON_BUILD

Only libobs and test_expander_unity build. Absolute rpaths and ad-hoc test signing are applied before CTest. The runner creates no commits, changes no branch refs, and does no timing or network service test.

Required format-check output

clang-format-22 --dry-run --Werror: command not found; exit=127
gersemi --check: command not found; exit=127
soldr cargo fmt --check: command not found; exit=127
soldr cargo clippy --all-targets -- -D warnings: command not found; exit=127
git diff --check: exit=0
bash -n on native runner: exit=0

Pinned formatter installation failed on package-host DNS. These checks are outstanding, not passes. Full command output and the unposted issue draft are in the final review commit. No CI was dispatched. Do not promote until the native tests and required checks pass.

At ratio 1:1 the slope is zero. A silent envelope makes the level difference infinite, so multiplying them produced NaN and fmaxf selected the -60 dB floor. Require a nonzero slope before calculating attenuation. Retain gain-history smoothing and output gain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant