Skip to content

Conversation

@kroening
Copy link
Collaborator

  • 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.

Copy link
Collaborator

@tautschnig tautschnig left a 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:

  1. The version number of goto binaries needs to be incremented.
  2. We need to do benchmarking, most likely this is a major improvement (it's just the operator== that's of concern).

@kroening kroening force-pushed the irep-with-single-map branch from 980ca13 to ba355e2 Compare November 26, 2018 23:59
@smowton
Copy link
Contributor

smowton commented Nov 27, 2018

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?

@kroening kroening force-pushed the irep-with-single-map branch from ba355e2 to 95d4cac Compare November 27, 2018 11:38
@kroening
Copy link
Collaborator Author

@smowton Was still getting there; they now agree.

@kroening kroening force-pushed the irep-with-single-map branch 2 times, most recently from ecb76e2 to cfcc3ef Compare November 27, 2018 11:46
@kroening
Copy link
Collaborator Author

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.

@tautschnig tautschnig dismissed their stale review November 27, 2018 13:16

Thanks @kroening for helping me understand!

@tautschnig
Copy link
Collaborator

I will take care of benchmarking once CI passes.

@tautschnig tautschnig added the Needs data This PR claims improvements that require further data to substantiate the claims. label Nov 27, 2018
@kroening kroening force-pushed the irep-with-single-map branch 5 times, most recently from 2d0273b to ced9234 Compare November 29, 2018 10:43
Copy link
Contributor

@allredj allredj left a 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 tautschnig self-assigned this Dec 1, 2018
Copy link
Collaborator

@tautschnig tautschnig left a 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.

@kroening kroening force-pushed the irep-with-single-map branch from ced9234 to d202f7c Compare December 5, 2018 12:55
@kroening
Copy link
Collaborator Author

kroening commented Dec 5, 2018

@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?

@tautschnig
Copy link
Collaborator

May I ask you to do another run?

Running.

@tautschnig
Copy link
Collaborator

screen shot 2018-12-05 at 13 55 56

That's the quantile plot for ReachSafety-BitVectors - it seems the new version is back en par with develop.

{
json_arrayt json_functions;
const json_irept no_comments_irep_converter(false);
const json_irept no_comments_irep_converter;
Copy link
Collaborator

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?

Copy link
Collaborator Author

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()");
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.
Copy link
Collaborator

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.

Copy link
Contributor

@allredj allredj left a 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

@kroening kroening force-pushed the irep-with-single-map branch 2 times, most recently from 6024861 to df4dee0 Compare December 7, 2018 08:24
@kroening kroening removed Needs data This PR claims improvements that require further data to substantiate the claims. work in progress labels Dec 7, 2018
@kroening kroening force-pushed the irep-with-single-map branch from df4dee0 to 31ab10a Compare December 7, 2018 08:51
Copy link
Contributor

@allredj allredj left a 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.

Copy link
Contributor

@allredj allredj left a 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.

Copy link
Contributor

@allredj allredj left a 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

Copy link
Contributor

@allredj allredj left a 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

Copy link
Contributor

@allredj allredj left a 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

@tautschnig
Copy link
Collaborator

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.

@tautschnig tautschnig merged commit 0ebc228 into develop Dec 20, 2018
@tautschnig tautschnig deleted the irep-with-single-map branch December 20, 2018 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants