wjakob / nanobind

nanobind: tiny and efficient C++/Python bindings
BSD 3-Clause "New" or "Revised" License
2.35k stars 198 forks source link

one of the tests fails with Eigen <3.4 #725

Closed wojdyr closed 1 month ago

wojdyr commented 1 month ago

Problem description

git master

I tried the tests on old laptop with Ubuntu 20.04, which has Eigen 3.3.7.

tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-1-0-0] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-1-0-1] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-1-2-0] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-1-2-1] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-2-0-0] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-2-0-1] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-2-2-0] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1-2-2-1] PASSED
tests/test_eigen.py::test05_matrix_large_nonsymm[False-1--2-0-0] python3: /usr/include/eigen3/Eigen/src/Core/Stride.h:66: Eigen::Stride<InnerStrideAtCompileTime, OuterStrideAtCompileTime>::Stride(Eigen::Stride<InnerStrideAtCompileTime, OuterStrideAtCompileTime>::Index, Eigen::Stride<InnerStrideAtCompileTime, OuterStrideAtCompileTime>::Index) [with int _OuterStrideAtCompileTime = -1; int _InnerStrideAtCompileTime = -1; Eigen::Stride<InnerStrideAtCompileTime, OuterStrideAtCompileTime>::Index = long int]: Assertion `innerStride>=0 && outerStride>=0' failed.
Aborted

Checking this assertion in git history, it was removed before Eigen 3.4: https://gitlab.com/libeigen/eigen/-/commit/0668c68b031351488712f21290c77412b02c5de8

Reproducible example code

No response

wjakob commented 1 month ago

I am not sure what is the right thing to do here as I don't use Eigen personally in my own work.

If this actually an issue in Eigen, my thought would be to disable this test in the test suite, or failing compilation with an error message when a too old version of Eigen is detected.

cc @ManifoldFR @WKarel

wjakob commented 1 month ago

I will close this, it seems like more of an issue with Eigen rather than nanobind.