-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cranelift: Run verifier after optimizations during testing #6855
Comments
Isn't this just a missing |
Oh yeah, If we're already running it for all of the other passes we might as well run it for this one as well! |
Replacing the wasmtime/cranelift/codegen/src/context.rs Lines 348 to 367 in e250334
with self.verify_if(fisa) should do the trick, right?
|
Making the above change causes the following error to be displayed:
when
So looks like it works as expected. |
Yeah, That's pretty much it! Would you like to open a PR with that change? |
Yes, let me do that. |
👋 Hey
Feature
We should run the verifier after all of the optimization passes during testing, or when running via
clif-util
.Benefit
This would really improve the error messages for egraphs optimization authors.
Here's a recent example: #6851 (comment) these error messages are provided by the backends, but that really confuses things since what is really happening is that we are producing invalid CLIF in the mid end.
Both of those examples would have really neat error messages if they were produced by the verifier.
Implementation
We probably don't want to enable this by default since it will slow down the compilation pipeline.
On of my ideas on how to implement this would be to add a new flag (i.e.
run_verifier_after_opts
) that would be disabled by default but we could enable inclif-util
and in our test runner.I don't know if we already have a
do_extra_checks
flag, but we can also maybe use that one. Or we could maybe even useenable_verifier
itself.Alternatives
Running this in the fuzzer is also an option but I think the costs might outweigh the benefits. I'm not sure.
We can also not do this, and write down somewhere that it's a good idea to recompile the optimized code manually. I have previously started doing that after encountering weird issues, and this time it worked out.
The text was updated successfully, but these errors were encountered: