On Tue, Oct 17, 2006 at 07:44:52AM +0200, Frank Küster <[EMAIL PROTECTED]> was 
heard to say:
> Daniel Burrows <[EMAIL PROTECTED]> wrote:
> 
> > On Mon, Oct 16, 2006 at 09:45:16AM +0200, Frank Küster <[EMAIL PROTECTED]> 
> > was heard to say:
> >> Daniel Burrows <[EMAIL PROTECTED]> wrote:
> >> 
> >> >   That's one interesting question.  We can get some more of the answer
> >> > by passing "-o aptitude::cmdline::resolver-debug=true" and capturing the
> >> > output (warning, this generates a LOT of text).  
> >> 
> >> Here's the output.  I answered "n" to aptitude's suggestions until it
> >> agreed to upgrade teTeX.
> >> 
> >> Regards, Frank
> >
> >   At a quick glance, I think that this is where it runs into trouble:
> >
> >> Trying to resolve tetex-extra 3.0.dfsg.2-2 -> {latex-beamer 
> >> 3.06.dfsg.1-0.1} by installing tetex-extra 2.0.2c-8 from the dependency 
> >> source
> >> Trying to resolve tetex-extra 3.0.dfsg.2-2 -> {latex-beamer 
> >> 3.06.dfsg.1-0.1} by installing tetex-extra [UNINST] from the dependency 
> >> source
> >> Trying to resolve tetex-extra 3.0.dfsg.2-2 -> {latex-beamer 
> >> 3.06.dfsg.1-0.1} by installing latex-beamer 3.06.dfsg.1-0.1
> [...]
> >   It thinks that it's better to remove tetex-extra (score -509) than
> > to try to install latex-beamer (score -1028) or to drop the
> > recommendation (score -959).  My guess is that this is due to the
> > penalty for unresolved dependencies in a partial solution: it looks like
> > things are getting better when tetex-extra is dropped (thus fixing all
> > its dependencies) relative to the other solutions.  It looks like a lot
> > of the dependencies are "forced", meaning that they have only one
> > solution, so I wonder if I could improve results in this case by firing
> > all those constraints immediately. (this would just be a hack/heuristic,
> > though)
> 
> I don't understand this - what's so special about tetex-extra?  And how
> does tetex-extra_2.0.2c-8 come in to play?
> 
> Anyway, if you think you have a fix, I'm happy to test it.

  Ah, sorry.  The problem here is that aptitude sees a Recommendation

    tetex-extra 4.0.dfsg.2-2 -> {latex-beamer 3.06.dfsg.1-0.1}

  that didn't exist in the old version of tetex-extra and won't be
fulfilled in the current partial solution it's looking at.  There are
four ways to fix this problem:

  (a) Install latex-beamer.
  (b) Remove tetex-extra.
  (c) Revert tetex-extra to its current version (2.0.2c-8).
  (d) Leave this Recommendation unsatisfied.

  Here aptitude applies the following scores:

    (a) is weighted against because it significantly increases the number
        of broken dependencies (the scoring mechanism is more complicated
        than that, but that's the dominant factor here).  Broken deps are
        penalized in the hopes that it will help us reach a solution sooner,
        but it does mean that sometimes aptitude is reluctant to commit to
        commit to solutions that will transiently break dependencies (as
        above).

        You can fiddle with this parameter by passing
         
          -o Aptitude::Problem-Resolver::BrokenScore=N
        
        where the default value for N is -100; setting N to a lower value
        will penalize broken deps more heavily, while setting it to a
        higher value will reduce the penalty (setting it to a positive
        value will actually reward broken dependencies -- probably not
        what you want!)

    (b) is weighted against because aptitude doesn't like to remove packages;
        however, the weight isn't too severe, since otherwise the resolver
        tends to run in circles trying to avoid a necessary removal.

        The option Aptitude::Problem-Resolver::RemoveScore controls
        this weight, with a default value of -300.  In other words,
        aptitude would rather try a solution with 3 extra broken
        dependencies than try removing a package.  However, if a
        package has multiple broken dependencies, the resolver will
        tend to consider removing it first (since removing a package
        always resolves all its dependencies) as long as nothing
        else depends on it.

    (c) holding back tetex-extra has the highest initial score, which is
        why this gets presented first.  However, once you step over
        all the solutions that include this (aside from the one that
        removes all of X, which gets an incredibly low score), you're
        stuck with doing something else.

    (d) leaving recommendations unsatisfied (that is, giving up on
        ever resolving them, as opposed to just having a recommendation
        that's not solved yet) is weighted against since they're supposed
        to be almost as strong as dependencies: they get a score of -200.
        This has to strike a balance between being too eager to "fix"
        recommendations (possibly removing the package that asserts them
        or doing other harm) and being too laid-back about ignoring them
        (in which case they'll always be ignored all the time).

        The option controlling this is
        Aptitude::ProblemResolver::UnfixedSoftScore.

  As I understand it, the problem is that aptitude is ranking (b)
above (a) and (d).  This meets the design goal of "produce a sensible
solution first where possible", since (c), the first solution,
conservatively holds tetex back, but it might be nice to do better
in the second solution than we do now.

  A few straightforward things I could try:

  (1) Expand "forced" dependencies -- dependencies with only one
      alternative -- more eagerly.  This might allow us to see that
      the broken deps incurred by installing latex-beamer will go
      away in short order.

  (2) Never try to resolve a recommendation by eliminating its source.
      The problem here is that (for technical reasons) this would probably
      also eliminate any question of holding back the source to resolve
      a recommendation.  Moreover, it's arguable that recommendations
      should be obeyed to the point of removing packages where they're
      unmet (since removing a recommendation often breaks the package
      badly).

      This could be acheived without too much disruption by adding a new
      flag on package versions that says "never install this to fulfill
      a softdep", then setting this flag on all UNINST versions.  I think
      that would be satisfactory and put the "technical reasons" to rest.

  (3) Fiddle with the weights until we get the result we want.  This runs
      a significant risk of making the resolver produce bad results
      or explode in cases where it works now...and unfortunately, I
      don't have a good test suite of "here's what we want in these cases"
      that would ensure that I didn't make things worse.

  Daniel

Attachment: signature.asc
Description: Digital signature

Reply via email to