Skip to content

solvers: also link MiniSat2 options #3243

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

Closed
wants to merge 2 commits into from

Conversation

nmanthey
Copy link
Contributor

To be able to parse options again when setting up a solver, the
parseOption method has to be present. Hence, link against the
Options.cc file of MiniSat2 as well.

Signed-off-by: Norbert Manthey [email protected]

Note: For the current CBMC, nothing will change from a feature or performance perspective (except binary size). This change allows to exchange the existing MiniSat with other versions of that solver, especially https://github.com/conp-solutions/minisat. This fork comes with solver performance improvements, and which allows to specify SAT solver parameters via environment variable - to allow SAT solver tuning for CBMC more easily.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

To be able to parse options again when setting up a solver, the
parseOption method has to be present. Hence, link against the
Options.cc file of MiniSat2 as well.

Signed-off-by: Norbert Manthey <[email protected]>
CBMC compiles with more strict compiler warnings. To make the compiler
happy, extend the MiniSat patch to fix the Option.cc file as well.
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: add5598).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89574875
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.

@kroening
Copy link
Member

Is the change to minisat/utils/Options.cc useful?

@nmanthey
Copy link
Contributor Author

nmanthey commented Oct 31, 2018 via email

@kroening
Copy link
Member

Ah, that's the extra { } ?
But why does the file need to be touched in the first place?

@nmanthey
Copy link
Contributor Author

nmanthey commented Oct 31, 2018 via email

@kroening
Copy link
Member

Very happy to link in options.cc -- I am mostly wondering whether you can simply drop the "diff to the diff" for options.cc? (Also very happy to benchmark your Minisat fork, independently).

@nmanthey
Copy link
Contributor Author

nmanthey commented Oct 31, 2018 via email

@kroening
Copy link
Member

Ok, I would consider that a bug in the CI, and would prefer to merge without.

@nmanthey
Copy link
Contributor Author

nmanthey commented Oct 31, 2018 via email

@kroening
Copy link
Member

kroening commented Nov 5, 2018

@nmanthey BTW, does it make sense to point to your fork, eventually?
The diff is ever growing.

@nmanthey
Copy link
Contributor Author

nmanthey commented Nov 5, 2018

Sure, the fork lives here: https://github.com/conp-solutions/minisat

@martin-cs
Copy link
Collaborator

martin-cs commented Nov 5, 2018 via email

@peterschrammel
Copy link
Member

If desired, I can kick off a run with that version on http://svcomp.cprover.org/ to see what the performance impact is.

@nmanthey
Copy link
Contributor Author

nmanthey commented Nov 6, 2018

How to build with the my MiniSat fork as backend

I put a few commits on top of this one so that CBMC can be compiled with the other MiniSat. That actually required a few more changes, and would require MiniSat changes as well, so that you aggressive warnings are happy with my code extensions.

https://github.com/nmanthey/cbmc/tree/conps-minisat

The steps to build would be (re-)downloading the solver, which I turned into a git clone, and rebuilding cbmc, e.g.
cd src
make clean
make minisat2-download
make -j $(nproc)

Benchmarking

@peterschrammel I'm happy to give that solver a try wrt benchmarking. Is there a way I can evaluate further MiniSat changes with that system?

Moving Forward

I can merge the two branches into a single PR, if you want me to do that. I'll make it a separate WIP PR for now. The changes I did on the new branch should not go into CBMC right away. I'd more modify my MiniSat so that I do not have to disable Werror. That currently looks like 2 changes: disable warning for the 2 deprecated pieces of code, and adding a missing pair of brackets. Furthermore, you might not clone the master branch each time, but rather download or checkout a specific release. I need to find time to get the IPASIR interface into that fork, and could imagine turning that code into a release afterwards which could be consumed by you.

@nmanthey nmanthey mentioned this pull request Nov 6, 2018
6 tasks
@peterschrammel
Copy link
Member

peterschrammel commented Nov 6, 2018

Ideally, we should fork minisat into the org and maintain our patches there. This should make it easier to maintain the changes, test and run CI on development versions of it. We could even add a submodule for it if we want.

@martin-cs
Copy link
Collaborator

martin-cs commented Nov 6, 2018 via email

@nmanthey
Copy link
Contributor Author

nmanthey commented Nov 8, 2018

I also agree that for you it would be best if you have full control over the code you use. The only problem might be code duplication, as people who contribute to another MiniSat-fork might not automatically feed your MiniSat code - which also does not happen right now.

That being said, I am happy to reformat my MiniSat code base to an accepted code style, and motivate other groups working on related SAT solvers to do the same, so that rebasing and cherry-picking is more straight forward as it currently is.

@peterschrammel
Copy link
Member

Is there a way I can evaluate further MiniSat changes with that system?

@nmanthey, running on 9494ebe from your fork now.
You see the progress at http://svcomp.cprover.org (more detailed at http://svcomp.cprover.org/log or even more detailed at http://svcomp.cprover.org/log.txt). As soon as a category has finished it should appear as the rightmost column (2018-11-06) in the respective table. You can then click on Scatter Plot to compare the CPU time of two columns. Arrays and Bitvectors have finished - there are no significant differences. All 9 selected categories will take 2-3 days to finish.

@nmanthey
Copy link
Contributor Author

nmanthey commented Nov 9, 2018

Thanks. I guess I have to compare the very last column (my commit) against the one before, because that's the one I rebased on top?

@peterschrammel
Copy link
Member

peterschrammel commented Nov 14, 2018

From what I see so far last year's SV-COMP version is by far the fastest on larger benchmarks. We used Glucose there. I'll set up a run with Glucose so that we have a direct comparison between Minisat / tweaked Minisat / Glucose.

Side note: On average we spend only ~30% of the time in the SAT solver in SV-COMP. Disclaimer: this is for benchmarks that don't time out only.

@nmanthey
Copy link
Contributor Author

I did not know Glucose is the better solver. I wonder why it's not enabled by default then.

Note sure whether this should be discussed in this PR, or should be moved into a separate issue, but as we started here, I'll keep it here:
The modifications I did to MiniSat are not in Glucose either, so I could try to port them there if that helps the overall performance - if I find some free time for this. That being said, would it be possible to submit 2 variants with a different SAT backend?

Do you know where the time outs come from? I remember some profiling output from Michael which indicated that SAT preprocessing can consume quite a bit of run time, but disabling preprocessing makes the overall performance worse. Does that statement still hold?

@peterschrammel peterschrammel mentioned this pull request Apr 3, 2019
7 tasks
@TGWDB
Copy link
Contributor

TGWDB commented May 19, 2021

@nmanthey Is this going to be revisited/updated? It looks like the PR was approved and probably still works. There were some recent PRs (e.g. #6075 #6031) that built support for more SAT solvers and having tuning for MiniSAT would be a nice addition,

@martin-cs
Copy link
Collaborator

@conp-solutions

@NlightNFotis
Copy link
Contributor

Closing this in favour of #6783 (same commits, rebased on top of develop.)

Any other discussion on this, please feel free to add to the newer PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants