Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzz the compiler with a non-trivial code but not overly complex #214

Open
greenhat opened this issue Jun 18, 2024 · 2 comments
Open

Fuzz the compiler with a non-trivial code but not overly complex #214

greenhat opened this issue Jun 18, 2024 · 2 comments
Assignees
Labels

Comments

@greenhat
Copy link
Contributor

Motivation

To fill the gap between manually written Wasm (too simple) and Rust programs using the malloc (too complex to debug) in our tests. We need something in the middle to cover a non-trivial control flow and memory ops (byte vs. word memory addressing), etc.

Implementation details

Generate the Wasm code with wasm-smith, compile it to MASM and run them both, comparing the runtime state (stack, memory) afterward.

@greenhat greenhat added this to the Beta 1 milestone Jun 18, 2024
@greenhat greenhat self-assigned this Jun 18, 2024
@greenhat
Copy link
Contributor Author

There is also Wasmlike paper at https://news.ycombinator.com/item?id=36992222 to generate the semantically valid Wasm programs.

@greenhat
Copy link
Contributor Author

@bitwalker While working on #219, I discovered a few blockers of using the wasm-smith to test Miden compiler.

The following is a list of the blockers that prevent using the wasm-smith to test the Miden compiler:

  • Introduce a notion of an "allowed" types to avoid using float types in the generated code (function arguments, return values, etc.).
  • Split InstructionKind::Numeric into the integer and float variants to avoid using float types in the generated code.
  • Introduce a notion of an "allowed/forbidden" instructions to avoid using (yet) Miden unsupported Wasm instructions in the generated code.

We could implement them in the wasm-smith and either push them upstream or maintain our fork.

@greenhat greenhat changed the title Fuzz the compiler with a non-trivial code which is not overly complex Fuzz the compiler with a non-trivial code but not overly complex Aug 8, 2024
@bitwalker bitwalker removed this from the Beta 1 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants