fuzz: improve the spec interpreter (#4881)* fuzz: improve the API of the `wasm-spec-interpreter` crate This change addresses key parts of #4852 by improving the bindings to the OCaml spec inter
fuzz: improve the spec interpreter (#4881)* fuzz: improve the API of the `wasm-spec-interpreter` crate This change addresses key parts of #4852 by improving the bindings to the OCaml spec interpreter. The new API allows users to `instantiate` a module, `interpret` named functions on that instance, and `export` globals and memories from that instance. This currently leaves the existing implementation ("instantiate and interpret the first function in a module") present under a new name: `interpret_legacy`. * fuzz: adapt the differential spec engine to the new API This removes the legacy uses in the differential spec engine, replacing them with the new `instantiate`-`interpret`-`export` API from the `wasm-spec-interpreter` crate. * fix: make instance access thread-safe This changes the OCaml-side definition of the instance so that each instance carries round a reference to a "global store" that's specific to that instantiation. Because everything is updated by reference there should be no visible behavioural change on the Rust side, apart from everything suddenly being thread-safe (modulo the fact that access to the OCaml runtime still needs to be locked). This fix will need to be generalised slightly in future if we want to allow multiple modules to be instantiated in the same store. Co-authored-by: conrad-watt <[email protected]> Co-authored-by: Alex Crichton <[email protected]>
show more ...
[fuzz] Fix order of operands passed in to `wasm-spec-interpreter` (#4672)In #4671, the meta-differential fuzz target was finding errors when running certain Wasm modules (specifically `shr_s` in t
[fuzz] Fix order of operands passed in to `wasm-spec-interpreter` (#4672)In #4671, the meta-differential fuzz target was finding errors when running certain Wasm modules (specifically `shr_s` in that case). @conrad-watt diagnosed the issue as a missing reversal in the operands passed to the spec interpreter. This change fixes #4671 and adds an additional unit test to keep it fixed.
support SIMD fuzzing in reference interpreter (#3980)* support SIMD fuzzing in reference interpreter * formatting
Fuzzing against verified fork of spec interpreter (#3843)* Revert "Remove spec interpreter fuzz target temporarily (#3399)" This reverts commit 25d3fa4d7b944b4341928a401c57feaaa0ce3c35. * add
Fuzzing against verified fork of spec interpreter (#3843)* Revert "Remove spec interpreter fuzz target temporarily (#3399)" This reverts commit 25d3fa4d7b944b4341928a401c57feaaa0ce3c35. * add support for differential fuzzing against verified OCaml interpreter * formatting * comments * fix missing dep case * fix build error * fix unit tests? * restore previous differential_v8 max_table config * attempt: add OCaml deps * fix interpeter github repo * fix spec repo url * fix zarith package * fix unit test
Add a crate to interface with the WebAssembly spec interpreterThe WebAssembly spec interpreter is written in OCaml and the new crateuses `ocaml-interop` along with a small OCaml wrapper to interpr
Add a crate to interface with the WebAssembly spec interpreterThe WebAssembly spec interpreter is written in OCaml and the new crateuses `ocaml-interop` along with a small OCaml wrapper to interpret Wasmmodules in-process. The build process for this crate is currentlyLinux-specific: it requires several OCaml packages (e.g. `apt install -yocaml-nox ocamlbuild`) as well as `make`, `cp`, and `ar`.