Skip to content
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

Implement Causes Narrowing #139

Closed
notatallshaw opened this issue Oct 1, 2023 · 1 comment
Closed

Implement Causes Narrowing #139

notatallshaw opened this issue Oct 1, 2023 · 1 comment

Comments

@notatallshaw
Copy link
Collaborator

notatallshaw commented Oct 1, 2023

I was looking at this issue here ( pypa/pip#12305 (comment)) and realized that "causes" in the resolution step includes a lot of things which don't actually cause backtracking to occur.

The problem with having a large causes section is it creates expoential choice when backtracking, and it makes for a worse error message if printing out the causes at the end.

I think there are potentially some agressive strategies that one could implement to narrow causes, but at the very least it would make sense to go through each of the causes and see if it actually conflicts with any of the other causes.

For example in the linked example the requirement numpy from soxr=0.3.6 obviously does not conflict with any of the other causes, so resolvelib/Pip should not be trying to backtracking on it.

I write this issue in case anyone disagrees, wants to discuss a strategy, or wants to implement it themselves, I'm pretty busy next few weeks, but I can take a look at implementing it later this year.

@notatallshaw
Copy link
Collaborator Author

After working on this for a little bit I realized it needs to be changes from "Cause Narrowing" to "Prefer Conflicts", it's largely the same idea, the provider understands what causes conflict with each other and resolvelib doesn't and the causes that conflict should be preffered.

Once I have an actual PR ready I will make an issue/PR explaining how it works.

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

No branches or pull requests

1 participant