-
Notifications
You must be signed in to change notification settings - Fork 711
[RFC] Add option to find best install plan before backjump limit #2917
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
Conversation
a160ffd
to
4c35095
Compare
I rebased this to deal with conflicts and made a few minor changes that shouldn't affect the behavior. |
d0d6592
to
32ca508
Compare
@grayjay Note that there are now new conflicts, probably because my dead code removal patch was merged. |
32ca508
to
748e203
Compare
I resolved the conflicts. The dead code removal actually shortened the diff by about 80 lines. |
I tried exposing install plan scoring in a more user-friendly way. The latest commit adds a new option, There are a few things I'd like to improve if this feature is added to cabal:
|
fbb7188
to
9ada6d1
Compare
@grayjay Thanks for rebasing this. I'm hoping that I can finally take a look at this soon. |
b1dbe99
to
e9b42ab
Compare
@kosmikus Thanks. I just rebased on top of the module reorganization and added some comments and quickcheck tests. I also added a commit that does dynamic goal reordering based on conflict sets. It sometimes finds the best solution faster, especially when combined with EDIT: |
a6e621e
to
4fdc5c2
Compare
@grayjay Thanks! I had just been experimenting with the same/a similar thing. My "dynamic-goal-reordering" branch is at https://github.com/kosmikus/cabal/tree/count-conflicts My initial experiments with this have been very promising. There are only very few cases where it seems to be slower, and many where it seems to perform vastly better. So I'd actually be optimistic that something like this can become the new default. I will have a look at how our approaches differ, if at all. |
@kosmikus I started rebasing this onto master, because I think it will be easier to split it apart when it is up to date. |
0af7823
to
606b1a8
Compare
I'm done rebasing. |
606b1a8
to
21793a4
Compare
I rebased onto #3594. |
21793a4
to
06fdb15
Compare
06fdb15
to
7cc6f71
Compare
7cc6f71
to
7e7af59
Compare
7e7af59
to
76dcea9
Compare
16eff27
to
1321a7b
Compare
fbabbac
to
8362d04
Compare
8362d04
to
3830b97
Compare
This PR needs more work. |
I've started implementing install plan scoring, as described in #2860.
cabal install
now prints the score of each install plan and allows the user to find better plans with the option--max-score
, where zero is perfect.cabal
should find the same install plans as before when no maximum is specified. This pull request isn't ready to be merged yet. It needs documentation and tests, and I have a few questions in TODO comments. Also, this is the most basic way to expose install plan scoring, and it might be better to automate determining when to continue searching before this is merged.I rebased onto #2916 because this change made the existing space leak worse. Then I compared performance between #2916 and the latest commit. Memory usage is similar, but the latest commit is noticeably slower when the solver runs for longer. I compiled cabal with GHC 7.10.2 and ran
cabal --ignore-sandbox install --dry-run --max-backjumps -1
with the following packages and compilers:+RTS -s
)These comments that I made on the issue are still relevant:
#2860 (comment)
#2860 (comment)