Skip to content

fix: preserve strict DSP finite-value validation - #17

Merged
Elodie Mirza (elodiejmirza) merged 1 commit into
masterfrom
codex/direwolf-strict-dsp-fp-20261104
Nov 4, 2026
Merged

Elodie Mirza (elodiejmirza) merged 1 commit into
masterfrom
codex/direwolf-strict-dsp-fp-20261104

Conversation

@elodiejmirza

@elodiejmirza Elodie Mirza (elodiejmirza) commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

BLUF

  • Fix forward for #16 review4468729828, tracked under central #179; no issue-closing directive.
  • Global -ffast-math can invalidate the new finite-value checks and their test assertions. Earlier green tests/scanner fixed-at remain historical observations, not complete compiler-semantics assurance.
  • Apply source-local -fno-fast-math -fno-finite-math-only (GNU/Clang) or /fp:strict (MSVC), selected by C compiler ID, in both source directory scopes. This covers every existing DSP consumer, including optional targets. Unrelated translation units keep existing optimization flags.
  • Add compile-time guards against fast/finite-only assumptions in dsp.c and its focused test. Preserve CMake3.10 syntax, platforms, numerical validation and the existing modem contract.
  • Signed/DCO head 9cc6f5f; merged after exact-head native/CodeQL/review gates passed. Final integrated proof below; Feature Request: control beacon transmission using an external command wb2osz/direwolf#179 remains open.

Verification

  • Final Release build and43/43 CTest passed, including actual malformed-tuning initialization and existing receiver decoding tests. Strict/sanitizer focused tests passed.
  • Negative compilation probes fail as intended for -ffast-math and independently -ffinite-math-only, in both protected sources. A defined MSVC fast-mode macro is also rejected. A positive -O3 -DNDEBUG probe with unsafe flags followed by strict overrides passes.
  • With OPTIONAL_TEST=ON and adversarial global -Ofast -ffinite-math-only, inspected all7 relevant compile commands and executed them successfully:6 DSP consumers (direwolf/gen_packets/atest/dsp_bandpass_test/testagc/walk96) plus the focused test source. Strict flags follow unsafe options; the unrelated AFSK translation unit retains global fast math.
  • Optional-target object compilation is proven; full optional experimental programs are not claimed tested. Actual CMake3.10/MSVC execution is not claimed. Source flags use supported3.10 APPEND_STRING/COMPILE_FLAGS, not newer source COMPILE_OPTIONS syntax.
  • direwolf.h explicitly undefines NDEBUG before assert.h, so existing assertions remain active in Release; no unverified assertion-policy change.
  • Final diff/Gitleaks checks passed. New-head hosted and integrated evidence passed, detailed below.

Security Review Evidence

  • Reviewed both CMake directory scopes and allDSP consumers, compiler selection/order, macro guards, optional target coverage, assertions, numeric paths and performance scope.
  • Fresh independent investigation and one fresh independent patch review found no concrete blocker in current CMake paths. Root independently inspected generated commands and executed all7 relevant compilations. The reviewer noted missing MSVC macro coverage; root added the officially documented _M_FP_FAST guard and tested preprocessing rejection.
  • Microsoft macro documentation supports the MSVC guard. Hosted Windows uses MinGW; no native MSVC claim.
  • Strict flags affect all functions in shared dsp.c; existing receiver regressions pass, but no performance benchmark or full floating-point-environment/denormal/bit-for-bit portability claim. Unrelated source optimizations remain.
  • No dependency, credential, scanner owner, release destination, permissions or public API change. No suppression, privilege escalation or admin bypass.

Lessons Learned

  • LL0002: missed build-contract cause recorded in Feature Request: control beacon transmission using an external command wb2osz/direwolf#179 before fix-forward; preserve prior green/failure observations. LL0004/0011: verify actual compiler/source/native/scanner correlation. LL0007: preserve historical findings. LL0010: signed/DCO normal integration only.
  • Complexity removed or justified: source-level invariant plus two native CMake scopes covers all consumers without global optimization changes or a new framework.
  • Project9/10 issue179/61/60 remain open; PR field update remains pending authorized UI recovery. Separate Support APRS Directed Station Queries wb2osz/direwolf#112 protection proposal/owner approval/readback remains required.

Current Direwolf verification — 4 November 2026

Signed-off-by: Elodie Mirza <elodiejmirza@gmail.com>
@elodiejmirza
Elodie Mirza (elodiejmirza) marked this pull request as ready for review November 4, 2026 14:43
Copilot AI balanced review requested due to automatic review settings November 4, 2026 14:43
@elodiejmirza
Elodie Mirza (elodiejmirza) merged commit 26cd008 into master Nov 4, 2026
12 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T14:44:18.280073Z 9cc6f5f Draft marked ready
🔒 Security Review ✅ Completed 2026-11-04T14:45:04.426620Z 9cc6f5f Draft marked ready
ℹ️ About Codex in GitHub

Your 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the changes protecting DSP finite-value validation from unsafe floating-point assumptions.

No open issues 🎉

What changed in this PR

This PR preserves the DSP finite-value validation introduced in #16 by preventing fast-math assumptions from disabling NaN and infinity checks.

Changes:

  • Applies compiler-specific strict floating-point flags to DSP sources in both CMake directory scopes, including optional consumers.
  • Adds compile-time guards to dsp.c and its focused test to reject unsafe floating-point modes.
  • Retains CMake 3.10 compatibility and existing optimization flags for unrelated sources.
File Description
test/​dsp_bandpass_test.c Rejects compilation with fast-math or finite-only assumptions.
test/​CMakeLists.txt Applies strict floating-point flags to DSP and focused test sources.
src/​dsp.c Guards finite-value validation against unsafe compiler modes.
src/​CMakeLists.txt Applies strict floating-point flags to DSP source consumers.

Review effort: Balanced

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.

2 participants