-
Notifications
You must be signed in to change notification settings - Fork 4
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
Detect all conflicts on Engine::check_solution
#137
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 1 file with indirect coverage changes 🚨 Try these New Features:
|
180cf56
to
8146152
Compare
CodSpeed Performance ReportMerging #137 will degrade performances by 65.8%Comparing Summary
Benchmarks breakdown
|
@AllenZzw This was one of the changes that we discussed. It seems to affect the job shop benchmarks mostly negatively, but it's unclear to me whether this is just because of a different search order, and we are unlucky in 2 out of 3 changes. In general, giving more information back to the SAT solver with no change in runtime for Could you run a larger test suite to see whether this is worthwhile or not (independent of propagator deactivation)? |
// detected | ||
if let Some(conflict) = ctx.state.conflict.take() { | ||
// Move conflict to clauses before backtrack | ||
ctx.state.clauses.push_back(conflict); |
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.
The normal clauses in state.clauses
and conflict clauses in state.conflict
seems to be handled differently in add_external_clause
. Shall we change the conflict
variable into a vector to ensure the consistent handling of conflicts?
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.
The difference is that state.clauses
are persistent, and will be kept even when you backtrack. We could change conflict
to be a vector and capture all conflicts immediately, but it would still require the move to state.clauses
because we immediately backtrack afterwards in check_solutions
. (Note that the other difference is that all other clauses and propagations are posted before the conflict, to ensure it will cause conflict in the SAT solver. However, since conflicts are added to the end of the list and there cannot be any propagations, this is not a problem).
So if we stick to my proposed design, where we detect all conflicts in check_solutions
, but find only the first in propagate
, then don't think we need to change it.
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 see. Probably the performance change is due to the search heuristic. Let me test it using a larger benchmark and also try the --vsids-only
option.
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.
That would be great! Thanks :)
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.
Tested with jobshop and openshop instances. The performance seems to remain the same.
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.
If the performance is just the same, then I'm not sure whether the change is worthwhile.
Like we discussed in person: only one of the clauses is used in conflict resolution, so any other given clauses are added to the clause database “as is”. I'm not sure whether this wouldn't be something we would hope to avoid.
I'll at least make another branch that ensures that conflict clauses in check_solution
are still added as “removable” clauses.
8146152
to
405e001
Compare
No description provided.