Skip to content

Conversation

@dgohman-fastly
Copy link
Contributor

The Wasm spec defines several relaxed SIMD instructions, which are permitted to have nondeterministic results, in order to accommodate differences between hardware CPU architectures. However, rather than being fully nondeterministic, it requires them to be deterministic within a run of a program, so that programs can assume that whatever behavior they see the first time they use a relaxed SIMD instruction will continue to be the behavior for the rest of the run of the program.

Fastly's Compute platform makes use of snapshotting using wizer to optimize program startup times. This involves running the program initialization on one machine, snapshotting the program, and then resuming the program on another. To ensure that the relaxed SIMD instructions don't change behavior across the snapshot and resume, enable the deterministic lowerings.

The Wasm spec defines several [relaxed SIMD instructions], which are
permitted to have nondeterministic results, in order to accommodate
differences between hardware CPU architectures. However, rather than
being fully nondeterministic, it requires them to be deterministic
within a run of a program, so that programs can assume that whatever
behavior they see the first time they use a relaxed SIMD instruction
will continue to be the behavior for the rest of the run of the
program.

Fastly's Compute platform makes use of snapshotting using [wizer] to
optimize program startup times. This involves running the program
initialization on one machine, snapshotting the program, and then
resuming the program on another. To ensure that the relaxed SIMD
instructions don't change behavior across the snapshot and resume,
enable the deterministic lowerings.

[relaxed SIMD instructions]: https://webassembly.github.io/spec/core/exec/numerics.html#relaxed-operations
[wizer]: https://github.com/bytecodealliance/wizer
@dgohman-fastly dgohman-fastly force-pushed the dgohman-fastly/relaxed-simd-deterministic branch from a6451b6 to d03fb04 Compare October 7, 2025 18:14
@dgohman-fastly dgohman-fastly merged commit 24f796f into main Oct 16, 2025
13 checks passed
@dgohman-fastly dgohman-fastly deleted the dgohman-fastly/relaxed-simd-deterministic branch October 16, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants