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

Add support for MergeSat #6439

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Nov 4, 2021

Adds support for MergeSat.

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

@codecov
Copy link

codecov bot commented Nov 4, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (52688d7) 79.09% compared to head (eb291f9) 79.09%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6439   +/-   ##
========================================
  Coverage    79.09%   79.09%           
========================================
  Files         1701     1701           
  Lines       196625   196625           
========================================
  Hits        155527   155527           
  Misses       41098    41098           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tautschnig tautschnig force-pushed the mergesat branch 3 times, most recently from 8668397 to ee3fd8c Compare November 4, 2021 12:45
@kroening
Copy link
Member

kroening commented Nov 4, 2021

I believe this is the only solver that uses the minisat identifiers (that isn't minisat). I may be worth adding some comments to make that apparent.

@tautschnig
Copy link
Collaborator Author

I believe this is the only solver that uses the minisat identifiers (that isn't minisat). I may be worth adding some comments to make that apparent.

Yes, good call! Where would you see the most natural place to find such comments (as a developer)?

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle I don't see a problem.

src/solvers/sat/satcheck_minisat2.cpp Outdated Show resolved Hide resolved
scripts/mergesat.patch Outdated Show resolved Hide resolved
@nmanthey
Copy link
Contributor

nmanthey commented Nov 5, 2021

Thanks for picking this up. Let me know if there is anything on the SAT side to look at (except your PR)

@tautschnig tautschnig self-assigned this Nov 17, 2021
@tautschnig tautschnig force-pushed the mergesat branch 2 times, most recently from c1d9942 to 74411eb Compare April 26, 2022 12:40
@tautschnig
Copy link
Collaborator Author

IIUC, this variable needs to be set before the solver object is created. Have you checked whether this setting is actually passed through to the solver?

It might be simpler to always start from the SimpSolver object, and set the "use_simplification" parameter right after constructing the object, to indicate whether you want to have simplification or not. Then, you can also set the member behind the option you use in setenv, as this is always available as well. That would be member 'grow_iterations'

Done with minimal modifications, which, however, requires C++17. So I've added commits from #6749 to make this work (there's a CI job using MergeSat now).

@tautschnig
Copy link
Collaborator Author

nit: version "3.0" is not true

Is that still mentioned anywhere?

@tautschnig
Copy link
Collaborator Author

nit: Is this configuration actually tested on Windows? I did not test this myself, and know for earlier versions that this compilation does not work without modifications to MergeSat.

I've added MergeSat to the check-vs-2019-cmake-build-and-test CI job. Let's see!

@tautschnig
Copy link
Collaborator Author

nit: Is this configuration actually tested on Windows? I did not test this myself, and know for earlier versions that this compilation does not work without modifications to MergeSat.

I've added MergeSat to the check-vs-2019-cmake-build-and-test CI job. Let's see!

Does not seem to work:

D:\a\cbmc\cbmc\build\mergesat-src\minisat\core\Lookahead.cc(20,10): fatal error C1083: Cannot open include file: 'core/Lookahead.h': No such file or directory [D:\a\cbmc\cbmc\build\mergesat-build\mergesat-condensed.vcxproj]
cl : command line warning D9025: overriding '/W3' with '/w' [D:\a\cbmc\cbmc\build\mergesat-build\mergesat-condensed.vcxproj]
cl : Command line warning D9025: overriding '/W3' with '/w' [D:\a\cbmc\cbmc\build\mergesat-build\mergesat-condensed.vcxproj]
  Solver.cc
D:\a\cbmc\cbmc\build\mergesat-src\minisat\core\Solver.cc(50,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory 

I'll limit the experimenting to Linux-based platforms, but even then the uses from within refinement appear to be causing trouble. Needs looking at.

@tautschnig tautschnig changed the title Add support for MergeSat Add support for MergeSat [depends-on: #6749, #6848, #6849] May 10, 2022
@tautschnig tautschnig changed the title Add support for MergeSat [depends-on: #6749, #6848, #6849] Add support for MergeSat [depends-on: #6749, #6849] May 10, 2022
@tautschnig tautschnig changed the title Add support for MergeSat [depends-on: #6749, #6849] Add support for MergeSat [depends-on: #6749] May 10, 2022
tautschnig added a commit that referenced this pull request May 11, 2022
Tests: do not unnecessarily constrain what models solvers can produce [blocks: #6439]
@tautschnig
Copy link
Collaborator Author

Note to self: We'll likely want conp-solutions/mergesat#124 to be merged and Mergesat 4.0 to be released before trying to merge this one.

// MergeSat internally still uses them to track UNSAT. To make sure we
// aren't stuck with "UNSAT" in incremental calls the status needs to be
// reset.
((Minisat::Solver *)solver.get())->reset_constrain_clause();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required anymore. There was an issue with how incremental solving was implemented. The latest update of MergeSat has that fixed. Hence, feel free to drop this hunk!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I don't think we want to merge this PR before MergeSat 4.0 is released, so I suppose 4.0 will include this fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely yes. On the other hand, I am not sure when I will release 4.0, i.. whether I wait for the SAT competition results or not. Hence, feel free to not wait. The major thing that will change is the default configuration of the solver - and the competition will help to identify which one to pick.

@tautschnig tautschnig force-pushed the mergesat branch 6 times, most recently from 58e83d6 to 2156312 Compare March 1, 2023 09:42
@tautschnig tautschnig changed the title Add support for MergeSat [depends-on: #6749] Add support for MergeSat Nov 13, 2023
@tautschnig tautschnig removed their assignment Nov 14, 2023
@tautschnig tautschnig marked this pull request as ready for review November 14, 2023 14:57
@TGWDB
Copy link
Contributor

TGWDB commented Nov 14, 2023

The runtime for the new CI job looks unpleasantly long. Is this expected? It seems well outside the numbers on the job description.

@tautschnig
Copy link
Collaborator Author

The runtime for the new CI job looks unpleasantly long. Is this expected? It seems well outside the numbers on the job description.

We might take this as a first performance indicator (the tests taking 54 minutes as compared to 18 minutes that MiniSat takes). Perhaps the switch from 4.0-rc1 to 4.0-rc4 (of mergesat) wasn't a good idea?!

@tautschnig tautschnig self-assigned this Nov 14, 2023
@TGWDB
Copy link
Contributor

TGWDB commented Nov 20, 2023

The runtime for the new CI job looks unpleasantly long. Is this expected? It seems well outside the numbers on the job description.

We might take this as a first performance indicator (the tests taking 54 minutes as compared to 18 minutes that MiniSat takes). Perhaps the switch from 4.0-rc1 to 4.0-rc4 (of mergesat) wasn't a good idea?!

Yes. Without further knowledge/detail as to why (and whether it's an edge case we can accept), merging this seems like a bad idea.

MergeSat is a recent SAT solver that fits the MiniSat2 interface. Run
the check-ubuntu-20_04-cmake-gcc CI job with MergeSat to continuously
confirm that this configuration actually works.

To use MergeSat as a proper SAT backend, some extensions might be dropped.
Especially being able to print memory usage is not helpful for CBMC, but
requires pulling in a new dependency.

Signed-off-by: Norbert Manthey <[email protected]>
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.

6 participants