Daniel Robbins isolated the problem in the area of code:
> for pkg in pkgs:
> eliminate_pkg = True
> for atom in atom_pkg_graph.parent_nodes(pkg):
> if len(atom_pkg_graph.child_nodes(atom)) < 2:
> eliminate_pkg = False
> if eliminate_pkg:
The problem is that the order of iteration of the pkgs set is random. This causes packages to be removed from atom_pkg_graph in random order, and their removal affects the atom_pkg_graph.child_nodes(atom) results for packages processed in later iterations of the loop, leading to a random outcome.
Patch posted for review:
This is in the master branch:
Released in 2.3.11.