bytecodealliance / bytecodealliance/wasmtime
Add support for gathering code coverage via instrumenting emitted code
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 121
Description
### Summary
Add the ability to insert instrumentation to track code coverage.
### Motivation
Besides the usual benefits for users who are interested in the code coverage of their own tests or what have you, this could help greatly improve our own testing and fuzzing infrastructure for Cranelift itself.
See [Finding Deep Compiler Bugs via Guided Stochastic Program Mutation by Le et al](https://web.cs.ucdavis.edu/~su/publications/oopsla15-compiler.pdf), for example, where they:
* Find statically-reachable, but dynamically-unexecuted-for-some-inputs code
* Randomly mutate that code
* Re-compile and re-run the program over those same inputs
* Assert that the observable results are equivalent
This should help us find weird, unique bugs that differential fuzzing between cranelift optimized vs cranelift un-optimized or cranelift vs baldrmonkey or cranelift vs lightbeam on random test cases are unlikely to discover.
Contributor guide
Assessment
This issue has not been assessed yet.