summaryrefslogtreecommitdiff
path: root/src/generic/problemresolver/problemresolver.h
AgeCommit message (Collapse)AuthorFilesLines
2009-03-03Don't force the resolver to always prioritize dependencies that impinge on ↵Daniel Burrows1-30/+0
user constraints any more, as it is no longer necessary to do so. This was added years ago as a hack, to prevent the resolver from thrashing around when there was a user-constrained version somewhere on its search path. This was necessary only because the resolver couldn't generate higher-order information about deferred solutions. Since it now can, that code is totally unnecessary: it causes the search to examine many more nodes than it would otherwise have to, rather than using the pretty good heuristic of "take the dependency with the lowest branching factor".
2009-03-03First step in the actual implementation of tiering.Daniel Burrows1-441/+668
This commit introduces solution tiers, replacing the old conflict, deferred solution, and already-generated-solution structures with a system based on promotion tiers. Currently this isn't used to actually order resolver results; however, it is used to accumulate higher-order information about deferals that couldn't be calculated before, and to accumulate some information about soft dependency breaks. (currently they are still somewhat restricted, though) The next step is to push the use of the new choice structure outward, and maybe to profile the new code: it achieved a four-fold reduction in the number of search nodes visited in a moderately large upgrade test, but doesn't perform any faster in real time. I'm guessing there are some inefficiencies there that I need to look at.
2009-02-16Expose the initial set of broken dependencies to clients of the resolver.Daniel Burrows1-0/+12
This is needed so that the resolver manager can determine whether to create a resolver when the initial state has been modified.
2009-02-16Don't constantly create and destroy empty solutions for sanity-checking ↵Daniel Burrows1-4/+6
while we're finding out which broken dependencies exist. Instead we now just create one empty solution and re-use it.
2009-02-09Fix the future horizon code to handle rejects / accepts between searches.Daniel Burrows1-18/+64
Not tested as well as it should be.
2009-02-09Explain future_solutions better.Daniel Burrows1-1/+5
2009-02-09Add support to the problem resolver for searching past the first solution. ↵Daniel Burrows1-7/+49
(Closes: #482825) Hopefully this won't be too bad for performance, because it only searches 50 nodes past the first one. The one thing that worries me is that it does this search *every time* that the resolver runs, even if it's just going to return an enqueued solution from the last run ... but still, it should be fine unless you're generating hundreds of solutions (in which case we have an EPIC RESOLVER FAIL). I think this breaks rejects/accepts. More work needed there.
2009-02-05Fix the initial state object to be simpler and fix how it's initialized to ↵Daniel Burrows1-1/+1
not crash. Simpler: it now takes the number of packages, not the whole universe, as its initialization parameter. Not crashing: the resolver was passing a pointer to a not-yet-initialized universe into the constructor; now it uses the universe that was passed as a parameter instead.
2009-02-05Stop using the broken_dep_iterator and instead just invoke broken_under() on ↵Daniel Burrows1-21/+12
each dependency found by dep_iterator(). This is necessary when we have overridden the initial state, since the universe doesn't know about initial states. Anyway, the broken dep iterator already calls broken_under() over and over to sanity-check the broken dep list, so that's already the canonical source of information about what's broken.
2009-02-05Trim out some places where initial states are unnecessarily passed around.Daniel Burrows1-10/+5
2009-02-04First pass of code to support using an initial state other than the ↵Daniel Burrows1-28/+48
universe's current state. Third time should be the charm: my first two attempts at implementing this (by putting it into the universe, or directly into the resolver and not the solutions) went nowhere. The current approach treats the initial state as a property of the resolver, but also as a property of the solution object. This is needed mostly because solutions have to be able to tell what version of a package is installed after applying them, but it makes some sense. There are some leftover bits of cruft that I need to excise in the next patch (they're from intermediate versions of the code) but I wanted to commit this now that it's compiling and not obviously breaking anything. Still to do: * The initial state is passed around in many ways when creating solution successors; I should look at whether weights really need to store an initial state, and whether we need to pass an initial state in as a parameter. (similarly, if weights do need an initial state, should we also pass one as an argument to root_node?). * We need test cases for this new code. * If solution_weights continues to store an initial state, maybe it should be renamed to something more accurate. * Need to ensure that aptitude_resolver.cc stops using p.current_version() in favor of get_initial_state().version_of(p). * Need to check that aptitude_resolver_universe doesn't depend on the initial version being the InstVer in unexpected ways. e.g., look at the broken dep iterator.
2009-01-31Use the new operator<< overloads to eliminate all the intermediate streams ↵Daniel Burrows1-210/+61
in the problem resolver logging.
2009-01-31Use the new LOG_* macros instead of LOG4CXX_*.Daniel Burrows1-68/+68
2009-01-30Use the central repository for the dependency resolver's logger.Daniel Burrows1-1/+3
2009-01-30Use log4cxx for the resolver debug messages, rather than writing to stdout ↵Daniel Burrows1-182/+247
by hand. Calling set_debug(true) will set up the logger to mimic the past behavior, but once I get hooks in to configure logging, it will be possible to send output to a log file, to enable some messages and not others, etc. It might be good to have more logging domains than just the one, but I'm not sure how to split the log messages up right now.
2008-08-23Remove the max-successors option from the code and documentation.Daniel Burrows1-2/+1
I never found a good use for this option, its most likely effect is to lead to exponential blowup, and it makes it hard to efficiently implement the behavior of picking the broken dependency with the fewest number of successors.
2008-08-23When generating a successor for a solution, always pick the dependency that ↵Daniel Burrows1-57/+47
creates the least number of successors. Since which dependency we pick is arbitrary, it makes sense to pick the one that makes the tree less branchy. As before, we always prefer dependencies that impinge on user constraints, in order to get those out of the way up-front. This makes the max_successors option meaningless; it should be purged from the configuration and from the documentation.
2008-04-16Modified most header files descriptions to be Doxygen-parsable.Obey Arthur Liu1-3/+10
2008-04-06Don't spin forever trying to run a safe-upgrade when some packages have new ↵Daniel Burrows1-0/+23
Recommendations. The problem here was that aptitude didn't consider allowing a recommendation to stay broken to violate a requirement that a resolving version of the package should be chosen. The result was that the safe resolver kept asking for more versions, thinking that it was monotonically approaching the solution, but it was actually just building a power-set of possibilities wrt which recommendations were to be installed.
2008-03-13Don't allow packages to be removed or changed to a different version to ↵Daniel Burrows1-14/+26
"fix" recommendations. Empirically speaking, this is generally not useful, so don't generate it as a possible solution. This is done simply by not considering other versions of the source package of soft deps; the UI that lists solutions to a given dependency also had to be tweaked to know about soft deps (ew, this knowledge should be in the resolver).
2008-03-13Add support in the backend for adding a score that's only applied if a set ↵Daniel Burrows1-3/+30
of actions are all performed. Hopefully this will provide a reasonable basis for handling conflicts/provides/replaces relationships: the idea is basically to add a bonus to "remove this pacakge and install its replacement", so the resolver can climb over this hill. The next step is to detect c/p/r relationships and actually add these scores to the resolver.
2008-03-06Allow the user to manually invoke the 'reject hold-breaking actions' logic.Daniel Burrows1-2/+2
2007-12-15Fix the generation of the visited-packages set to include all the packages ↵Daniel Burrows1-7/+36
involved in broken deps for any enqueued solution. This is necessary since the number of broken deps affects the order in which solutions are processed.
2007-12-09Include the number of steps for which the resolver was run in the vector of ↵Daniel Burrows1-2/+3
solution information. Actually this is an upper-bound on the number of steps we ran for; the main goal is to allow us to reproduce the same solution later by using the same tick count, so some built-in leeway is a good idea (it might even be good to increase the tick count by a factor of 2 when writing the test file later).
2007-12-03Add an optional (untested) parameter to find_next_solution() that ↵Daniel Burrows1-11/+39
accumulates a trace of the packages related to a given package. This is all the packages that were ever examined as the source or target of a dependency. TODO: I'd like to be able to write this set with packages that don't appear in the set pruned from dependencies. Can this be done?
2007-11-15Fix some includes in generic/Daniel Burrows1-2/+1
2007-11-14First pass over the code.Daniel Burrows1-15/+16
This tree version is still BROKEN. This commit changes a bunch of code mechanically, and completely fixes all the subdirectories and files through download_screen in the top-level directory. Some unfortunate namespace choices in cwidget showed up here. widgets and config should probably be merged into the cwidget namespace, and I've created namespace aliases that pretend this happened as I go through the .cc files. Luckily, that change can largely be accounted for automatically.
2007-07-15Improve error output for weirdness.Daniel Burrows1-0/+4
2007-04-22[aptitude @ Cleanly handle exceptions thrown by the dependency resolver.]Daniel Burrows1-0/+1
Previously, the program would unceremoniously abort when the resolver tossed an exception; now exceptions are caught, propagated to the main loop, and reported to the user. It's even possible to keep searching for more solutions, although some solutions (the ones on the branch that blew up) are probably toast.
2007-03-10[aptitude @ In the resolver, include information about the current state ↵Daniel Burrows1-15/+117
(e.g., what the solution under consideration is and which dependency wasn't broken) when an assertion fails. Hopefully means I get more useful info in bug reports!]
2005-11-26[aptitude @ Correct how conflicts are added for solutions: strip information ↵Daniel Burrows1-1/+18
about the dependency for which we removed a source. Without this change we would generate more solutions containing a solution that involved removing dependency sources (possibly).]
2005-11-16[aptitude @ Accumulate as much information as possible about conflicts, by ↵Daniel Burrows1-1/+9
always checking all outstanding dependencies for immediate solvability, so later conflicts are not hidden by earlier ones.]
2005-11-15[aptitude @ Add an extra sanity-check while setting up the resolver.]Daniel Burrows1-1/+9
2005-11-10[aptitude @ Throw an exception instead of abort()ing when an unexpectedly ↵Daniel Burrows1-9/+12
non-broken dependency is encountered.]
2005-11-10[aptitude @ Fix the debugging output for unexpectedly broken dependencies.]Daniel Burrows1-3/+3
2005-11-05[aptitude @ Replace all uses of assert with eassert.]Daniel Burrows1-22/+22
2005-10-31[aptitude @ When possible, make solutions into conflicts so that conflict ↵Daniel Burrows1-2/+19
tracking knows about them.]
2005-10-28[aptitude @ Write a full description of the concepts involved in the ↵Daniel Burrows1-75/+295
abstract package system interface in the doxygen comments, and correct the class documentation of the generic problem resolver.]
2005-10-20[aptitude @ Debug the insertion of every conflict.]Daniel Burrows1-3/+11
2005-10-20[aptitude @ Expose add_conflict publicly, so it can be used to discard the ↵Daniel Burrows1-27/+29
null solution.]
2005-10-01[aptitude @ Import the Subversion repository into darcs.]Daniel Burrows1-0/+2542