-
Notifications
You must be signed in to change notification settings - Fork 19
additional robustness cleanups #595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
… that 0 is not a safe value for root finds.
rbberger
approved these changes
Dec 12, 2025
Collaborator
rbberger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, assuming the current regit pipeline passes.
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.
PR Summary
This is further motivated by #590 and trying to ensure the code builds and tests pass on MI300A systems. Here I do a few things:
-Walland clean things up so that the code builds with no warnings. This was mostly small changes, like removing unused variables, re-ordering the constructor, etc. Before I merge this, I plan to add a test on github with-Wall -Werrto ensure the code builds. I'll probably modify the clang build test to do this, as clang produces more legible warnings than gcc.SpinerEOSDependsRhoT::GruneisenParamFromDensityEnergy. I fixed it but I don't think it was causing the problems we were seeing.test_pte.cpphad additional issues, which I believe I've now resolved:rand(), with a defaulted random seed. Apparently the default random seed is 1, which is good for reproducibility. But the actual random number generator used byrandis implementation defined, which is not good for reproducibility. I switch to usingstd::mt19937fromrandom. I also reset the seed beforeset_stateso that the state is set up identically for both PTE solvers. (The fact that this was not identical for both PTE solvers was a bug, but not one that should have caused the code to crash.)DensityEnergyFromPressureTemperaturecall, used insidePTESolverPT, uses 0 as a lower bound by default, and that bound is evaluated by theregula_falsiroot finder. I have guarded against this more carefully now--they now produce 0. But this is still problematic for the root find, as 0 is a discontinuous jump from rho = epsilon > 0, as the pressure tends to negative infinity as density tends to 0. To remedy this, now have the Davis equations of state report a minimum valid density of machine epsilon, which the root finder respects, and keeps them off of the problematic point.PR Checklist
make formatcommand after configuring withcmake.If preparing for a new release, in addition please check the following:
when='@main'dependencies are updated to the release version in the package.py