ITADN

Binary orbit CIC failure status not set

#1842OpenBenWibking 创建于 2026-05-01
bug: wrong answer/failure/crashCIcodexcode-audit
B
BenWibkingcommented
## Summary `testBinaryOrbitCIC.cpp` prints `"Test failed"` when orbit-separation deviation exceeds tolerance, but does not increment `status`, so CI can pass despite a failed numerical check. ## Severity `High` ## Affected File `src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp` ## Affected Function / Symbol `BinaryOrbitCIC` validation logic ## Audit Metadata - Source log: `issues/likely_real/binary-orbit-cic-deviation-failure-status.md` - Finding tags: correctness/test ## Proposed Patch - Increment `status` in every orbit-deviation failure branch so tolerance failures propagate to the executable exit status. ## Why This Is a Bug `src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp` checks `max_deviation` against a tolerance in the normal and restart-refactor branches. When the deviation is too large, both branches print `"Test failed"`, but neither increments `status`. That means a regression can exceed the accepted orbit-separation error and still return success as long as no particle-count check fails. This masks physics or restart/refinement regressions in CI. ## Complete Code Patch ```diff diff --git a/src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp b/src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp --- a/src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp +++ b/src/problems/BinaryOrbitCIC/testBinaryOrbitCIC.cpp @@ if (max_deviation < max_err_tol) { amrex::Print() << "Test passed\n"; } else { + status += 1; amrex::Print() << "Test failed\n"; } @@ if (max_deviation < max_err_tol) { amrex::Print() << "Test passed\n"; } else { + status += 1; amrex::Print() << "Test failed\n"; } ```
0 条评论