Skip to content
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

MacOS test-car.R failure #1456

Open
paciorek opened this issue Jun 1, 2024 · 2 comments
Open

MacOS test-car.R failure #1456

paciorek opened this issue Jun 1, 2024 · 2 comments

Comments

@paciorek
Copy link
Contributor

paciorek commented Jun 1, 2024

We are now seeing a MacOS test failure on test-car.R. It doesn't actually seem related to 1.2.0 (results below are based on nimble 1.1.0) though I do think it has just arisen. I'm wondering if it is because the runner (test machine) is now Apple Silicon.

Two of the three failures seem trivial - whereas formerly some R vs. C MCMC sample comparisons were identical, now they are different by about machine precision. I'm just adjusting those tests.

The third is troublesome. This is for the "dcar_proper gives correct likelihood with singular Cmatrix". This is a case where Cmatrix is singular, with three zero eigenvalues. eigen (i.e., Lapack) gives back (slightly) complex values. nimEigen (i.e., Eigen) on Linux gives back two NaNs (and one 6e-31) with a run-time warning about complex-valued eigenvector, so presumably behind the scenes the imaginary parts are being discarded. We set the NaNs to zero before passing the eigenvalues to dcar_proper to get a valid logProb.

Now on MacOS, nimEigen gives back all zeroes as the eigenvalues (with no warning about complex eigenvalues), and the logProb is incorrect. I don't know what to make of this. Most of the eigenvalues are real according to eigen() and Linux's nimEigen(). Also I can give it a different input matrix with complex eigenvalues and it gives me back a mix of real numbers (from the eigenvalues whose imaginary parts are 0) and NaNs, with a warning about complex eigenvalues where results match those of eigen(). So something about this particular matrix is causing problems.

Cmatrix is 25x25. If I use the upper 24x24 subset (or any other subset) everything seems fine.

Changing the example to be 4x4 or 6x6 instead of 5x5 (nHabRows, nHabCols) avoids the problem too.

So I am changing to 6x6.

:(

@paciorek
Copy link
Contributor Author

paciorek commented Jun 2, 2024

This has addressed the MacOS test failure. Leaving issue open given there is still a mystery (and possible concern) about Eigen's behavior on MacOS.

@danielturek
Copy link
Member

@paciorek This was really puzzling to read. Slightly disconcerting.

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

No branches or pull requests

2 participants