▲ | bee_rider 3 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
I like these. They are push back against the sort of… first correction that people make when encountering floating point weirdness. That is, the first mistake we make is to treat floats as reals, and then we observe some odd rounding behavior. The second mistake we make is to treat the rounding events as random. A nice thing about IEEE floats is that the rounding behavior is well defined. Often it doesn't matter, like you ask for a gemm and you get whatever order of operations blas, AVX-whatever, and OpenMP conspire to give you, so it is more-or-less random. But if it does matter, the ability to define it is there. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | jandrese 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
> A nice thing about IEEE floats is that the rounding behavior is well defined. Until it isn't. I used to play the CodeWeavers port of Kohan and while the game would allow you to do crossplay between Windows and Linux, differences in how the two OSes rounded floats would cause the game to desynchronize after 15-20 minutes of play or so. Some unit's pathfinding algorithm would zig on Windows and zag on Linux, causing the state to diverge and end up kicking off one of the players. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | zahlman 2 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
On the other hand, it feels wrong to me to call these "myths" when they are really just simplifications. (And I have heard of the 80-bit internal register thing described in https://news.ycombinator.com/item?id=44888692 causing real problems for people before. And --ffast-math is basically spooky action at a distance considering how it bleeds into the entire program; see e.g. https://moyix.blogspot.com/2022/09/someones-been-messing-wit....) |