> On Tue, Sep 14, 2021 at 08:07:19AM -0700, Andres Freund wrote: > > >Yeah. As far as the hardware goes, if you have the same endianness, > >struct alignment rules, and floating-point format [1], then physical > >replication ought to work. Where things get far stickier is if the > >operating systems aren't identical, because then you have very great > >risk of text sorting rules not being the same, leading to index > >corruption [2]. In modern practice that tends to be a bigger issue > >than the hardware, and we don't have any goo d way to check for it. > > I'd also be worried about subtle changes in floating point math results, and > that subsequently leading to index mismatches. Be that because the hardware > gives differing results, or because libc differences.
The question about hardware side I find interesting, as at least in Armv-8 case there are claims to be fully IEEE 754 compliant [1]. From what I see some parts, which are not specified in this standard, are also implemented similarly on Arm and x86 ([2], [3]). On top of that many compilers implement at least partial level of IEEE 754 compliance (e.g. for gcc [4]) by default. The only strange difference I found is x87 FPU unit (without no SEE2, see [5]), but I'm not sure what could be consequences of extra precision here. All in all sounds like at least from the hardware perspective in case of Arm chances for having subtle differences in floating point math are small -- do I miss anything? [1]: https://developer.arm.com/architectures/instruction-sets/floating-point [2]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format#Single-precision_examples [3]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format [4]: https://gcc.gnu.org/wiki/FloatingPointMath [5]: https://gcc.gnu.org/wiki/x87note