Fixes flagged by code review#39
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses several correctness and safety issues previously flagged in the real-time radar pipeline’s clutter filter and RspDuo capture path, and adds a focused unit test to prevent regressions.
Changes:
- Fixes
WienerHopfbin count to be inclusive (delayMax - delayMin + 1) and adds constructor input validation, plus destructor cleanup for FFTW resources and heap arrays. - Adds a mutex-protected file-write path in
RspDuostream callback to avoid write/close races. - Introduces a Catch2 unit test target for
WienerHopfand wires it into CMake/CTest.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unit/process/clutter/TestWienerHopf.cpp | Adds unit coverage for constructor guards and short-input behavior. |
| src/process/clutter/WienerHopf.h | Initializes FFTW plan/pointer members to nullptr and includes <complex> for member declarations. |
| src/process/clutter/WienerHopf.cpp | Adds constructor guards, fixes inclusive nBins, frees allocated arrays, and null-checks FFTW plan destruction. |
| src/capture/rspduo/RspDuo.cpp | Wraps file writes with saveIqFileMutex and checks is_open() under lock. |
| CMakeLists.txt | Adds testWienerHopf executable and registers it with CTest. |
| // input | ||
| delayMin = _delayMin; | ||
| delayMax = _delayMax; | ||
| nBins = delayMax - delayMin; | ||
| nBins = static_cast<uint32_t>(delayMax - delayMin + 1); | ||
| nSamples = _nSamples; |
|
@copilot a fix been made after your review. re-run your review, but don't fix anything directly. just highlight it for me. |
Re-ran review on the latest branch state.
No fixes applied, per your request. |
|
@copilot I've added some fixes after your last code review. Re-run your review, but don't fix directly into code. just highlight the issues to me. |
Re-ran review on the latest fixes. Remaining high-signal issue:
What looks fixed:
No direct code changes made. |
|
@copilot a few fixes have been applied after your last review to address issues you've highlighted. re-run your review and don't fix directly in code. just let me know. |
Re-ran review on the latest commit. What looks fixed:
Remaining high-signal issues:
No code changes applied. |
|
@copilot a few fixes have been applied after your last review to address issues you've highlighted. re-run your review and don't fix directly in code. just let me know. |
Re-ran review on the latest branch state. Most previously flagged items now look addressed (index math, null-input guard, and copy/move deletion are in place). One remaining issue to highlight:
I didn’t apply any code changes. |
|
@copilot a few fixes have been applied after your last review to address issues you've highlighted. re-run your review and don't fix directly in code. just let me know. |
Re-ran review on the latest commit. I don’t see a remaining high-signal issue in the WienerHopf changes now. The constructor allocation path is now exception-safe with RAII locals, and the previously flagged index/null/copyability and bounds checks still look correct. No code changes applied. |
This pull request is to address issues highlighted by a code review for a previous PR.
The focused review on the previous branch found a few high-signal risks worth addressing:
I couldn’t run full/targeted binaries in this sandbox because the configured toolchain/build deps are missing (/scripts/buildsystems/vcpkg.cmake, compilers/make), so the review above is static-analysis based.