-
Notifications
You must be signed in to change notification settings - Fork 38
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
merge incompatibilities smartly #19
Comments
For context, I had written this comment about the mutability danger before the |
I don't fully understand the distinctions between |
Ah yes. So there are two kind of incompatibilities here (and I'm not talking about external vs derived), the incompatibilities that are in the set of tracked incompatibilities (those described by the PubGrub algorithm, here they exist in both All external incompatibilities are tracked but some derived are not. If you pay close attention to the When I was in Elm those lived somewhere managed by the GC. But in Rust they need to live somewhere. So I tried 3 designs. Two of them are using indices in the incompatibility to refer to its two parents. Those indices are their position in the incompatibility store. All incompatibility ever created are pushed into that store, even the intermediate ones generated during non-terminal steps of conflict resolution. That "store" has no equivalent in the pubgrub algorithm since its description does not care about memory management. As such, I was then saying that it's not an issue to remove incompatibilities in Let me know if it's still not clear |
I'll try to categorize the kind of incompatibility collapse that we can do safely. New external incompatibilityWhen adding a new external incompatibility, there are plenty of cases where we can merge it directly to other already existing incompatibilities. Adding a
|
Thank you for the great write ups! This is a lot clearer now. |
A note on previous write up on merging strategies. I was wrong saying that we can fully merge |
In addition to those "theoretical" improvements, once we have ways to easily generate many large registries producing plenty of backtracking, it would be nice to have statistics on resolution of those, like
|
Just did a small analysis of the final incompatibilities for our current From those 1482 incompatibilities, 529 are unique, so lots of duplicates in there. All duplicates are external incompatibilities, more precisely, all duplicates are from dependencies. 22 of the unique incompatibilities are derived, 507 are external. These are composed of the root incompatibility, 28 |
Some very basic meta analysis of those numbers:
This is a dependency heavy benchmark, with very few conflicts, so it is not designed to evaluate improvements in the conflict resolution part of the algorithm.
Keeping an internal cache of |
So it sounds like there are big wins by just merging ones that are exactly the same, without doing anything "smartly". Or even better figuring out how not to generate the duplicate in the first place. |
This is functionality we do not yet have. Can we keep it open? |
Ha, sorry yes |
For future reference, I think the relevant code in dart is |
Co-authored-by: Zanie Blue <[email protected]>
There is a really cool part of the algorithm that makes things more efficient and makes for better error messages. Unfortunately it is not clear when it is correct to use it. https://github.com/mpizenberg/pubgrub-rs/blob/master/src/internal/incompatibility.rs#L209
cc #14 (comment)
What does the Dart version do? When and how do we want do this?
The text was updated successfully, but these errors were encountered: