Closed
Description
At the moment it seems like there are two sources of nondeterminism in WASI:
- The random number generator, which is hardcoded to
swift_stdlib_random
- 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
Labels
No labels