michael-weigelt requested wasmtime-core-reviewers for a review on PR #9947.
michael-weigelt opened PR #9947 from michael-weigelt:mwe/deterministic_validation
to bytecodealliance:main
:
If a Wasm binary is invalid in several ways, parallel compilation will return a non-deterministic result. We would like to get a deterministic result even in the presence of multiple errors.
This PR addresses that by first materializing all validation results and then returning the first error, if any ('first' with regard to the order of the input vector).
The downside is that we cannot return early when an error is encountered. This slows down the validation for invalid binaries. Since that is not the happy path anyway, I propose to accept the slowdown.
The provided test does not prove determinism, which is hard to do. But it gives _some_ confidence and ensures the behaviour of parallel and sequential compilation do not deviate.
michael-weigelt requested alexcrichton for a review on PR #9947.
michael-weigelt edited PR #9947:
If a Wasm binary is invalid in several ways, parallel compilation will return a non-deterministic result. We would like to get a deterministic result even in the presence of multiple errors.
This PR addresses that by first materializing all validation results and then returning the first error, if any ('first' with regard to the order of the input vector).
The downside is that we cannot return early when an error is encountered. This slows down the validation for invalid binaries. Since that is not the happy path anyway, I propose to accept the slowdown.
The provided test does not prove determinism, which is hard to do. But it gives _some_ confidence and ensures the behaviours of parallel and sequential compilation do not deviate.
alexcrichton submitted PR review:
Thanks for this!
alexcrichton commented on PR #9947:
Ah the timeout there looks like the new
validate_deterministic
test is taking awhile in miri, so mind putting#[cfg(not(miri))]
on the test?
alexcrichton commented on PR #9947:
er, actually,
#[cfg_attr(miri, ignore)]
would probably be better
michael-weigelt updated PR #9947.
michael-weigelt updated PR #9947.
michael-weigelt commented on PR #9947:
@alexcrichton done, and I made the test smaller too.
alexcrichton merged PR #9947.
Last updated: Jan 24 2025 at 00:11 UTC