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

Implement MVP implementation of Noir fuzz tests #5249

Open
2 tasks
TomAFrench opened this issue Jun 13, 2024 · 0 comments
Open
2 tasks

Implement MVP implementation of Noir fuzz tests #5249

TomAFrench opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
test harness Related to the testing of noir code through `nargo test`

Comments

@TomAFrench
Copy link
Member

TomAFrench commented Jun 13, 2024

We are currently using proptest to fuzz the ABI encoding code such that given an ABI, we can generate a set of plausible inputs for it. This provides a route for us to be able to perform fuzzing of Noir programs by hooking this up to the ACVM.

We can take a lot of inspiration from Foundry's fuzzing implementation as they use proptest to generate inputs as well so we can potentially reuse a fair amount of code: https://github.com/foundry-rs/foundry/blob/master/crates/evm/evm/src/executors/fuzz/mod.rs#L29

MVP Tasks

Once this is done, we can follow up with #5262

@TomAFrench TomAFrench self-assigned this Jun 14, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 18, 2024
# Description

## Problem\*

Step towards #5249 

## Summary\*

This PR adds a very simple fuzzer which can be used to find inputs to
Noir programs which fail to execute. The motivation for this is to
eventually allow `nargo test` to run on noir functions with arguments
and automatically fuzz them in a similar fashion to `forge test`.

It's currently very hit and miss on how quickly it can zero in on
failing cases. For example, the program below is near-unfuzzable
currently.

```rust
fn main(x: u32, y: u32) {
    assert(x != y);
}
```

## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [x] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@TomAFrench TomAFrench added the test harness Related to the testing of noir code through `nargo test` label Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test harness Related to the testing of noir code through `nargo test`
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant