26 Commits

Author SHA1 Message Date
Niels Thykier
37c179f5f3 solver: Emit single items together and early
Technically, we simply sort by the "hint-size", but it for most parts
have the effect of putting single item earlier.  Note this is /not/ a
perfect solution, but it is a simple heuristic exploiting the common
case.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 20:33:06 +02:00
Niels Thykier
49a7323ecb installability/builder.py: Reuse local variable
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 20:33:06 +02:00
Niels Thykier
a9ee64470e Always use pkg ids in the InstallabilityTester API
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 20:33:06 +02:00
Niels Thykier
3d5d328738 Use inst_tester to compute smooth updatable binaries
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 19:33:22 +02:00
Niels Thykier
289807463e Rewrite computation and testing of "affected" packages
Rely on the Installability tester to locate all of the affected
packages plus their transitive reverse dependencies.  As the
InstallabilityTester is suite agnostic, the set of affected packages
now includes (versions of) packages not in testing, which is filtered
out during the check.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-09 21:06:06 +02:00
Niels Thykier
8eb1abede3 InstTester: Clarify some documentation
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-09 17:38:33 +02:00
Niels Thykier
6047875953 inst-tester: Fix bug "choices" would not be updated
In some scenarios, it was possible to trigger a bug in the
installability tester, where it would fail to update the "choices" set.
The requirements for triggering this seems to be something like:

 * Obtain a choice that is possible to solve.
 * Resolve the choice without recursing (with a backtrack point)
 * Obtain a second choice that is impossible to solve.

After the two first steps, the installability tester would fail to
update the "choices" set (or, rather, changes would be invisible to
the "_pick_choice" function).  Fortunately, most packages are either
trivially installable or trivially uninstallable, so the bug seems to
be rather rare if triggred at all.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
b4e4ba4681 Collect more statistics from the installability tester
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
2a34970304 Compute simple stats installability tester graph
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
5d6ba15520 solver.py: Remove unused import
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Niels Thykier
074eb46766 Remove unused assignments/parameters
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Julien Cristau
37ff82d1e0 Use python3-style super() 2015-04-26 18:20:10 +02:00
Julien Cristau
6c344589ee Remove dependency on six
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
2e20d9c7ad Use super() instead of explicitly calling our superclass
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
18f7101847 Use six.moves for itertools, urllib and intern
They're renamed in python3.

Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
2eee806263 Stop using dict.iter* methods
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:09 +02:00
Julien Cristau
94f18322db Switch to print_function
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:09 +02:00
Niels Thykier
12691baa87 Exploit equivalency to skip unneeded computation
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-08-04 20:20:33 +02:00
Niels Thykier
2576366dd0 inst-tester: Attempt to avoid needing to backtrack
When trying to break a choice, try the candidate out and see if we can
pick it without any consequences.  Basically, if the candidate causes
no new conflicts or choices, we can safely pick it.

Signed-off-by: Niels Thykier <niels@thykier.net>
2014-08-04 20:20:16 +02:00
Niels Thykier
4babb75f8f inst-tester: Exploit eqv. table in compute_testing_installability
Use the equvilence table to skip some calls to _check_inst.

Signed-off-by: Niels Thykier <niels@thykier.net>
2014-08-04 20:20:16 +02:00
Niels Thykier
72daebd67c installability: Exploit equvialency to reduce choices
For some cases, like aspell-dictionary, a number of packages can
satisfy the dependency (e.g. all aspell-*).  In the particular
example, most (all?) of the aspell-* look so similar to the extent
that reverse dependencies cannot tell two aspell-* packages apart (IRT
to installability and co-installability).

This patch attempts to help the installability tester by detecting
such cases and reducing the number of candidates for a given choice.

Reported-In: <20140716134823.GA11795@x230-buxy.home.ouaza.com>
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-08-04 20:20:03 +02:00
Niels Thykier
4009d1b244 inst/builder.py: Move a comment and write doc for method
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-07-19 09:51:36 +02:00
Niels Thykier
72e67fee7a Solver: Add more (optional) debugging output
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-06-15 18:20:23 +02:00
Niels Thykier
2079b1fb5e Add auto hinter on top of the new installability tester
The "new" auto hinter relies on partial ordering to determine, when
what can migrate (and what needs to migrate at the same time).  At the
same time, it leverages on "_compute_groups" to allow it to include
"removals" in its hints.

Signed-off-by: Niels Thykier <niels@thykier.net>
2014-06-08 17:51:50 +02:00
Adam D. Barratt
4f48872102 Fix a crash during installability testing
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2014-02-27 18:12:54 +00:00
Niels Thykier
7051d5b0e9 Rewrite installability tester
The new Installability Tester (IT) module replaces the remaining
C-parts.  Unlike C-implementation, it does not give up and emit an
"AIEEE" half-way through.

In order to determine installability, it uses two sets "musts" and
"never".  As the names suggest, the sets represents the packages that
must be (co-)installable with the package being tested and those that
can never be co-installable.  For a package to be installable, "musts"
and "never" have remain disjoint.

These sets are also used to reduce the number of alternatives that are
available to satisfy a given dependency.  When these sets are unable
to remove the choice completely, the new IT defers the choice to later.
This occasionally reduces backtracking as a later package may conflict
or unconditionally depend on one of the remaining alternatives.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-11-27 19:46:59 +01:00