-
Notifications
You must be signed in to change notification settings - Fork 100
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
Goto binary serialization #2205
Goto binary serialization #2205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so excited about this change! Thank you! Have you measured the performance improvement yet?
I haven't had time to review the serialization code yet.
I'm assuming you are planning to add a test as soon as the CBMC PR gets merged and released. If you don't mind, I'll block the merge till then.
Serializing to GOTO binary seems to be as at least as fast or faster than when serializing to JSON, and we completely skip symtab2gb.
The module has its own internal tests that run at every build. As long as this is not used as default, would it be a good idea to have CI run the full regression suite a second time with GOTO binary output enabled (as done for the "unsound_experiments" feature) ? I could add a couple of tests that specifically activate the switch but this would not be much compared to running the full regression suite. |
We would like to know about memory consumption as well. In fact, the biggest problem with |
some performance metrics measured when running
crate
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @remi-delmas-3000! Looks very promising! I have a few comments.
0d8adb0
to
3bb7e3a
Compare
@celinval @zhassan-aws @adpaco-aws Update: the PR diffblue/cbmc#7534 that allows CBMC to load the binaries produced by Kani has been merged, can we consider merging this one now too ? |
That's great! Can you please add some tests to the PR? One suggestion is to create a new CI job that runs all tests using the new mode. What would be the next steps for enabling this logic by default? |
Do we need to wait for a new CBMC release? Yes I think we do. |
3f193d1
to
5fa1074
Compare
This is now final, but depends on #2221 for the regression run to pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing, but a couple of initial comments.
5fa1074
to
bad2ab7
Compare
@celinval can we unblock it now that regression tests are in place? |
ca968b8
to
893cf3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @remi-delmas-3000! Mostly minor comments.
489a88f
to
636c708
Compare
636c708
to
ca1c323
Compare
The latest commit makes goto binary export the default, adds a switch |
Update Cargo.lock with memuse
Modified `call_single_file.rs` so that write_goto_binary can be enabled by defining the KANI_ENABLE_WRITE_GOTO_BINARY env variable.
When `--write-goto-binary` is used, JSON symtab files are not produced, so we should not rely on them. For `--gen-c` we now store the `name` to `prettyName` mapping in its own JSON `ArtifactType::PrettyNameMap`. For `--function`, we modify `CargoOutputs` so that it tracks GOTO symtabs instead of JSON symtabs.
- add CLI flag to reenable JSON symtab - add compile-time feature to force JSON symtabs
ca1c323
to
57c38bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few notes... Thanks for doing this
2e07744
to
ffd7f0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. It's such a great improvement. Thanks for doing this. As I mentioned offline, I'm happy to merge this as is and we can prune it as we go.
The last commit is from #2221 which is needed for regression runs to pass (will be cleaned up on rebase).
Description of changes:
This adds a new output mode
--enable-unstable --write-goto-binary
that produces the symbol table a goto binary instead of a JSON file, and skips the invocation ofsymtab2gb
.The new serializer uses value numbering to share identical strings and nodes in the binary file.
This feature depends on this CBMC PR diffblue/cbmc#7534, that makes it possible to load a goto binary produced by a different tool that may number strings differently from how CBMC numbers them.
Resolved issues:
Symtab2gb
causes some noticeable overhead.cprover_bindings
#2074Call-outs:
The build scripts still need to be updated so that the feature is tested as part of regression runs (help needed).
Testing:
No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.