Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upBacktrack more aggressively when resolving #1804
Conversation
rust-highfive
assigned
wycats
Jul 13, 2015
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Jul 13, 2015
|
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
Hm, maybe don't r+ just yet, want to test out on Servo to make sure this doesn't blow any stacks. It'd be unfortunate to have to switch to an explicit stack... |
alexcrichton
force-pushed the
alexcrichton:aggressively-backtrack
branch
from
69d2513
to
596fa60
Jul 14, 2015
This comment has been minimized.
This comment has been minimized.
|
Ok, I have overhauled this to include some more changes. This has evolved into a bit of a larger scale refactor of the resolution code, although most of the changes are just code movement. I can split out the literal code movement changes if it makes it easier to review. The other changes made are:
r? @brson |
rust-highfive
assigned
brson
and unassigned
wycats
Jul 14, 2015
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
force-pushed the
alexcrichton:aggressively-backtrack
branch
from
596fa60
to
8e9ce3a
Jul 17, 2015
This comment has been minimized.
This comment has been minimized.
|
r=me |
alexcrichton
added some commits
Jul 13, 2015
alexcrichton
force-pushed the
alexcrichton:aggressively-backtrack
branch
from
8e9ce3a
to
13971b4
Jul 17, 2015
alexcrichton
force-pushed the
alexcrichton:aggressively-backtrack
branch
from
13971b4
to
bcdb747
Jul 17, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jul 17, 2015
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton commentedJul 13, 2015
Resolving a dependency graph may involve quite a bit of backtracking to select
different versions of crates, but the previous implementation of resolution
would not backtrack enough.
Once a dependency is completely resolved it's possible that any number of
candidates for its transitive dependencies were left out of the resolution
process (e.g. we didn't hit them yet). These candidates were not previously used
for backtracking (because resolution overall of the dependency finished), but
this commit alters the implementation to instead consider these as candidates
for backtracking.
Architecturally this changes the code to CPS to pass around a
finishedcontinuation to allow tweaking the behavior whenever a dependency successfully
resolves. The key change is then that whenever a candidate for a dependency is
activated, we ensure the recursive step for the rest of the graph happens as a
sub-call. This means that if anything in the recursive call fails (including
some previous up-the-stack resolution) we'll retry the next candidate.
Closes #1800