Add overflow protection for MaxEnt kernel functions#632
Merged
Conversation
…CMake configuration
Contributor
There was a problem hiding this comment.
Pull request overview
Adds overflow-safe branches to MaxEnt kernel/helper functions to prevent exp(beta*omega) blowups for large |beta*omega|, and introduces an Analysis-focused regression test to validate behavior near the branch threshold and at extreme arguments.
Changes:
- Add asymptotic/overflow-safe branches in
Analysis/maxent_wrapper_mod.F90for kernel and helper functions when|beta*om|is large. - Add a new
Analysis.testsCMake subdirectory and an overflow regression test executable. - Wire
Analysis.testsinto the testsuite build.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| testsuite/CMakeLists.txt | Adds Analysis.tests to the testsuite CMake build. |
| testsuite/Analysis.tests/CMakeLists.txt | Defines/builds the new Analysis overflow test and registers it with CTest. |
| testsuite/Analysis.tests/1-maxent-kernel-overflow.F90 | New regression test for continuity and extreme-argument behavior of MaxEnt kernels/helpers. |
| Analysis/maxent_wrapper_mod.F90 | Implements overflow protection branches for several kernel/helper/default-model functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
This will have merge (potential) merge conflicts with feature branch 625. The test uses a hard coded value for pi. This may not get caught by git. |
… computing relerr Agent-Logs-Url: https://github.com/ALF-QMC/ALF/sessions/5f763f28-68ce-4ee5-bc33-bea36169800e Co-authored-by: johanneshofmann87 <129625831+johanneshofmann87@users.noreply.github.com>
fassaad
reviewed
Apr 29, 2026
fassaad
left a comment
Member
There was a problem hiding this comment.
That is the only comment I have for the code. I did not yet go through the test suite.
fassaad
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kernel now feature a if condition to catch potential overflow for |omega*beta| > 600. There now also exists a test for this in the test suite.