ODE test do not work when compiling single precision library

55 views
Skip to first unread message

Gwentarino Kripperino lkjdsfa

unread,
Apr 9, 2024, 8:49:58 PMApr 9
to ode-users
I noticed that the epsilon used in collision_point_depth.cpp is too small for the single precision library, so I added the following modification
```
#ifdef CCD_IDEDOUBLE
#define TOLERANCE 1e-12
#else
#define TOLERANCE 1.19e-07
#endif
```
this epsilon was derived from the Wikipedia article about epsilon.
of course, every instance of 1e-12 needs to be replaced with TOLERANCE.

I would submit a pull request but it appears I do not have permissions on bitbucket

Oleh Derevenko

unread,
Apr 10, 2024, 10:45:41 AMApr 10
to ode-...@googlegroups.com
Why would you want to use the single precision library if computations are performed in hardware and the hardware is internally doing these computations at full precision but then may truncate the result to make it "single precision"?

Oleh Derevenko

-- Skype with underscore

 


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, April 10, 2024 3:45
To: ode-users <ode-...@googlegroups.com>
Subject: [ode-users] ODE test do not work when compiling single precision library
 
You don't often get email from redato...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/76df0417-3eea-4e3c-b1d0-57d9630fa2b3n%40googlegroups.com.



This e-mail may contain privileged and confidential information. If you are not the intended recipient, be aware that any use, disclosure, copying or distribution of this e-mail or any attachments is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you.

Gwentarino Kripperino lkjdsfa

unread,
Apr 10, 2024, 4:43:03 PMApr 10
to ode-...@googlegroups.com
Well, I haven't done any performance test on the single precision library yet, but I figured that they would not have built the single precision bersion if it was strictly worse than the double precision version. Either way, the option exist, so the test should function when compiling for that option, or if the single precision version really is useless, it should be removed.

You received this message because you are subscribed to a topic in the Google Groups "ode-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ode-users/RKFsnL3fY0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/AS4PR07MB889986F7E4FD88F848F2AF59DD062%40AS4PR07MB8899.eurprd07.prod.outlook.com.

Oleh Derevenko

unread,
Apr 11, 2024, 7:04:32 AMApr 11
to ode-...@googlegroups.com
The single precision is strictly worse. The way it is implemented inside, it makes sense only if you have hardware that natively supports floating point math and does not support double precision (or supports it at higher cost in terms of performance); or if you don't have hardware floating point operation and use a software library to perform the floating point operations.
The proper way it had to be, could be using single precision fields for input/output data (to save on memory storage) but still performing computations with double precision. But alas, this mode is not implemented.
And the single precision library is built just because it used to be built. The library's policy is that you have to configure and build with the options that suit your task the best rather than using the shipped binary with plain defaults.

Oleh Derevenko

-- Skype with underscore

 



From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, April 10, 2024 23:42
To: ode-...@googlegroups.com <ode-...@googlegroups.com>
Subject: Re: [ode-users] ODE test do not work when compiling single precision library
 
You don't often get email from redato...@gmail.com. Learn why this is important
Well, I haven't done any performance test on the single precision library yet, but I figured that they would not have built the single precision bersion if it was strictly worse than the double precision version. Either way, the option exist, so the test should function when compiling for that option, or if the single precision version really is useless, it should be removed.

On Wed, Apr 10, 2024, 7:45 AM 'Oleh Derevenko' via ode-users <ode-...@googlegroups.com> wrote:
Why would you want to use the single precision library if computations are performed in hardware and the hardware is internally doing these computations at full precision but then may truncate the result to make it "single precision"?

Oleh Derevenko

-- Skype with underscore

 


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, April 10, 2024 3:45
To: ode-users <ode-...@googlegroups.com>
Subject: [ode-users] ODE test do not work when compiling single precision library
 
You don't often get email from redato...@gmail.com. Learn why this is important
I noticed that the epsilon used in collision_point_depth.cpp is too small for the single precision library, so I added the following modification
```
#ifdef CCD_IDEDOUBLE
#define TOLERANCE 1e-12
#else
#define TOLERANCE 1.19e-07
#endif
```
this epsilon was derived from the Wikipedia article about epsilon.
of course, every instance of 1e-12 needs to be replaced with TOLERANCE.



Tilmann Zäschke

unread,
Apr 11, 2024, 9:33:32 AMApr 11
to ode-...@googlegroups.com

> Either way, the option exist, so the test should function when compiling for that option, or if the single precision version really is useless, it should be removed.


I agree with that.
And I agree with with Oleh's statement that single precision is (probably) strictly worse. If I remember correctly, modern CPUs (at least desktop CPUs) really are faster at double precision than at single precision operations.


There maybe situations though where single precision is preferable, for example, where memory is a concern (think large trimeshes), or where other libraries in a project require single-precision (and conversion just adds unnecessary complexity), or old projects where migration from single to double is just too costly.


I think the problem is that this project (like many others) is run by volunteers, so things will only get fixed (or removed) if someone volunteers to do that :-).


Best,

Til

--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.

Gwentarino Kripperino lkjdsfa

unread,
Apr 11, 2024, 3:31:25 PMApr 11
to ode-...@googlegroups.com
Okay, but shouldn't the test still function properly, 1e-12 is too preciese for single precision floats. Maybe their should also be a warning about the single precision library being obsolete 

--
You received this message because you are subscribed to a topic in the Google Groups "ode-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ode-users/RKFsnL3fY0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ode-users+...@googlegroups.com.

Oleh Derevenko

unread,
Apr 12, 2024, 6:07:00 AMApr 12
to ode-...@googlegroups.com
Alright. I'll add a conditional for the tolerance. Even though I don't like such conditionals in code.

Oleh Derevenko

-- Skype with underscore

 


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Thursday, April 11, 2024 22:31
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/CAC91a--vUNe53EgKVacz4iXDPG_%2BO6SkUBb76vR9jFOy7AOCfg%40mail.gmail.com.

Oleh Derevenko

unread,
Apr 30, 2024, 6:00:47 PMApr 30
to ode-...@googlegroups.com
Hi Gwentarino Kripperino lkjdsfa,

Alas, I can't see the problem you mentioned.




Oleh Derevenko

-- Skype with underscore

 



From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, April 10, 2024 3:45
To: ode-users <ode-...@googlegroups.com>
Subject: [ode-users] ODE test do not work when compiling single precision library
 
You don't often get email from redato...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.

Gwentarino Kripperino lkjdsfa

unread,
May 21, 2024, 7:19:02 PMMay 21
to ode-users
Sorry it h as been a while since I have checked this email. this is quite odd, perhaps I did something wrong while building ODE that caused this issue? If that's the case, it's not a huge deal, but I am curious as to what the error (as in, the difference between expected an actual) in those proximity test is on your end. No worries if you aren't interested in checking that.

Oleh Derevenko

unread,
May 22, 2024, 3:54:42 AMMay 22
to ode-...@googlegroups.com
In my sources there is no file named collision_point_depth.cpp and, naturally, there is no proximity test error value at all, nor there is any TOLERANCE  in it.


From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, May 22, 2024 2:19
To: ode-users <ode-...@googlegroups.com>
Subject: Re: [ode-users] ODE test do not work when compiling single precision library
 
You don't often get email from redato...@gmail.com. Learn why this is important
Sorry it h as been a while since I have checked this email. this is quite odd, perhaps I did something wrong while building ODE that caused this issue? If that's the case, it's not a huge deal, but I am curious as to what the error (as in, the difference between expected an actual) in those proximity test is on your end. No worries if you aren't interested in checking that.

On Tuesday, April 30, 2024 at 3:00:47 PM UTC-7 Oleh Derevenko wrote:
Hi Gwentarino Kripperino lkjdsfa,

Alas, I can't see the problem you mentioned.


Gwentarino Kripperino lkjdsfa

unread,
Jun 25, 2024, 7:59:46 PMJun 25
to ode-...@googlegroups.com
The sources in bitbucket have such a file
image.png

--
You received this message because you are subscribed to a topic in the Google Groups "ode-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ode-users/RKFsnL3fY0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/AS4PR07MB8899330D0DDD5FBAA3980F65DDEB2%40AS4PR07MB8899.eurprd07.prod.outlook.com.

Oleh Derevenko

unread,
Jun 26, 2024, 5:18:26 AMJun 26
to ode-...@googlegroups.com
Sorry. I had "0.16.x" branch checked out and there was no file in it. My mistake.
Now I see what you mean. I'll make the corrections after a while. Thank you.



From: ode-...@googlegroups.com <ode-...@googlegroups.com> on behalf of Gwentarino Kripperino lkjdsfa <redato...@gmail.com>
Sent: Wednesday, June 26, 2024 2:59
To: ode-...@googlegroups.com <ode-...@googlegroups.com>

Subject: Re: [ode-users] ODE test do not work when compiling single precision library
You don't often get email from redato...@gmail.com. Learn why this is important
The sources in bitbucket have such a file


Reply all
Reply to author
Forward
0 new messages