Hi,

Floating points operations are not deterministic. That means that the 
same computation can give different results because it has been built 
with different compilers, with different options. But even running the 
same binary on a different CPU may give you different results : by 
default, x86 uses 80 bits internal precision while x86_64 uses 64 bits 
internal precision, there may have differences in the mathematic library 
installed on different systems. You can find some explanations here for 
instance [1].

There is no good way to make portable code (remember that Wormux runs on 
x86, x86_64, sparc, arm, ...) making deterministic computation.

In fact, there are merely 3 solutions :
a/ force operations precision in a portable way, but it is not that 
easy. [2]
b/ do not use floating points operation at all. That means relying of 
fixed point integers or using a deterministic floating point library 
such as streflop [3]
c/ support non deterministic computation. That means that we have to 
resync from times to times. This is how some other games do [4], of 
course, we are not the first to face the problem. This is how it works 
before Wormux 0.9.0 but it was far from perfect since it was hiding some 
bugs (mostly due to bad use of random generator).

 From my point of view, we have to re-add synchronizations, at least in 
release mode. Anyway, what has been done for 0.9.0 was useful and we 
must find way to not hide bugs with synchronization.

Regards,

Matt (gentildemon)


[1] 
http://blogs.msdn.com/shawnhar/archive/2009/03/25/is-floating-point-math-deterministic.aspx
[2] http://www.christian-seiler.de/projekte/fpmath/
[3] 
http://nicolas.brodu.numerimoire.net/en/programmation/streflop/index.html
[4] http://springrts.com/wiki/Syncing_System

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à