Different output in debug and release builds

103 views
Skip to first unread message

siebencorgie

unread,
Oct 22, 2024, 6:02:00 AM10/22/24
to Enzyme AD
Hi,

I'm currently playing around with the rust-enzyme integration.

I'm trying to build the derivative of a simple signed distance function. I found that I get a different derivative values for certain coordinates depending on the compilation profile.

I came up with this minimal example. For `x=[2,2,2]`:


`dev` profile [unoptimized + debuginfo]:
x=[2, 2, 2], dy=[0, 0.33333334, 0.33333334]


`release` profile [optimized]:
x=[2, 2, 2], dy=[0.33333334, 0.6666667, 0.6666667]


I verified that the release build outputs the correct value, so the debug build seems to be broken. This also seems to be somehow related to signedness. All values I tested in the positive region are broken. But for instance x=[-2, -2, -2] outputs the correct value for both builds.

To set up the Rust-Enzyme toolchain I followed the installation guide here: https://enzyme.mit.edu/index.fcgi/rust/installation.html

Am I doing something wrong, or is my project setup missing anything? Are you able to reproduce the bug?
I'd appreciate any pointers as to how to fix the problem.


Greetings
Tendsin Mende

Manuel Drehwald

unread,
Mar 12, 2025, 11:46:41 PMMar 12
to Enzyme AD

Hi Tendsin,

sorry for seeing this so late, I don't actively follow this google group. I answered in your repo in more detail,
but it seems like the bug got resolved in the meantime, I can't reproduce it anymore.
In the future, I would recommend to just open an issue in the github.com/rust-lang/rust repo, there I will receive a notification.

Best,
Manuel
Reply all
Reply to author
Forward
0 new messages