Skip to content

Fix conflict counting bug - #3961

Merged
sebright merged 1 commit into
haskell:masterfrom
fmthoma:fmthoma/fix-counting-backjumps
Oct 9, 2016
Merged

sebright merged 1 commit into
haskell:masterfrom
fmthoma:fmthoma/fix-counting-backjumps

Conversation

@fmthoma

@fmthoma fmthoma commented Oct 8, 2016

Copy link
Copy Markdown
Collaborator

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 even
better than counting the initial conflicts (initial) ⇒ Benchmarking by @kosmikus?

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`).
@mention-bot

Copy link
Copy Markdown

@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

ezyang commented Oct 8, 2016

Copy link
Copy Markdown
Contributor

Thanks for the fix, @fmthoma ! I'm not too familiar with conflict counting (@GrayJay, maybe you can comment?) but is there any possible solver test we could add to test this fix?

@sebright

sebright commented Oct 9, 2016

Copy link
Copy Markdown
Collaborator

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

@kosmikus

kosmikus commented Oct 9, 2016

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

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.

5 participants