IEEE754 should be completely deterministic Determinism - if you get the same answer for the same inputs and actions - is a different beast to algebraic equivalence Just ensure you do the same things in the same order and you won't have any problems On 13 January 2014 12:29, Alex <initrd.gz@xxxxxxxxx> wrote: > How hard is it to ensure floating point determinism in LuaJIT? > > I'm making a game engine in LuaJIT, and I was thinking about making a replay > system by storing the initial state and user input [1]. In order to use this > system though, the engine code must be deterministic, and apparently making > floating point operations deterministic is quite tricky, as algebraically > equivalent expressions may produce different results (ex. a/b may not equal > a*(1/b)). > > Is it worth trying to ensure floating point determinism in LuaJIT, or do the > optimizations and trace generation make it too hard or impossible? > > [1] > http://www.gamasutra.com/view/feature/2029/developing_your_own_replay_system.php > > -- > Sincerely, > Alex Parrill