LuaJIT and Floating Point Determinism

  • From: Alex <initrd.gz@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 13 Jan 2014 11:29:46 -0600

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

Other related posts: