<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/solver3.cc, branch 2.9.4</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=2.9.4</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=2.9.4'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2024-05-24T15:01:55Z</updated>
<entry>
<title>solver3: Fix translations of removals for marked install</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-23T11:24:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=4a2b89be6fa73b9c193d5b70e11a9305272efc3e'/>
<id>urn:sha1:4a2b89be6fa73b9c193d5b70e11a9305272efc3e</id>
<content type='text'>
We also need to issue a MarkDelete() if the package is marked for
installation currently but should not be, not only if it did not
have a previous version.

This fixes the final test in test-multiarch-barbarian, the others
only needed adjustments to mark all packages as automatic.
</content>
</entry>
<entry>
<title>solver3: Actually restore unsolved items rather than solved ones</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-21T14:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=aaa9e415ce48964726401462767d6038da6d82e7'/>
<id>urn:sha1:aaa9e415ce48964726401462767d6038da6d82e7</id>
<content type='text'>
When restoring previously solved items, we try to restore items
that have become unsolved again by skipping items that have a
solved solution.

Well at least we thought we did, but we accidentally had a "not"
in there that inverted the meaning, hence we lost work items on
backtracking.

This mostly did not seem to have caused any issues, I stumbled
over it while trying to add `autoremove` listings to `upgrade`,
but fixing it also fixes:

    test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings

This used to say "E: Broken packages", meaning the solver lost
a non-optional install request and the 2nd stage solver caught
an incomplete solution.

Also test-bug-735967-lib32-to-i386-unavailable restores the legacy
solver behavior, so win win?
</content>
</entry>
<entry>
<title>solver3: Use stable sort</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-21T11:19:41Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=808f51e800a9d6a834723fe1d1fdff98ee14d7b5'/>
<id>urn:sha1:808f51e800a9d6a834723fe1d1fdff98ee14d7b5</id>
<content type='text'>
While it seems that libstdc++ is using stable_sort for sort,
we should make this explicit: We don't want items in our queues
to move ahead of earlier items of the same priority.

i.e. consider dependencies, they are grouped by package, we don't
want the sort algorithm to move B=2 ahead if A|B (which expands to
A=2|A=1|B=2|B=1).
</content>
</entry>
<entry>
<title>solver3: Solve optional dependencies before optional packages</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-20T12:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=cd245a57f273d3c069543c19d6ac31c84879ce7b'/>
<id>urn:sha1:cd245a57f273d3c069543c19d6ac31c84879ce7b</id>
<content type='text'>
This somewhat improves reliability of not breaking Recommends, e.g.
if the Recommends gets tightened. One test case enabled by this now
is the test-resolver-provider-exchange, which with a simple change
to allow removal of automatically installed packages works now.
</content>
</entry>
<entry>
<title>solver3: Promote satisfied Suggests to Recommends</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-19T19:24:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=0fa3b176652ff10276569a478c910ca866a4da5d'/>
<id>urn:sha1:0fa3b176652ff10276569a478c910ca866a4da5d</id>
<content type='text'>
As per the test-suggests-promoted-to-recommends test. This is still
a bit messy as we ignore alternative choices and only check the last
one, but um seems useful?
</content>
</entry>
<entry>
<title>solver3: Try candidate before installed version on upgrade</title>
<updated>2024-05-24T15:01:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-19T15:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=acb77872861834d3c5b98ca2e81e0336a388e9f0'/>
<id>urn:sha1:acb77872861834d3c5b98ca2e81e0336a388e9f0</id>
<content type='text'>
This fixes --no-strict-pinning attempting to upgrade all the versions
on the system. Adjust the upgrade test case accordingly:

1) no-strict-pinning pulls in systemd despite it being pinned down due
   to a dependenc (this was true before this fix)
2) no-strict-pinning does not pull in the upgrade-simple because nothing
   depends on it (this is what the test fixes)
</content>
</entry>
<entry>
<title>solver3: Implement APT::Solver::RemoveManual to allow removing manual packages</title>
<updated>2024-05-24T11:43:56Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-24T11:42:11Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=67a8a6470ddb8a603db02c5fab84aa225dc00f8d'/>
<id>urn:sha1:67a8a6470ddb8a603db02c5fab84aa225dc00f8d</id>
<content type='text'>
This is mostly going to be useful for the test suite for now,
implement a function there to set it up so we can use it to
improve test suite correctness.
</content>
</entry>
<entry>
<title>Initial implementation of the 3.0 solver</title>
<updated>2024-05-14T09:56:18Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2024-05-06T13:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=89dcc342e17dd2439d97a5d27200cf5c26ba35bc'/>
<id>urn:sha1:89dcc342e17dd2439d97a5d27200cf5c26ba35bc</id>
<content type='text'>
This is a simple backtracking brute-force solver with heurisitcs,
this initial version has the following known gaps:

- Errors are not kept from branches, the error reporting after
  backtracking isn't particularly useful.
- We cannot show automatically removed packages
- We cannot replace packages with others
- We do not have conflict-driven clause learning yet

Untested:

- Multi-arch

This solver is fundamentally different in key aspects:

- It solves smaller dependency groups before larger ones, leading
  us to avoid installing A in A|B if B is installed more often and
  more consistently.

- It only keeps the automatic packages reachable via the strongest
  path. Currently it only implements autoremoval, but not display
  of autoremoval as we simply enqueue all automatically installed
  packages at the end when not doing automatic removal.

  This will need some translation where we Solve() first, and then
  Solve() again with the automatically installed packages added such
  that we can mark them as Garbage for display purposes.

- It does not remove manually installed packages.

Hook the solver in via the EDSP framework, this allows us to achieve
easy initial integration without lots of issues.

A lot of this work was planned and executed in my free time and then
some leaked into work time I suppose.

Implementation notes:

- Restore the full backlog of items

  The annoying thing is that we record only when an item was enqueued
  and not the level at which it was installed, so when going back a
  decision level we might have to reinstall packages that were queued
  at an earlier decision level because they were only installed at a
  later decision level.

- When picking one version, reject the others

- Propagate conflicts up to reverse dependencies

  This will recursively mark every reverse dependency that can
  no longer be satisfied as MUSTNOT.

  Also make sure to recursively call Reject(Ver) from Reject(Pkg)
  to make sure we trigger the Rejections there.

  This means we now end up having Recursion in the algorithm. An
  alternative approach would be to push *reject* items to the heap
  and then do them, but this is not entirely straight forward and
  it may simply not be necessary.

-  Sort upgrades before other optional installs containing subsets

  If I want to upgrade a package A, I schedule A3|A2|A1; if another
  thing depends specifically on A1; we'd not be installed. Hence we
  need to sort upgrades first.

  This only is needed for optional packages; manual packages will
  figure this out naturally.

- Rescoring is lazily implemented. Instead of calling make_heap()
  after rescoring items, we just mark the items as dirty and reinsert
  them. We also only rescore from the main solve loop, Reject() marks
  the heap as needing a rescore due to a Conflict (as some versions will
  no longer be installable), and RescoreWorkIfNeeded() then will do the
  rescoring.

- Recursive unit propagation: Install() and Reject() recursively call
  each other to promote decisions across single-version dependencies
  (or across not-anymore satisfiable reverse-depends).

- Make Reason constructors explicit, this enhances readability

  This makes calls like the one in here be

    Reject(object, Reason(otherObject))

  Ensuring that it's clear that the 2nd argument is a reason at the
  caller side.

- Split Decision into Decision and Hint vs. first draft

  When branching/deciding, we do not want to override SHOULD and MAY.
  We do not actually use them yet, and we do actually clean them when
  backtracking, but let's at least keep the data structure correct.

  Convert the enum to a 16-bit integer so we can still fit in the same
  space as before.
</content>
</entry>
</feed>
