-
Notifications
You must be signed in to change notification settings - Fork 285
irept: use single map for all named sub-nodes #3470
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
Conversation
kroening
commented
Nov 26, 2018
- Each commit message has a non-empty body, explaining why the change was made.
- n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
- n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
- Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
- My commit message includes data points confirming performance improvements (if claimed).
- My PR is restricted to a single feature or bugfix.
- n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.
tautschnig
left a comment
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 probably a very good idea, with two requests:
- The version number of goto binaries needs to be incremented.
- We need to do benchmarking, most likely this is a major improvement (it's just the
operator==that's of concern).
980ca13 to
ba355e2
Compare
|
The hash-container change suggests we'll always include comments in a particular irep's hashcode? In that case surely unordered_map will break as hash-code equality and operator== will disagree? |
ba355e2 to
95d4cac
Compare
|
@smowton Was still getting there; they now agree. |
ecb76e2 to
cfcc3ef
Compare
|
One more BTW @tautschnig : The goto-binary format is tolerant of this change (forwards and backwards), i.e., no need to tweak the version number for this. |
Thanks @kroening for helping me understand!
|
I will take care of benchmarking once CI passes. |
2d0273b to
ced9234
Compare
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: ced9234).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/92991087
tautschnig
left a comment
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.
With this change there is a desirable reduction in memory consumption, but also approximately 20% slowdown across all benchmarks. This additional time is spent in irept::number_of_non_comments. The two dominating causes of invoking this are 1) computing a hash - to be optimised away via HASH_CODE, and 2) sorting operands in expression simplification - see #1997 for removing it.
Overall I think we should work to enable this optimisation, but we have more work to do to avoid a performance regression.
ced9234 to
d202f7c
Compare
|
@tautschnig Many thanks -- I've just done a tweak that should reduce the cost of counting for the case of hashing. May I ask you to do another run? |
Running. |
| { | ||
| json_arrayt json_functions; | ||
| const json_irept no_comments_irep_converter(false); | ||
| const json_irept no_comments_irep_converter; |
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.
Does this still do what the name promises? If so, how?
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.
removed these changes
| // must be the same | ||
| INVARIANT(it1 != get_named_sub().end(), "not at end of get_named_sub()"); | ||
| INVARIANT( | ||
| it2 != i.get_named_sub().end(), "not at end of i.get_named_sub()"); |
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 should basically be the same code as irept::operator== but does extra checks and just overall looks a bit different. Maybe we can avoid this?
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.
could use compare() for both, but seems to be an unrelated change
| #include <algorithm> | ||
|
|
||
| /// To convert to JSON from an irep structure by recursively generating JSON | ||
| /// for the different sub trees. |
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 comment should actually go with the class, not with the constructor.
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: d202f7c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/93671584
6024861 to
df4dee0
Compare
df4dee0 to
31ab10a
Compare
allredj
left a comment
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 PR failed Diffblue compatibility checks (cbmc commit: 6024861).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/93968598
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
allredj
left a comment
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 PR failed Diffblue compatibility checks (cbmc commit: df4dee0).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/93969059
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 31ab10a).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/93970956
31ab10a to
6933585
Compare
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 6933585).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/95243811
6933585 to
48c40db
Compare
allredj
left a comment
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 48c40db).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/95336240
|
I am attaching the results for develop vs this branch on SV-COMP's ReachSafety-ECA category, which is the category where we spend the most time actually running symbolic execution (before handing the formula to the SAT solver). The difference is very small, but overall in favour of the proposed change. Some tasks are slower, some finish quicker. The total memory consumption is lower, as expected. |
