Repository navigation
fix: reject unusable bandpass filter construction - #16
Merged
Elodie Mirza (elodiejmirza) merged 1 commit intoNov 4, 2026
Merged
Elodie Mirza (elodiejmirza) merged 1 commit into
Elodie Mirza (elodiejmirza) merged 1 commit into
Conversation
Signed-off-by: Elodie Mirza <elodiejmirza@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The enabled -ffast-math option can optimize away isfinite checks, undermining NaN/Inf rejection and regression assertions unless strict floating-point semantics protect both dsp.c and dsp_bandpass_test.c.
1 open issue
What changed in this PR
This PR adds checked bandpass-filter construction to the shared DSP code so AFSK and PSK initialization stop rather than consume an invalid kernel.
Changes:
- Uses double intermediates and validates inputs, coefficients, and normalization.
- Returns construction failures to both demodulators, which stop with a fixed diagnostic.
- Adds kernel-response checks and malformed-tuning initialization tests.
| File | Description |
|---|---|
test/dsp_bandpass_test.c |
Tests valid kernels, midpoint response, and invalid construction. |
test/dsp_bandpass_initialization_test.cmake |
Checks AFSK/PSK rejection of malformed tuning. |
test/CMakeLists.txt |
Registers both bandpass regression tests. |
src/dsp.h |
Documents the checked builder’s return and failure contract. |
src/dsp.c |
Adds numeric validation and double-precision intermediates. |
src/demod_psk.c |
Stops PSK initialization when filter construction fails. |
src/demod_afsk.c |
Stops AFSK initialization when filter construction fails. |
Review effort: Balanced
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.

BLUF
gen_bandpass(NaN,...)returns31/31 nonfinite coefficients without reporting failure. Actual baseline AFSK initialization with malformed local tuning continues and decodes zero frames. This repair validates the whole numeric construction instead of merely changing the flagged literal.c7889f9is signed/DCO; merged after all exact-head native/CodeQL/review gates passed.Verification
-Wall -Wextra -Werrorcompilation plus ASan/UBSan focused tests passed. The new unit covers all5 windows,5 odd/even tap counts,3 bands, finite/symmetric coefficients and preserved0.5 midpoint-response convention, plus NaN/Inf/extreme/zero-width/reversed-band/null/extreme-tap rejection.Security Review Evidence
src/dsp.c/.h, both direct callers, test source/CMake wiring for numeric overflow/narrowing, malformed local environment, partial-state consumption, bounds, platform math, diagnostics and compatibility.Lessons Learned
DSP repair integrated — 4 November 2026
1fe760fcf5903b915ab2a2c80424b29a65cd9aa0, containing reviewed signed/DCOc7889f914324ee7f0d446e13f5bcd96c932165b5. No open reviews/threads at final read; no bypass/settings change.fixed_at=2026-11-04T14:20:22Z. Two direwolf stations transmit at same time (collide) how to adjust hold-off timer? wb2osz/direwolf#19/Misc fixes for upstream wb2osz/direwolf#20 were previously scanner-confirmed fixed. The sole current C++ result is config#15 with its reviewed false-positive disposition.browser.user is unavailable); no read:project expansion requested. Existing issue179 remains In Progress. Add GPIO LED support when PTT is asserted wb2osz/direwolf#61/GPIO PTT wb2osz/direwolf#60 retain delivery/BAU follow-up.