-
Notifications
You must be signed in to change notification settings - Fork 206
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
[BUG]: Eigen integration silently fails with recent versions of Eigen #746
Comments
I can't reproduce this issue on my machine. What version of Eigen are you using? What OS is this on? |
I did sme more checking to see if there could be an issue involving ownership management: the expression caster turns the addition expression into a The CI also hasn't had shown any failures here in the last months. Could it be that there is a problem on your end? If this is truly a nanobind bug, could I ask you to make a PR that causes a failure to help reproducibility on my end? |
Thanks for looking into this! I'm seeing this on my macbook with commit Let me try bisecting Eigen to see if I can narrow down when this occurred. I'll report back ASAP with more info. Thanks! |
Bisecting was actually fast! It looks like the offending Eigen commit actually is |
One possibly relevant thing is that both Google's CI and your macbook likely use I tried to reproduce the same failure on my Linux machine with Eigen from master and was unable, but perhaps I didn't get the compiler stars to align right. |
This isn't really meant to be merged, but it's a follow up from wjakob#746 demonstrating the test failure with the current master branch of Eigen. This workflow seems to fail when run on macOS, and (as @hawkinsp suggested) I expect the issue is related to using clang instead of gcc.
Problem description
When I build the following simple nanobind module with the current
master
branch of Eigen:The output of calling:
is
array([17726950], dtype=int32)
instead of the expectedarray([0], dtype=int32)
.This can be fixed by adding a return type:
and the example above works properly using the last stable release of Eigen, so I expect it has something to do with a change in the type produced by the addition. Unfortunately I don't know enough about the nanobind (or Eigen!) internals to know where to start debugging this, but I wanted to check here if this was an expected sharp edge, or if this is something that should work.
I note that I originally came across this issue when I discovered a test failure here:
nanobind/tests/test_eigen.py
Lines 303 to 305 in f3e2796
which has this same syntax.
Reproducible example code
The text was updated successfully, but these errors were encountered: