Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorMartin Hořeňovský2024-02-17 11:01:43 +0100
committerMartin Hořeňovský2024-02-19 15:02:11 +0100
commit28c2f0b0c2f2793f2432b55bd14282aaadd7509f (patch)
tree986c77004a69de238b7524ec80c759d7e4891e4d /docs
parent2e1b02a0e2cba7ce4acb615a3dd77c085ed7a712 (diff)
downloadcatch3-28c2f0b0c2f2793f2432b55bd14282aaadd7509f.tar.gz
Mention x87 and ffast-math breaking FP random gen reproducibility
Diffstat (limited to 'docs')
-rw-r--r--docs/generators.md26
1 files changed, 20 insertions, 6 deletions
diff --git a/docs/generators.md b/docs/generators.md
index 8bca54c7..eb1a255a 100644
--- a/docs/generators.md
+++ b/docs/generators.md
@@ -206,12 +206,26 @@ or OO ranges.
Unlike `std::uniform_int_distribution`, Catch2's generators also support
various single-byte integral types, such as `char` or `bool`.
-Given the same seed, the output from the integral generators is
-reproducible across different platforms. For floating point generators,
-we only promise reproducibility on platforms that obey the IEEE 754
-standard, and where `float` is 4 bytes and `double` is 8 bytes. We provide
-no guarantees for `long double`, as the internals of `long double` can
-vary wildly across different platforms.
+
+#### Reproducibility
+
+Given the same seed, the output from the integral generators is fully
+reproducible across different platforms.
+
+For floating point generators, the situation is much more complex.
+Generally Catch2 only promises reproducibility (or even just correctness!)
+on platforms that obey the IEEE-754 standard. Furthermore, reproducibility
+only applies between binaries that perform floating point math in the
+same way, e.g. if you compile a binary targetting the x87 FPU and another
+one targetting SSE2 for floating point math, their results will vary.
+Similarly, binaries compiled with compiler flags that relax the IEEE-754
+adherence, e.g. `-ffast-math`, might provide different results than those
+compiled for strict IEEE-754 adherence.
+
+Finally, we provide zero guarantees on the reproducibility of generating
+`long double`s, as the internals of `long double` varies across different
+platforms.
+
## Generator interface