bytecodealliance / bytecodealliance/wasmtime

Add support for gathering code coverage via instrumenting emitted code

Open
#1,151 8 comments 2 reactions 0 assignees View on GitHub
cranelift enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.