-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix checkMatrix usage in some tests #4732
Conversation
Note that there are failing tests only from the files where I fixed the checkMatrix call to actually see if the matrices agree or not. Seems like there could be lingering bugs, but haven't looked too closely yet |
It was used incorrectly since QMCPACK#3452
Test this please |
@camelto2 remaining failure are from the added code? |
It looks like the CGG11-NoMPI-Real-Mixed is failing with what looks like a tolerance issue, e.g.
but the GCC11-NoMPI-Complex-Mixed looks like something could actually be wrong
|
Looks like it would still be tolerance actually. I think to add a tolerance argument into checkMatrix and that would solve the mixed precision issue |
Ok, so the failures were due to the fact that the checkMatrix function uses Catch2 Approx, and was always using the default epsilon. For mixed precision applyRotation in the splines, the laplacian was failing tests due to that default tolerance. I added some functionality which allows us to pass in a desired tolerance for the element by element comparison in checkMatrix. Also added some testing of that inside the unit test for checkMatrix. |
CheckMatrixResult checkMatrix(M1& a_mat, | ||
M2& b_mat, | ||
const bool check_all = false, | ||
const double eps = std::numeric_limits<float>::epsilon() * 100) |
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.
I don't feel right with this hidden choice. Could you use std::optional and default to std::nullopt_t
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.
Think I have this working with optional.
Test this please |
Please review the developer documentation
on the wiki of this project that contains help and requirements.
Proposed changes
While trying to get a new feature tested that I'm working on, I noticed that a few unit tests have incorrect usage of the "checkMatrix". Those tests were just calling checkMatrix(matA, matB) and not getting the result and checking to see if the matrices agree or not.
This means that some of those features could actually be failing and we have been missing it since the checks weren't correct. I think I caught all instances here.
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
macOS
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.