<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/solver3.h, branch main</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=main</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2026-05-17T18:10:59Z</updated>
<entry>
<title>solver3: Follow installed Suggests earlier</title>
<updated>2026-05-17T18:10:59Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-05-17T18:09:37Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=10a05580e74e2ba5a5768d45c6f9feff216c8689'/>
<id>urn:sha1:10a05580e74e2ba5a5768d45c6f9feff216c8689</id>
<content type='text'>
We accidentally followed "keepauto" and friends earlier, breaking
`apt why` for suggested packages.

Reported-By: uau on IRC
</content>
</entry>
<entry>
<title>solver3: Upgrade by source package</title>
<updated>2026-02-17T09:28:17Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-02-17T09:28:17Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=9f3ecca2b32e4fe56a05811392e01416092f85fa'/>
<id>urn:sha1:9f3ecca2b32e4fe56a05811392e01416092f85fa</id>
<content type='text'>
Implement the "APT::Get::Upgrade-By-Source-Package" option as
the classic solver does.

Here this is equally straight forward now: We enqueue optional, but
eager, clauses of the form

    foo=2 -&gt; foo-data=2

for each sibling in the source version, assuming they are currently
installed, and the selection is not the current version.

This softly enforces upgrades of already installed siblings, but
in non-strict-pinning mode it will not affect the selection of
new packages to be installed.

A more complete solution to version selection by source package
also seems feasible, where we change the "priority" of versions
in the solver dynamically - currently they are statically evaluated.
Such that, when you select foo=2, and something installs foo-data,
foo-data would be installed in version 2 even if version 3 were its
candidate.
</content>
</entry>
<entry>
<title>solver3: Use constexpr and noexcept in most places</title>
<updated>2026-02-10T19:59:03Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-02-06T14:50:04Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=42dab6a46748ac80f0217212932b74af1af94017'/>
<id>urn:sha1:42dab6a46748ac80f0217212932b74af1af94017</id>
<content type='text'>
Aside from Clause, which initializes an std::vector
and an std::forward_list, which do not have constexpr
constructors in C++17, we can turn our inline functions
constexpr.

Using `constexpr` implies `inline`, so simplify that
accordingly where needed.

Adding noexcept to the function allows STL components
to utilize more optimized code paths.

Marking SameOrGroup as constexpr significantly improves
performance due to being in the hot path and it now being
inlined - removing branching by 10%.

iolveiolver
</content>
</entry>
<entry>
<title>solver3: Cache straight pointers in candidate cache</title>
<updated>2026-02-10T19:59:03Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-02-09T10:42:26Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=a08f18e2a1b7e409d2d20d55749d378d4c21daa6'/>
<id>urn:sha1:a08f18e2a1b7e409d2d20d55749d378d4c21daa6</id>
<content type='text'>
This reduces its memory usage by half and turns it into a
fast map - no destructors needed (and 0 initialization).
</content>
</entry>
<entry>
<title>solver3: Mark DependencySolver as final</title>
<updated>2026-02-10T19:59:03Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-02-01T08:31:10Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=27e845d53da7e1794eadeb93f4b6f591042ad20c'/>
<id>urn:sha1:27e845d53da7e1794eadeb93f4b6f591042ad20c</id>
<content type='text'>
</content>
</entry>
<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>solver3: Ensure rule-of-3 memory safety for ContiguousCacheMap</title>
<updated>2026-01-05T21:20:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2026-01-04T16:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=5bdd21f915d1af832e9d3b874ddbd3ba2a178a06'/>
<id>urn:sha1:5bdd21f915d1af832e9d3b874ddbd3ba2a178a06</id>
<content type='text'>
</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>
</feed>
