Commit Graph

9 Commits

Author SHA1 Message Date
David Greenspan
dbfd1291c7 Code review changes
Validate package names in CS.Input.  Fix comments.  Remove dead code.
Use an equality requirement at the end of logic-solver's minMax.
2015-03-10 12:22:19 -07:00
David Greenspan
de5e67356a Some clean-up and allow minimization strategies 2015-03-09 23:15:25 -07:00
David Greenspan
eda46a2824 Get rid of the "zeroGoal" flag
From running benchmarks while changing the code:
* It doesn't seem to slow things down to *always* try to "hit 0"
  when minimizing
* It does seem to slow things down if the "<= 0" constraint is
  expressed using <= instead of "forbid the terms with non-zero
  weights"

This change also fixes a bug where we required terms with zero
weights to be 0.
2015-03-06 15:53:31 -08:00
David Greenspan
9869245b8e Improve comments in optimize.js 2015-03-05 08:48:09 -08:00
David Greenspan
a5df9f84ab Implement proper cost function
Lots of things happened here:
* Refactored how cost minimization is expressed
* Cost function now distinguishes major/minor/patch/rest
* Order of terms is improved
* Reachability analysis of catalog makes benchmarks much faster
* Lock down versions of special packages before solving rest (perf)
* Explaining conflicts no longer crashes on cycles
* Antigravity for patches (and wrap nums, prereleases, etc.) so that
  we take bug fixes to indirect dependencies.

TODO:
* Refuse to make breaking changes to root reps
* Make sure we don't have antigravity changing any previous solutions
  for no reason
* Proper pre-release handling
* Unit tests
2015-02-06 20:47:31 -08:00
David Greenspan
3b41f812f8 Fix bug in optimization
I've been assuming that minimize/maximize requires the value to
remain the optimum, but it wasn't actually doing that.
2015-02-01 08:06:24 -08:00
David Greenspan
ff4398fe1c New constraint solver works!
It even explains conflicts.  It just doesn't spit out the list of
other constraints on conflicted packages yet (easy to do).

Left to do:
- Remove old solver code
- Call nudge()
- More nuanced cost function
- Clean up solver.js a little
- Proper handling of pre-release versions
- Lots more tests of different scenarios!
2015-01-30 16:45:28 -08:00
David Greenspan
3b2e1b7ab6 Let costWeights be a number instead of an array 2015-01-28 15:29:40 -08:00
David Greenspan
2491ffd9aa minimize/maximize in solver 2015-01-21 11:56:25 -08:00