Fix bug with num_fluids = 3 and AMD #1394
Conversation
Code Review by Qodo
1. Uninitialized alpha element read
|
📝 WalkthroughWalkthroughThis pull request updates the 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 |
|
Persistent review updated to latest commit 68df298 |
Claude Code ReviewHead SHA: 68df298 Files changed:
FindingsHardcoded array dimension still insufficient for
#:if not MFC_CASE_OPTIMIZATION and USING_AMD
real(wp), dimension(3) :: alpha_rho, alpha ! changed from 2 -> 3
#:else
real(wp), dimension(num_fluids) :: alpha_rho, alpha
#:endifThe fix correctly resolves an out-of-bounds write when
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
=======================================
Coverage 64.75% 64.75%
=======================================
Files 71 71
Lines 18721 18721
Branches 1551 1551
=======================================
Hits 12123 12123
Misses 5640 5640
Partials 958 958 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think there's something wrong with phoenix runners, the jobs fail instantly |
Claude Code ReviewPR #1394 — Fix bug with One-line fix: Strengths
Important Issues1. Whole-array normalization reads uninitialized elements when
alpha = alpha/max(sum_alpha, sgm_eps)This whole-array statement operates on all 3 elements. Only indices This latent issue existed before this PR for do i = 1, num_fluids
alpha(i) = alpha(i)/max(sum_alpha, sgm_eps)
end do2. No regression test added for the fixed configuration The PR checklist testing section is empty and CI was not run. There is no test covering Suggestions
|
Description
Fixing a bug when num_fluids = 3 and MFC_CASE_OPTIMIZATION is off with AMD compilers.
There is a check guarding this when num_fluids > 3 with these conditions, that can be resolved once the internal issue is fixed with private arrays
Closes #1368
Type of change
Testing
How did you test your changes?
Checklist
See the developer guide for full coding standards.
GPU changes (expand if you modified
src/simulation/)AI code reviews
Reviews are not triggered automatically. To request a review, comment on the PR:
@coderabbitai review— incremental review (new changes only)@coderabbitai full review— full review from scratch/review— Qodo review/improve— Qodo code suggestions@claude full review— Claude full review (also triggers on PR open/reopen/ready)claude-full-review— Claude full review via label