Stream: wasmtime

Topic: deterministic compilation


view this post on Zulip Ulan (Nov 24 2021 at 13:53):

Hi folks! If we compile the same Wasm program twice using the same Wasmtime binary, would you expect the resulting generated code to be the same (modulo the register names and absolute memory addresses).

If not, could you think of potential sources of non-determinism or non-determinisitc optimizations? For example, do some optimization perhaps depend on the time or pointer values?

view this post on Zulip bjorn3 (Nov 24 2021 at 14:08):

I would expect the actual compilation to be fully deterministic. Cranelift doesn't read the current time for anything other than reporting compilation times. It is possible that it depends on hashmap iteration order somewhere, but I would consider it a bug if it does.

view this post on Zulip Ulan (Nov 24 2021 at 14:12):

Thanks @bjorn3 ! That's great to hear.


Last updated: Oct 23 2024 at 20:03 UTC