0

I have the need to make a fully automated test server for a game we are making, but to keep it reliable we need full floating point determinism. We also want to be able to move our server from one physical machine to another.

Is it possible to achieve the above by making and running our tests inside a tightly controlled VM that we can pass around very different physical machines?

David Rochin
  • 317
  • 3
  • 11
  • 2
    It depends on how the VM does floating point math: does it emulate in software (maybe deterministic but very slow) or pass it through to the hardware (no improvement in determinism)? Different kinds of VMs do it in different ways. – Nate Eldredge Feb 25 '21 at 00:15
  • What are the sources of nondeterminism and why would they be different in a VM? Is your game timing dependent in any way, such as from player inputs or network communications? Will those be made deterministic in the VM? Does your game spawn multiple threads that affect floating-point calculations? Will those threads be deterministic in the VM? – Eric Postpischil Feb 25 '21 at 01:24
  • 1. In my case, I believe non-determinism comes from CPU floating point optimizations. 2. Yes, timing of inputs is really important since it's a fast skill-based multiplayer game. 3. That's my question. 4. The game itself is mostly single-threaded (Unity). I don't spawn threads for anything myself. 5. That's my question. – David Rochin Feb 25 '21 at 06:30
  • 1
    (1) What “CPU floating point optimizations”? CPUs are mechanical in the arithmetic functions they perform (perhaps not mechanical in timings that arise from external interrupts, but whether they perform some IEEE-754 specified multiplication or something else is deterministic). If you mean optimizations that the compiler puts into the generated code, then that code will be the same whether it is in a virtual machine or not. – Eric Postpischil Feb 25 '21 at 12:44
  • 1
    (3) If your floating-point operations are dependent on timing from user inputs, they will remain dependent in a virtual machine. Generally, you cannot expect a virtual machine to provide deterministic timings of inputs. Inside the virtual machine, the operating system is still time-sharing the processor(s) between processes, receiving and processing external inputs, and doing other things that are subject to variations in timings. – Eric Postpischil Feb 25 '21 at 12:45

0 Answers0