Skip to content

Make WASI deterministic #84

Closed
Closed
@kabiroberai

Description

@kabiroberai

At the moment it seems like there are two sources of nondeterminism in WASI:

  1. The random number generator, which is hardcoded to swift_stdlib_random
  2. The clocks, hardcoded to the real system clocks

What if we allowed these to be overridden by user-provided Swift.RandomNumberGenerator and Swift.Clock types respectively? We could default to SystemRandomNumberGenerator and ContinuousClock + SuspendingClock.

To my understanding, enabling these to be overridden would allow for fully deterministic execution of WASI binaries while also serving as Dependency Injection points for solid testability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions