Repository navigation
Fix conflict counting bug - #3961
Conversation
We used to miss a lot of conflicts during counting in `logBackjump`. Counting initial conflicts here drastically reduces search time in some cases. Not sure whether counting the current conflicts (`cs`) may be even better than counting the initial conflicts (`initial`).
|
@fmthoma, thanks for your PR! By analyzing the history of the files in this pull request, we identified @GrayJay, @kosmikus and @BardurArantsson to be potential reviewers. |
|
@ezyang Conflict counting is just a heuristic to improve performance, so it would be hard to test. This PR just applies it more consistently. I'll merge it when the build passes. |
|
@ezyang This is a performance-related fix, not a correctness one. While it may change solver results (because it can change goal order, and therefore affect which of many possible install plans is ultimately found), it should not affect correctness at all, and seems difficult (not impossible) to test for. I'll think about it, but I think we shouldn't delay the merge for this. |
|
|
||
| logBackjump :: ConflictSet QPN -> ConflictMap -> ConflictSetLog a | ||
| logBackjump cs cm = failWith (Failure cs Backjump) (cs, cm) | ||
| logBackjump cs cm = failWith (Failure cs Backjump) (cs, updateCM initial cm) |
There was a problem hiding this comment.
We should benchmark updateCM initial cm versus updateCM cs cm. At least in the examples I tried, the latter gives even better results in terms of performance. On the other hand, @kosmikus has reservations that using cs here leads to double-counting some conflicts.
Encountered during the implementation of #3570.
We used to miss a lot of conflicts during counting in
logBackjump.Counting initial conflicts here drastically reduces search time in some
cases.
Not sure whether counting the current conflicts (
cs) may be evenbetter than counting the initial conflicts (
initial) ⇒ Benchmarking by @kosmikus?