<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/solver3.cc, branch 3.1.15</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=3.1.15</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=3.1.15'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2026-01-31T16:30:20Z</updated>
<entry>
<title>solver3: Use classical watchers for propagation</title>
<updated>2026-01-31T16:30:20Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-29T17:47:15Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=1fbb857b6b2cbddcea9e8b03aa0c766c72e91f34'/>
<id>urn:sha1:1fbb857b6b2cbddcea9e8b03aa0c766c72e91f34</id>
<content type='text'>
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 -&gt; mailutils:amd64=1:3.18-1 -&gt; mailutils:amd64 -&gt; postfix:amd64=3.9.1-10ubuntu1

The new decision tree is:

    lsb:amd64 -&gt; lsb-core:amd64 -&gt; 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
</content>
</entry>
<entry>
<title>Erased items do not exist anymore</title>
<updated>2026-01-31T14:10:14Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-29T21:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=267fd0117a057afd88bc15bfb4f4d688804a9ab4'/>
<id>urn:sha1:267fd0117a057afd88bc15bfb4f4d688804a9ab4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>solver3: Use LiftedBool for Obsolete state</title>
<updated>2026-01-31T14:08:29Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-01-06T10:45:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=ceca5e8d0f9e1a1c5297ed79f00ca76c61e2140c'/>
<id>urn:sha1:ceca5e8d0f9e1a1c5297ed79f00ca76c61e2140c</id>
<content type='text'>
Quite a convenient way since we need exactly lifted bool semantics
</content>
</entry>
<entry>
<title>why: Render info about all providers on virtual packages</title>
<updated>2026-01-20T13:07:15Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-01-20T13:04:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=34876ed2e5cdf504e2a4f9721486d279ae5f3be6'/>
<id>urn:sha1:34876ed2e5cdf504e2a4f9721486d279ae5f3be6</id>
<content type='text'>
Refactor code into a doOne helper lambda, and then add loop
over the providers to use it.

This fixes a crash seen by Benjamin in a nice way than just
failing :)

Reported-by: Benjamin Drung
</content>
</entry>
<entry>
<title>solver3: Modernize std::find() to std::ranges::contains</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-29T20:26:24Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=62fa3858d12f163de7db81f6e2be770e39783238'/>
<id>urn:sha1:62fa3858d12f163de7db81f6e2be770e39783238</id>
<content type='text'>
Where applicable
</content>
</entry>
<entry>
<title>solver3: Add a strange assertion</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-29T15:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=f02f90021c255ef3aa578e00758cbc62e7fc82dd'/>
<id>urn:sha1:f02f90021c255ef3aa578e00758cbc62e7fc82dd</id>
<content type='text'>
I do not know why I don't hit this
</content>
</entry>
<entry>
<title>solver3: Remove Push() and refactor Solve()</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-05-20T11:13:45Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=f8dd5ea23c6a7fccf643329c50ae1f11f48b1a09'/>
<id>urn:sha1:f8dd5ea23c6a7fccf643329c50ae1f11f48b1a09</id>
<content type='text'>
This method is no longer needed technically speaking, we should
use Assume() instead. It turns out that there is a slight bug in
the propagation and some clauses that are unit end up on the heap
rather than having been propagated away, so we temporarily need
to keep an if for that around.

To accomodate the switch from Push() to Assume() we need to make
sure that the work item is pushed to our trail *after* we
have assumed it, such that reverting pushes it back to the work
heap.

Refactor the code to consistently use Assume() rather than supporting
Enqueue(), this vastly simplifies things. This is not fully accurate
in the current model and leads to unnecessary decision levels, since
sometimes we seem to be reaching unit clauses here.

This preserves traversal order by first removing the item from the
heap and then adding it back if we need to solve it again.
</content>
</entry>
<entry>
<title>solver3: Re-use existing error message code in Solve()</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-28T20:42:32Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=d0643f993d3c6c42ea10d5ce3a02d964b7693a7f'/>
<id>urn:sha1:d0643f993d3c6c42ea10d5ce3a02d964b7693a7f</id>
<content type='text'>
We can just re-use Enqueue() here to produce our conflict
message why am I being silly and duplicate this.
</content>
</entry>
<entry>
<title>solver3: Rename depth to level</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-28T15:59:17Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=ee82f420e7a303b5d92302134401e465b386de94'/>
<id>urn:sha1:ee82f420e7a303b5d92302134401e465b386de94</id>
<content type='text'>
Matches the rename of depth() to decisionLevel() at a shorter
name.
</content>
</entry>
<entry>
<title>solver3: Rename decision to assignment</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-12-28T15:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=21d099878ed8c34f3b13747bcec380e0402e57a3'/>
<id>urn:sha1:21d099878ed8c34f3b13747bcec380e0402e57a3</id>
<content type='text'>
The previous use of decision here conflicted with the use
of decision level and the general notion of having made a
decision, because the assignment might have been propagated
as a matter of fact.
</content>
</entry>
</feed>
