News for hackers. Stuff that matters.
Re:NSan: a floating-point numerical sanitizer by nestorD on Saturday February 20, 2021 @03:04AM (#26202474)
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 [1]: https://github.com/edf-hpc/verrou [2]: https://tel.archives-ouvertes.fr/tel-03116750

Re:NSan: a floating-point numerical sanitizer by nestorD on Saturday February 20, 2021 @08:15AM (#26203868)
People here might also be interested in the Julia implementation of Shaman: https://gitlab.com/numerical_shaman/shaman_julia
Re:NSan: a floating-point numerical sanitizer by Lemmih on Sunday February 21, 2021 @01:06AM (#26211222)
Loved your thesis. Will implement it in Haskell for use in hgeometry (https://hgeometry.org).
Re:NSan: a floating-point numerical sanitizer by nestorD on Sunday February 21, 2021 @02:58AM (#26211715)
Great! 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.
Re:NSan: a floating-point numerical sanitizer by Lemmih on Wednesday February 24, 2021 @07:26AM (#26249162)
No 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

Here's the documentation: https://noinia.github.io/hgeometry/doc/hgeometry-combinatori...