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

Call to scGeneralizeExts in crucible_llvm_verify is a performance bottleneck #626

Closed
brianhuffman opened this issue Jan 11, 2020 · 1 comment · Fixed by #629
Closed

Call to scGeneralizeExts in crucible_llvm_verify is a performance bottleneck #626

brianhuffman opened this issue Jan 11, 2020 · 1 comment · Fixed by #629
Labels
performance Issues that involve or include performance problems subsystem: crucible-jvm Issues related to Java verification with crucible-jvm subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm

Comments

@brianhuffman
Copy link
Contributor

Profiling shows that on some proof goals (some of the s2n proofs in particular), the following call to scGeneralizeExts takes up a significant portion of the total runtime of crucible_llvm_verify:

goal' <- io $ scGeneralizeExts sc (getAllExts goal) =<< scEqTrue sc goal

There is also similar call to scGeneralizeExts in crucible_jvm_verify:

goal' <- io $ scGeneralizeExts sc (getAllExts goal) =<< scEqTrue sc goal

The purpose of scGeneralizeExts is simply to convert external constants into local variables, which the saw backends were initially designed to handle. Instead of doing this possibly-expensive pre-processing step, we should just make sure that the various saw-core simulator backends can handle external constants in the same way that they handle local variables.

@brianhuffman brianhuffman added subsystem: crucible-jvm Issues related to Java verification with crucible-jvm subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm performance Issues that involve or include performance problems labels Jan 11, 2020
@robdockins
Copy link
Contributor

Indeed, there are some places where we close over all the external constants, only to immediately open them up again with fresh constants, or vice versa. We should change the convention so that provers accept external constants also (or, maybe better, instead of) lambda-bound variables.

This would also make it significantly easier to do some of the things we want to do with counterexamples. I ran into trouble trying to work on this before because tracking the identity of the free variables is very difficult when they get abstracted into lambdas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues that involve or include performance problems subsystem: crucible-jvm Issues related to Java verification with crucible-jvm subsystem: crucible-llvm Issues related to LLVM bitcode verification with crucible-llvm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants