4 ms·
I am not familiar with NSan (and impatient to read the paper) but a common problem with tools based on higher precision shadow values is that they can be easily
by nestorD 6y ago
I am not familiar with NSan (and impatient to read the paper) but a common problem with tools based on higher precision shadow values is that they can be easily defeated by a large cancelation (`(1e200 + 1) - 1e200` will return 0 in both 64 and 200 bits arithmteic).
My solution to this problem (which also has performance benefits) is to use an error-free transform based arithmetic (they give you roughly doubled precision but are also very resilient to cancelation).
See Shaman [0] for a C++ reference implementation, you can change your types and it will display only the significant digits of your results.
If you want something that does not require modifying your source code, I would recommend Verrou [1], a Valgrind-based tool using stochastic arithmetic.
For those interested in the subject, my PhD [1] (which is written in English despite the French title) gives further information on all those methods, their pros and cons.
[0]: https://gitlab.com/numerical_shaman/shaman https://gitlab.com/numerical_shaman/shaman
[1]: https://github.com/edf-hpc/verrou https://github.com/edf-hpc/verrou
[2]: https://tel.archives-ouvertes.fr/tel-03116750 https://tel.archives-ouvertes.fr/tel-03116750
- nestorD 6y agoPeople here might also be interested in the Julia implementation of Shaman: https://gitlab.com/numerical_shaman/shaman_julia https://gitlab.com/numerical_shaman/shaman_julia
- Lemmih 6y agoLoved your thesis. Will implement it in Haskell for use in hgeometry (https://hgeometry.org https://hgeometry.org).
- nestorD 6y agoGreat! Don't hesitate to contact me if you have any question or roadblock. I would be happy to give a link to your implementation in the readme of the C++ reference implementation.
- Lemmih 6y agoNo roadblocks but I did find something I didn't expect. Turns out that 'sinl(pi)' differs on Linux and macosx. I'm getting error-bounds that are slightly different. Here's the PR for my Haskell implementation: https://github.com/noinia/hgeometry/pull/120 https://github.com/noinia/hgeometry/pull/120 Here's the documentation: https://noinia.github.io/hgeometry/doc/hgeometry-combinatorial-0.11.0.0/Data-Double-Shaman.html https://noinia.github.io/hgeometry/doc/hgeometry-combinatori...