diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-12-29 18:47:15 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2026-01-31 17:30:20 +0100 |
| commit | 1fbb857b6b2cbddcea9e8b03aa0c766c72e91f34 (patch) | |
| tree | 120116a10a15504e3776591c264aef5c1c31c356 /test | |
| parent | 267fd0117a057afd88bc15bfb4f4d688804a9ab4 (diff) | |
solver3: Use classical watchers for propagation
Instead of tracking dependencies and reverse dependencies,
install classical watchers. This vastly streamlines the
propagation code and allows us to easily switch to literals
in the next step.
This implementation watches _all_ solutions rather than using
the modern 2-watched literals scheme or the intermediate
head/tail watchers.
Ultimately a more effective watcher scheme would be interesting
but not a significant priority seeing as most of the solver runtime
is spent not in propagation but in problem translation.
decision trees
--------------
The new watchers produce slightly different decision trees, sometimes
subtly changing solutions. Notably in various observed examples in
Ubuntu 25.04, courier was installed as an MTA instead of postfix:
The old decision tree was:
apcupsd:amd64 -> mailutils:amd64=1:3.18-1 -> mailutils:amd64 -> postfix:amd64=3.9.1-10ubuntu1
The new decision tree is:
lsb:amd64 -> lsb-core:amd64 -> courier-mta:amd64=1.3.13-1
The difference here being that lsb-core declares a mail-transport-agent
dependency whereas mailutils depends on `default-mta | mail-transport-agency`;
but both are effectively subject to selection at similar time.
Further work is needed to optimize selection. A notable choice may also
be to deal with broken packages like lsb-core that declare dependencies
solely on a virtual package by reconstructing the default provider for
that package utilizing default-* dependencies or similar notions.
Likewise in the test suite, explanations are different in some
uninstallable cases.
backtracking
~~~~~~~~~~~~
The following major changes were observed in the 25.04 test suite:
-tmp/regression-remove/07f0a068-36c2-11f0-b7c1-fa163e171f02:18
+tmp/regression-remove/07f0a068-36c2-11f0-b7c1-fa163e171f02:3
-tmp/regression-remove/32078f70-3734-11f0-a75a-fa163ec8ca8c:64
+tmp/regression-remove/32078f70-3734-11f0-a75a-fa163ec8ca8c:19
Other test cases showed little deviation, +/- 1, generally
the same amount of backtracking.
performance
~~~~~~~~~~~
Running Ubuntu's regression test suite resulted in no significant
performance difference being observable.
Before: 290s user time; 16.66% solver
After: 299s user time; 17.36% solver
Tests where run with make -j 8 and solver performance extracted
perf report --symbol-filter=ResolveExternal --stdio
Diffstat (limited to 'test')
10 files changed, 58 insertions, 44 deletions
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index cb423cd59..d1b6003ea 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -33,10 +33,10 @@ done buildsimplenativepackage 'foo' 'i386,amd64' '1.0' testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. foo:amd64 is not selected for install because: - 1. foo:i386=1.0 is selected for install - 2. foo:amd64 Conflicts foo:i386 - 2. foo:amd64=1.0 is selected for install" aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver 3.0 + 1. foo:i386=1.0 is selected for install + 2. foo:i386 is not selected for install because: + 1. foo:amd64=1.0 is selected for install + 2. foo:i386 Conflicts foo" aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Note, selecting 'foo:i386' instead of './incoming/foo_1.0_i386.deb' diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 8abc7c854..d829dc84e 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -37,7 +37,6 @@ Solving dependencies...Install coolstuff:i386 () Delete extracoolstuff:i386 [0] Reject:extracoolstuff:i386 () [0] Install:coolstuff:i386 (coolstuff:i386=1.0) -Optional Item (0@0) coolstuff:i386 -> | extracoolstuff:i386 Recommended packages: extracoolstuff diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info index 712a9ba14..9ea5c7386 100755 --- a/test/integration/test-bug-601961-install-info +++ b/test/integration/test-bug-601961-install-info @@ -61,7 +61,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: findutils : Depends: essentialpkg but it is not going to be installed E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. essentialpkg:i386 is selected for removal - 2. essentialpkg:i386 is selected for install because: - 1. findutils:i386 is selected for install - 2. findutils:i386 Depends essentialpkg' aptget remove essentialpkg --trivial-only --solver 3.0 + 1. findutils:i386 is selected for install + 2. findutils:i386 Depends essentialpkg + but none of the choices are installable: + - essentialpkg:i386 is selected for removal' aptget remove essentialpkg --trivial-only --solver 3.0 diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index 9bc83cce4..f504abfcc 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -19,14 +19,15 @@ testmarkedauto python-uno openoffice.org-common # The 3.0 solver does not remove openoffice.org-emailmerge because it is manually installed. testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. openoffice.org-common:i386=1:3.2.1-11+squeeze2 is not selected for install because: - 1. python-uno:i386=1:3.3.0-2 is selected as an upgrade - 2. python-uno:i386=1:3.3.0-2 Depends libreoffice-common - 3. libreoffice-common:i386 Conflicts openoffice.org-common - 2. openoffice.org-common:i386=1:3.2.1-11+squeeze2 is selected for install because: + 1. openoffice.org-common:i386 is selected for install because: 1. openoffice.org-emailmerge:i386 is selected for install 2. openoffice.org-emailmerge:i386 PreDepends openoffice.org-common - 3. openoffice.org-common:i386 is available in version 1:3.2.1-11+squeeze2" aptget --trivial-only install python-uno --solver 3.0 -o APT::Solver::RemoveManual=false + 2. openoffice.org-common:i386 is available in version 1:3.2.1-11+squeeze2 + but none of the choices are installable: + - openoffice.org-common:i386=1:3.2.1-11+squeeze2 is not selected for install because: + 1. python-uno:i386=1:3.3.0-2 is selected as an upgrade + 2. python-uno:i386=1:3.3.0-2 Depends libreoffice-common + 3. libreoffice-common:i386 Conflicts openoffice.org-common" aptget --trivial-only install python-uno --solver 3.0 -o APT::Solver::RemoveManual=false testfailureequal 'Reading package lists... Building dependency tree... Reading state information... diff --git a/test/integration/test-bug-675449-essential-are-protected b/test/integration/test-bug-675449-essential-are-protected index d7e284ece..fb67f71aa 100755 --- a/test/integration/test-bug-675449-essential-are-protected +++ b/test/integration/test-bug-675449-essential-are-protected @@ -126,7 +126,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo : Depends: libfoo but it is not going to be installed E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. libfoo:amd64 is selected for removal - 2. libfoo:amd64 is selected for install because: - 1. foo:amd64 is selected for install - 2. foo:amd64 Depends libfoo' aptget purge libfoo -s --solver 3.0 + 1. foo:amd64 is selected for install + 2. foo:amd64 Depends libfoo + but none of the choices are installable: + - libfoo:amd64 is selected for removal' aptget purge libfoo -s --solver 3.0 diff --git a/test/integration/test-bug-961266-hold-means-hold b/test/integration/test-bug-961266-hold-means-hold index e95bb6ed6..fe678b0c9 100755 --- a/test/integration/test-bug-961266-hold-means-hold +++ b/test/integration/test-bug-961266-hold-means-hold @@ -90,15 +90,21 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: git-ng : Depends: git (> 1:2.26.2) E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. git-ng:amd64=1:2.26.2-1 is selected for install - 2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.) + 1. git:i386=1:2.26.2-1 is selected for install because: + 1. git-ng:amd64=1:2.26.2-1 is selected for install + 2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.) + [selected git-ng:amd64] + For context, additional choices that could not be installed: + * In git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.): + - git:amd64=1:2.26.2-1 is not selected for install because: + 1. git:amd64=1:2.25.1-1 is selected for install + 2. git:amd64=1:2.26.2-1 conflicts with other versions of itself + 2. git:i386=1:2.26.2-1 -> | git:i386 but none of the choices are installable: - - git:amd64=1:2.26.2-1 is not selected for install because: - 1. git:amd64=1:2.25.1-1 is selected for install - 2. git:amd64=1:2.25.1-1 conflicts with other versions of itself - - git:i386=1:2.26.2-1 is not selected for install because: + - git:i386 is not selected for install because: 1. git:amd64=1:2.25.1-1 is selected for install as above - 2. git:amd64 Conflicts git:i386' apt install git-ng -s --solver 3.0 + 2. git:i386 Conflicts git + [selected git:amd64=1:2.25.1-1]' apt install git-ng -s --solver 3.0 msgmsg 'Now mix it up by' 'holding git-cvs' diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index 184c84377..9d7f3696e 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -100,10 +100,10 @@ Conf extrastuff (1.0-1 unstable [all]) Conf coolstuff-provided (1.0-1 unstable [all])' aptget install coolstuff-provided -s testfailuremsg 'E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. extrastuff:i386=1.0-1 is not selected for install - 2. extrastuff:i386=1.0-1 is selected for install because: - 1. coolstuff-provided-broken:i386=1.0-1 is selected for install - 2. coolstuff-provided-broken:i386 Depends cool2 | stuff-abi-2' aptget install coolstuff-provided-broken --solver 3.0 -s + 1. coolstuff-provided-broken:i386=1.0-1 is selected for install + 2. coolstuff-provided-broken:i386 Depends cool2 | stuff-abi-2 + but none of the choices are installable: + - extrastuff:i386=1.0-1 is not selected for install' aptget install coolstuff-provided-broken --solver 3.0 -s testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers index 07a0033b1..ff521b026 100755 --- a/test/integration/test-prefer-higher-priority-providers +++ b/test/integration/test-prefer-higher-priority-providers @@ -92,15 +92,17 @@ Conf baz (1 unstable [all]) Conf awesome (1 unstable [all])" aptget install awesome foo- bar- -s testfailuremsg "E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. baz:$native is not selected for install - 2. baz:$native=1 is selected for install because: + 1. baz:$native=1 is selected for install because: 1. awesome:$native=1 is selected for install 2. awesome:$native Depends stuff [selected awesome:$native] For context, additional choices that could not be installed: * In awesome:$native Depends stuff: - foo:$native=1 is not selected for install - - bar:$native=1 is not selected for install" aptget install awesome foo- bar- baz- -s --solver 3.0 + - bar:$native=1 is not selected for install + 2. baz:$native=1 -> | baz:$native + but none of the choices are installable: + - baz:$native is not selected for install" aptget install awesome foo- bar- baz- -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index 16eb4f1ec..f7a1abcfe 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -449,10 +449,10 @@ The following packages have unmet dependencies: uninstallablepkg : Depends: libmtp8 (>= 10:0.20.1) but it is not going to be installed Depends: amarok-utils (= 2.3.2-2+exp) but it is not going to be installed E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. amarok-utils:i386=2.3.2-2+exp is not selected for install - 2. amarok-utils:i386=2.3.2-2+exp is selected for install because: - 1. uninstallablepkg:i386=1.0 is selected for install - 2. uninstallablepkg:i386 Depends amarok-utils (= 2.3.2-2+exp)" aptget install uninstallablepkg/experimental --trivial-only -V --solver 3.0 + 1. uninstallablepkg:i386=1.0 is selected for install + 2. uninstallablepkg:i386 Depends libmtp8 (>= 10:0.20.1) + but none of the choices are installable: + [no choices]" aptget install uninstallablepkg/experimental --trivial-only -V --solver 3.0 insertinstalledpackage 'libmtp8' 'i386' '1' insertinstalledpackage 'amarok' 'i386' '3' 'Depends: amarok-common (= 3), libmtp8 (>= 1)' diff --git a/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies b/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies index 7e770a30d..3f100cb1f 100755 --- a/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies +++ b/test/integration/test-ubuntu-bug-2111792-intersecting-dependencies @@ -97,15 +97,21 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: git-ng : Depends: git (> 1:2.26.2) E: Unable to satisfy dependencies. Reached two conflicting assignments: - 1. git-ng:amd64=1:2.26.2-1 is selected for install - 2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.) + 1. git:i386=1:2.26.2-1 is selected for install because: + 1. git-ng:amd64=1:2.26.2-1 is selected for install + 2. git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.) + [selected git-ng:amd64] + For context, additional choices that could not be installed: + * In git-ng:amd64 Depends git (> 1:2.26.2) and Depends git (< 1:2.26.2-.): + - git:amd64=1:2.26.2-1 is not selected for install because: + 1. git:amd64=1:2.25.1-1 is selected for install + 2. git:amd64=1:2.26.2-1 conflicts with other versions of itself + 2. git:i386=1:2.26.2-1 -> | git:i386 but none of the choices are installable: - - git:amd64=1:2.26.2-1 is not selected for install because: - 1. git:amd64=1:2.25.1-1 is selected for install - 2. git:amd64=1:2.25.1-1 conflicts with other versions of itself - - git:i386=1:2.26.2-1 is not selected for install because: + - git:i386 is not selected for install because: 1. git:amd64=1:2.25.1-1 is selected for install as above - 2. git:amd64 Conflicts git:i386' apt install git-ng -s + 2. git:i386 Conflicts git + [selected git:amd64=1:2.25.1-1]' apt install git-ng -s msgmsg 'Now mix it up by' 'holding git-cvs' |
