Skip to content

Approximate float equality and other byproducts of MCA testing

While stress-testing ACTS using a Monte Carlo arithmetic-based tool (Verrou), I noticed that the unit tests often use exact equality on floating-point numbers, or equivalently compare the associated ostringstream printout in default format.

This is generally speaking not a very good idea, not only because it complicates this form of testing, but also because it constrains the ACTS implementation. If the computations starts to diverge a tiny bit from what the test does, then the test will fail even if the implementation is still correct (or even more accurate than before). So I moved to approximate equality instead. Maybe I did it too liberally though, you tell me.

Along the way, I also did a couple of minor refactorings which should improves ACTS' portability, compile times, numerical stability, and run-time performance.

There is one numerical instability which I did not manage to address yet, and merely annotated with a TODO, which is located in SurfaceArrayCreatorTests. If you want, I can WIP this MR until this one is resolved.

Edited by Hadrien Benjamin Grasland

Merge request reports