Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Issue 13095015: Use backtracking when solving dependency constraints. (Closed)

Created:
7 years, 9 months ago by Bob Nystrom
Modified:
7 years, 8 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Use backtracking when solving dependency constraints. Committed: https://code.google.com/p/dart/source/detail?r=21563

Patch Set 1 #

Patch Set 2 : Clean up a bit. #

Total comments: 1

Patch Set 3 : Clean up some test code. #

Total comments: 88

Patch Set 4 : Allow both solvers to coexist. #

Total comments: 18

Patch Set 5 : Respond to review. #

Total comments: 43

Patch Set 6 : Track amount of backtracking used in solver tests. #

Total comments: 18

Patch Set 7 : Revised. #

Total comments: 46

Patch Set 8 : Backjumping. #

Total comments: 14

Patch Set 9 : Revised. #

Total comments: 6

Patch Set 10 : Revise, update to latest corelib, and make backtracker default. #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+1638 lines, -1143 lines) Patch
M utils/pub/entrypoint.dart View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -12 lines 0 comments Download
M utils/pub/log.dart View 1 2 3 4 5 6 7 8 9 5 chunks +20 lines, -0 lines 0 comments Download
M utils/pub/package.dart View 1 2 3 4 5 6 7 8 9 4 chunks +24 lines, -0 lines 0 comments Download
M utils/pub/path_source.dart View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -4 lines 0 comments Download
M utils/pub/pub.dart View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -4 lines 0 comments Download
A utils/pub/solver/backtracking_solver.dart View 1 2 3 4 5 6 7 8 9 1 chunk +542 lines, -0 lines 16 comments Download
A + utils/pub/solver/greedy_solver.dart View 1 2 3 4 5 6 7 8 9 22 chunks +90 lines, -248 lines 0 comments Download
A utils/pub/solver/version_solver.dart View 1 2 3 4 5 6 7 8 9 1 chunk +379 lines, -0 lines 0 comments Download
D utils/pub/version_solver.dart View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -714 lines 0 comments Download
M utils/tests/pub/install/pub_install_test.dart View 1 2 3 4 5 6 7 8 2 chunks +35 lines, -1 line 0 comments Download
M utils/tests/pub/pub_test.dart View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M utils/tests/pub/version_solver_test.dart View 1 2 3 4 5 6 7 8 9 11 chunks +516 lines, -157 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Bob Nystrom
This isn't ready to go in yet, but I wanted to start getting feedback on ...
7 years, 9 months ago (2013-03-26 22:07:56 UTC) #1
Bob Nystrom
OK, it's at a point where I'd like to start landing this now: - Both ...
7 years, 9 months ago (2013-03-28 18:15:43 UTC) #2
nweiz
As we discussed offline, I would like to see backjumping implemented before this code gets ...
7 years, 9 months ago (2013-03-29 01:58:25 UTC) #3
Bob Nystrom
Thanks! https://codereview.chromium.org/13095015/diff/4001/utils/pub/package.dart File utils/pub/package.dart (right): https://codereview.chromium.org/13095015/diff/4001/utils/pub/package.dart#newcode162 utils/pub/package.dart:162: /// Returns `true` of this references description matches ...
7 years, 8 months ago (2013-03-30 00:15:55 UTC) #4
Bob Nystrom
The tests now verify the upper limit for backtracking to reach a solution. PTAL.
7 years, 8 months ago (2013-04-02 21:34:41 UTC) #5
nweiz
https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart File utils/pub/version_solver2.dart (right): https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart#newcode11 utils/pub/version_solver2.dart:11: /// piles of memory for both the futures and ...
7 years, 8 months ago (2013-04-03 00:28:42 UTC) #6
Bob Nystrom
https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart File utils/pub/version_solver2.dart (right): https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart#newcode11 utils/pub/version_solver2.dart:11: /// piles of memory for both the futures and ...
7 years, 8 months ago (2013-04-08 22:12:59 UTC) #7
Bob Nystrom
Backjumping is in. PTAL.
7 years, 8 months ago (2013-04-10 20:51:34 UTC) #8
nweiz
After looking over Bundler's sort criteria again, I think it's reasonable to integrate most of ...
7 years, 8 months ago (2013-04-10 22:56:34 UTC) #9
Bob Nystrom
https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart File utils/pub/version_solver2.dart (right): https://codereview.chromium.org/13095015/diff/4001/utils/pub/version_solver2.dart#newcode11 utils/pub/version_solver2.dart:11: /// piles of memory for both the futures and ...
7 years, 8 months ago (2013-04-11 00:55:10 UTC) #10
nweiz
A few more comments, but lgtm. https://codereview.chromium.org/13095015/diff/47001/utils/pub/solver/backtracking_solver.dart File utils/pub/solver/backtracking_solver.dart (right): https://codereview.chromium.org/13095015/diff/47001/utils/pub/solver/backtracking_solver.dart#newcode30 utils/pub/solver/backtracking_solver.dart:30: /// becomes the ...
7 years, 8 months ago (2013-04-11 22:12:04 UTC) #11
Bob Nystrom
Revised the backjumper. It now takes into account transitive dependencies, which allows it to still ...
7 years, 8 months ago (2013-04-16 18:34:16 UTC) #12
Bob Nystrom
Committed patchset #10 manually as r21563 (presubmit successful).
7 years, 8 months ago (2013-04-16 18:34:53 UTC) #13
nweiz
https://codereview.chromium.org/13095015/diff/71001/utils/pub/solver/backtracking_solver.dart File utils/pub/solver/backtracking_solver.dart (right): https://codereview.chromium.org/13095015/diff/71001/utils/pub/solver/backtracking_solver.dart#newcode284 utils/pub/solver/backtracking_solver.dart:284: Future<List<PackageId>> _traverseRefs(String depender, On 2013/04/16 18:34:17, Bob Nystrom wrote: ...
7 years, 8 months ago (2013-04-16 23:20:38 UTC) #14
Bob Nystrom
Thanks! Revised here: https://codereview.chromium.org/14249006/ https://codereview.chromium.org/13095015/diff/71001/utils/pub/solver/backtracking_solver.dart File utils/pub/solver/backtracking_solver.dart (right): https://codereview.chromium.org/13095015/diff/71001/utils/pub/solver/backtracking_solver.dart#newcode284 utils/pub/solver/backtracking_solver.dart:284: Future<List<PackageId>> _traverseRefs(String depender, On 2013/04/16 ...
7 years, 8 months ago (2013-04-16 23:58:45 UTC) #15
nweiz
https://codereview.chromium.org/13095015/diff/83001/utils/pub/solver/backtracking_solver.dart File utils/pub/solver/backtracking_solver.dart (right): https://codereview.chromium.org/13095015/diff/83001/utils/pub/solver/backtracking_solver.dart#newcode369 utils/pub/solver/backtracking_solver.dart:369: return new Future(() { On 2013/04/16 23:58:46, Bob Nystrom ...
7 years, 8 months ago (2013-04-17 00:51:46 UTC) #16
Bob Nystrom
7 years, 8 months ago (2013-04-17 17:07:01 UTC) #17
Message was sent while issue was closed.
I'll update this in the other code review.

https://codereview.chromium.org/13095015/diff/83001/utils/pub/solver/backtrac...
File utils/pub/solver/backtracking_solver.dart (right):

https://codereview.chromium.org/13095015/diff/83001/utils/pub/solver/backtrac...
utils/pub/solver/backtracking_solver.dart:369: return new Future(() {
On 2013/04/17 00:51:46, nweiz wrote:
> On 2013/04/16 23:58:46, Bob Nystrom wrote:
> > On 2013/04/16 23:20:38, nweiz wrote:
> > > Add a comment explaining that this works around issue 9583.
> > 
> > That's actually not the main intent here. It's to catch the errors that
> > _validateDependency() and _validateSelected() may throw.
> 
> The normal way to do that would be to use [Future.sync()]. It warrants
> explaining why you need to use the asynchronous [Future()] constructor instead
> here.

Done.

Powered by Google App Engine
This is Rietveld 408576698