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

Carry all incompatibilities during backtracking #60

Closed
wants to merge 1 commit into from

Commits on Nov 4, 2020

  1. Mark downstream incompatibilities on backtracking

    Consider this situation:
    
    * Candidate Ax depends on B
    * Candidate B1 depends on C==1, D==1, E==1
    * Candidate B2 depends on C==2, D==1, E==1
    * Candidate C1 depends on D==1
    * Candidate C2 depends on D==1
    * Candidate D1 depends on E!=1
    
    In the previous implementation, the conflict on E is discovered after we
    resolved Ax-B1-C1-D1. D1 is marked as an incompatibility, we backtrack
    the C1 pin. But now we don't have an available C, and need to also
    backtrack the B1 pin. At this point, however, the previous implemen-
    tation would fail to "remember" that D1 is also marked as incompatible,
    and proceed to try B2. That would eventually fail, we backtrack to the
    same point, are stuck trying B1 and B2 repeatedly.
    
    This fix uses a list to remember all the candidates marked as
    incompatible along the whole backtrack process, and "re-mark" them in
    parent states. This makes the resolver aware, when it backtracks B1,
    that B2 is also not viable, and avoid hitting it.
    uranusjr committed Nov 4, 2020
    Configuration menu
    Copy the full SHA
    1521ccb View commit details
    Browse the repository at this point in the history