Skip to content

Add overflow protection for MaxEnt kernel functions#632

Merged
fassaad merged 3 commits into
masterfrom
631-nans-for-large-betaomega-in-maxent
Jun 3, 2026
Merged

Add overflow protection for MaxEnt kernel functions#632
fassaad merged 3 commits into
masterfrom
631-nans-for-large-betaomega-in-maxent

Conversation

@johanneshofmann87

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.F90 for kernel and helper functions when |beta*om| is large.
  • Add a new Analysis.tests CMake subdirectory and an overflow regression test executable.
  • Wire Analysis.tests into 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.

Comment thread testsuite/Analysis.tests/1-maxent-kernel-overflow.F90 Outdated
@johanneshofmann87

Copy link
Copy Markdown
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>
@johanneshofmann87 johanneshofmann87 self-assigned this Apr 12, 2026
@johanneshofmann87 johanneshofmann87 marked this pull request as ready for review April 12, 2026 12:03

@fassaad fassaad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the only comment I have for the code. I did not yet go through the test suite.

Comment thread Analysis/maxent_wrapper_mod.F90
@johanneshofmann87 johanneshofmann87 requested a review from fassaad May 20, 2026 15:45
@fassaad fassaad merged commit 05d9a74 into master Jun 3, 2026
25 checks passed
@fassaad fassaad deleted the 631-nans-for-large-betaomega-in-maxent branch June 3, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NaN's for large beta*omega in MaxEnt

5 participants