Bugfix periodic force sum#1377
Conversation
Claude Code ReviewHead SHA: 390511e Files changed:
Findings1. [Critical] Incomplete rename —
|
📝 WalkthroughWalkthroughTwo Fortran preprocessor files were modified to update immersed boundary simulation logic. In 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/simulation/m_ibm.fpp (1)
889-926:⚠️ Potential issue | 🔴 CriticalCritical: three compilation-blocking defects prevent the OOB fix from working.
This kernel has three defects that will cause immediate compilation failure:
s_decode_patch_iddoes not exist. The only decoder available inm_ib_patches.fppiss_decode_patch_periodicity(defined at line 1048 with optional periodicity outputs). There is nos_decode_patch_idanywhere in the codebase.
ib_idxis never declared. Line 889 only declaresi, j, k, l, encoded_ib_idx, fluid_idx, yetib_idxis referenced in the GPUprivate=[...]clause on line 917 and used on lines 930, 931, 933, 934, 1001, and 1003.
ib_dx(line 926) is an undeclared typo. Should beib_idx.The intent is correct—to decode the encoded marker so that
forces(ib_idx, :)andtorques(ib_idx, :)stay within[1, num_ibs]and prevent OOB writes. However, these three bugs prevent the code from compiling and must be fixed.🐛 Proposed fix
- integer :: i, j, k, l, encoded_ib_idx, fluid_idx + integer :: i, j, k, l, encoded_ib_idx, ib_idx, fluid_idx- encoded_ib_idx = ib_markers%sf(i, j, k) - if (encoded_ib_idx /= 0) then - call s_decode_patch_id(encoded_ib_idx, ib_dx) + encoded_ib_idx = ib_markers%sf(i, j, k) + if (encoded_ib_idx /= 0) then + call s_decode_patch_periodicity(encoded_ib_idx, ib_idx)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1268c24e-7202-4f84-93c1-1ab6ae7e3255
📒 Files selected for processing (2)
src/simulation/m_ib_patches.fppsrc/simulation/m_ibm.fpp
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1377 +/- ##
==========================================
+ Coverage 64.62% 64.76% +0.14%
==========================================
Files 71 71
Lines 18407 18713 +306
Branches 1516 1549 +33
==========================================
+ Hits 11895 12119 +224
- Misses 5555 5638 +83
+ Partials 957 956 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Fixes an edge case where we can cause out-of-bounds writes as we sum forces over periodic IB projections
Type of change