bytecodealliance / bytecodealliance/wasmtime
Enable the regalloc checker in testsuites
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
👋 Hey,
This was brought up yesterday in the cranelift meeting, and I'm filing this mostly so we don't forget.
#### Feature
Enable the cranelift `regalloc_checker` flag in our test suites.
The concrete testsuites I'm thinking are the `filetests` testsuite for cranelift, and the `spec_testsuite` for wasm. However if we can get others then that would be great too.
#### Benefit
This would have caught #4969 earlier and potentially other regalloc issues in the future.
#### Implementation
I'm most familiar with `filetests` and at least in the `compile` and `run` tests we can "clone" the flags requested by the tests and force enable `regalloc_checker`. I'm not too sure about `spec_testsuite` but maybe something similar would work too?
Something that was brought up at the meeting was the performance of `regalloc_checker`, we should probably make sure that the testsuites don't become too slow.
#### Alternatives
#### Make it a default flag
@cfallin mentioned this yesterday with the additional note that the regalloc checker was never built for speed so it would probably have a somewhat large downside. This matches what I've seen when trying to fuzz it.
#### Run it only during fuzzing
I played around with this in the `cranelift-fuzzgen` fuzzer, and the preliminary results aren't great.
In the sample run that I usually do (~90k inputs), with regalloc checker we run at 10 execs / sec and without we get 26 execs / sec. The other alternative that I've been thinking is running with regalloc checker only x% of the time although that is still a WIP.
cc: @cfallin @jameysharp @uweigand
Contributor guide
Assessment
This issue has not been assessed yet.