How is deterministic execution of WebAssembly ensured?

Hi there. I am an engineer at DFINITY and want to share an answer to one of frequently asked questions: “How do we ensure that the WebAssembly code in canisters runs deterministically?”

The sources of nondeterminism in WebAssembly are known and listed here:

We disable features that may lead to nondeterminism. Specifically:

  • Threads are disabled.
  • SIMD instructions are disabled. In the future we may enable deterministic parts of SIMD.
  • Floating-point NaN values are canonicalized.