-
Notifications
You must be signed in to change notification settings - Fork 712
RFC: Remove top-down solver (v1) #3364
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
RFC: Remove top-down solver (v1) #3364
Conversation
Oh, I should add. My main arguments for removal:
|
Ultimately we ought to remove it. Perhaps this is a good time to re-run the check on which packages can be solved with the top down solver that cannot be solved with the modular solver. This is related to the idea of splitting the solver out, in as much as having an interface with two solver impls has also been a mechanism to "keep us honest" with not intermingling too much. |
Is there some "golden set of packages" that can be used for this purpose? I'd be quite happy to go through the 'mechanical' issue of scripting whatever's necessary for such a one-off test; I just don't have the necessary data to actually do it. Any help would be appreciated. (Though I'd be very surprised if anything actually turned up. I haven't been following along fanatically, but I don't recall a single bug reports in the last year or so having anything to do with the choice of solver.)
That's a good point against that I hadn't thought of... but given that we're not currently doing bisimulation style testing in any meaningful sense I don't think it's a big issue. :) The newly added QuickCheck tests (thanks @grayjay!) will hopefully also be better (in every sense) than a bisimulation-style test where one of the simulees is... dodgy. EDIT: Oh, and I should say: We can "keep more honest" by simply splitting out the solver! Then we can guarantee that we're not even relying on implementation details of |
See #2531 and the wiki where @edsko did this experiment previously. |
@dcoutts Thanks, I'll investigate tomorrow! |
The quickcheck tests currently only test the solver against itself, but it would be nice to add some tests that construct solvable dependency problems and test that the solver finds a solution. |
@grayjay Oh, I see, but there's no actual bisimulation going on, right? |
@BardurArantsson There is no bisimulation. It's just testing that different parameters and target orders don't affect whether the solver finds a solution. |
I don't have any really good reasons against removal: I find the topdown solver occasionally useful for quick comparisons. I don't think its presence does much harm or causes much work (we haven't added most new / advanced features to it anyway). And in general, I think it's good if there are two solvers, because it ensures that we keep the solver interface relatively explicit and do not blur the lines too much. But I can see that it's of significant size, and the longer it is just there without really being used or worked on, the more mysterious it becomes. And I don't think anyone really needs it as this point. So after considering it for a while, I'm not going to block the request for removal if Duncan is also ok with it. I'd be really surprised if the topdown solver could solve anything the modular solver could not. After all, the modular solver is supposed to be complete with infinite backjumps. The more interesting question would be whether there are situations where the topdown solver is much faster than the modular solver, or finds a significantly better solution, which is certainly both possible. So running a few final comparisons as long as we still easily can is probably a good idea. |
Actually, there are a number of packages that the top down solver can solve but the modular solver cannot. See the issue and the wiki cited by @dcoutts above, where I have also done detailed performance comparisons. |
@edsko Ok, fair enough. I guess I was too caught up in the "theoretical view" that tells me that the modular solver should find a solution eventually, but I of course agree that missing a 5 minute timeout is clearly the same as not finding a solution in practice. I will also take a closer look. |
@edsko Hmm, it actually looks like the topdown solver is completely broken right now? Any plan it generates seems to be rejected by the sanity check. Was this known? |
Nope, that is news to me.
|
This seems to imply that there cannot really be any actual current users. I wonder how long it's been broken... |
FTR, I'm +1 on removing the old solver from |
@BardurArantsson I don't really think there are users. But also, it's only broken on master, not in any released version, AFAICT. |
@kosmikus So it's only broken on |
@23Skidoo Indeed, it looks fine on |
Ok, so I can already say that the two solvers have become much more difficult to compare, because of pkgconfig and setup dependencies which lead to some package being rejected that are not rejected by the topdown solver. A naive comparison run on a plain ghc-7.10.3 database on every Hackage package (9621 packages) with standard flags (so no increased backjump limit, no reorder-goals) yields 239 packages where the topdown solver finds a plan, but the modular solver does not. Re-running the 239 packages with a few more, but by far not all, pkgconfig-relevant libraries installed and unlimited backjumps and reorder goals and a timeout of 90 seconds, will find install plans for 116 of these, leaving 123 unsolved. Of these 123, only 6 seem to actually fail due to timeout. The others fail due to the dependency tree having been exhaustively searched (failure due to pkgconfig error or setup dependency error or possibly something else). The 6 packages failing due to timeout are:
I'm somewhat surprised that @edsko seems to have had a much larger number of "true failures" of the modular solver. I'll see if I can still reproduce this with older versions of cabal-install or older versions of ghc. |
@kosmikus Did you reach any conclusions? |
@kosmikus Ping :) |
@BardurArantsson Pong. Planning to work on my cabal-install backlog during ZuriHac. But I guess the conclusion here is that I'm not really willing to spend time figuring out why the topdown solver is broken in HEAD, and it still working in 1.24 seems good enough for the remaining comparisons. So I think that yes, we can remove it. |
Thanks. I apologize for pestering you, btw :). My general thinking here is that given:
... we should just remove, so I'm glad you agree. So: LAST CALL: I'll rebase this changeset and merge tomorrow unless someone else objects. |
@BardurArantsson Fine with me. Thanks for being so patient. |
@BardurArantsson And if I've understood @grayjay correctly, she's also in agreement. |
Yes, I think it makes sense to remove the Topdown solver. |
Closing this; see #3598 |
DO NOT MERGE! This is just an RFC
Ok, so in a moment of madness I just went ahead and tried to see what would happen if we were to remove the TopDown solver.
I think the diffstat mostly speaks for itself.
Two caveats:
EDIT: Obviously this should probably be post-1.24.0, but it shouldn't be a problem to bring the patch up-to-date once that's released.