summaryrefslogtreecommitdiff
path: root/src/generic/problemresolver
AgeCommit message (Collapse)AuthorFilesLines
2009-07-06When modifying a step tier, if it was previously in "pending" and it is a ↵Daniel Burrows1-0/+11
viable candidate (below the deferral tier), clear the "finished" flag. This avoids a problem where if a deferral was retracted after the resolver had run out of solutions, we wouldn't find any more answers.
2009-07-06If we're trying to un-defer a solver that's embedded in a step as an action, ↵Daniel Burrows1-1/+5
call recompute_step_tier() on that step. Necessary since the step might still be waiting to be examined.
2009-07-06Fix visit_choice_mapping_solvers_of_dep.Daniel Burrows1-3/+9
The goal is to find the one and only choice that has the dependency, so when trying to find a choice in the hash map, we need to use a choice that has that dependency built in (due to the identity semantics of choices).
2009-07-06Better logging when the resolver needs to retract a deferral.Daniel Burrows1-0/+2
2009-07-05Use Boost flyweight objects to store dependency solver sets.Daniel Burrows1-2/+4
2009-07-05Reimplement choice_set in terms of boost::unordered_set.Daniel Burrows4-196/+169
There is a cost in memory to this change. But the win in terms of speed is *huge*. How huge? Well, when compiled without optimization, the new code is now 4-5 times faster than the previous code *with* optimization and something like 20-30 times faster than 0.5.2.
2009-07-05Make sure that hash_cache_dirty is always initialized to "true" when ↵Daniel Burrows1-0/+1
creating a dep-solvers object.
2009-07-05Since choice-set installations hold a reference to the set they contain, we ↵Daniel Burrows1-1/+2
shouldn't pass a temporary there, ever. Turned up with valgrind.
2009-07-01Flatten out the top level of dep solver information.Daniel Burrows1-25/+111
No noticable performance gains from this -- but I'm not surprised; the bulk of the non-flat data is probably stored in the choice_set attached to each solver. Flattening that is the next step.
2009-07-01Hide the representation of the solvers set from client code.Daniel Burrows2-33/+101
This is another step towards switching to a more efficient representation.
2009-06-30Turn tracking back on -- the apparent cost was an artifact of having ↵Daniel Burrows1-2/+1
profiling turned on by accident. Profiling has a nasty tendency to cause very fast functions which are executed often to appear MUCH more costly than they are. Reference-counting such as this takes a particular hit.
2009-06-30Switch to boost::flyweight from the custom memoization the resolver was doing.Daniel Burrows2-40/+39
In addition to eliminating that code, this change should make it easier to change the representation of dep_solvers (since I won't have to figure out how to memory-manage whatever-it-is).
2009-06-27Fix the promotion sanity-check to not claim that global promotions apply to ↵Daniel Burrows1-1/+1
a solver. If a solver's tier is below the step's tier, the sanity-check was claiming that the global promotion which had raised the step's tier should also apply to the solver, even if it didn't contain that solver. Fixed by restricting that test to (correctly) only consider promotions containing the solver in question.
2009-06-27Ensure that promotions with exactly one element are flagged properly.Daniel Burrows1-0/+60
Previously, we were unable to find promotions that matched a solver and nothing else. With these changes, the output of the resolver is identical to the pre-rewrite version, although it seems to still visit too many nodes.
2009-06-27When generating successors, make sure that promotions which apply to one ↵Daniel Burrows1-0/+25
child are picked up by the others.
2009-06-25Improve logging of find_highest_incipient_promotion*.Daniel Burrows1-2/+2
Output domains are logged now.
2009-06-25Don't treat it as an error when a solver already exists when it's added.Daniel Burrows1-4/+1
Some dependencies legitimately list a solver twice; we already should handle this gracefully, and it isn't actually a sign of brokenness elsewhere.
2009-06-25Fix the incipient promotion stuff in the case of solutions containing broken ↵Daniel Burrows1-1/+4
soft deps. It was counting wrong, so these sometimes showed up as containing promotions they shouldn't have, or as not containing promotions they should have.
2009-06-25Pass through whether solvers are really new / erased.Daniel Burrows1-4/+4
Needed for the new sanity-checks.
2009-06-25More logging of find_incipient_promotions_containing().Daniel Burrows1-0/+3
2009-06-25Add sanity-checks to problemresolver.h.Daniel Burrows1-2/+171
These are expensive and compiled out by default, but useful for empirically verifying that the resolver isn't going wrong. Right now it is.
2009-06-25Make choice_indexed_map::try_get a const method.Daniel Burrows1-1/+1
2009-06-24When looking for promotions, don't discard maximum-tier promotions.Daniel Burrows1-15/+18
Previously some of these were being thrown away, because the code was keeping promotions that were strictly less than the maximum tier (oops).
2009-06-24Log a more reasonable amount of stuff relating to the promotion set at INFO, ↵Daniel Burrows1-2/+2
and enable the new logging by default with --log-resolver. Currently, the only INFO level message is the existing promotion that a new promotion was redundant with.
2009-06-23Don't consider the current version of a package to be a solver of a dependency.Daniel Burrows1-0/+8
2009-06-23Fix how we determine when choices are deferred.Daniel Burrows1-1/+15
Choices that install a different version of the source of a dependency should cause solvers of that dependency to be deferred.
2009-06-19Manage the closed set using boost::unordered_set.Daniel Burrows1-14/+49
Hopefully this is a bit more scalable.
2009-06-19Fix the compare-choices-by-effects function object so that it handles ↵Daniel Burrows1-3/+3
different types of choices correctly. It was returning 3-way comparison results in some cases and Booleans in others, so totally dissimilar choices ended up comparing "equal".
2009-06-19When a dependency is forced, don't leave the parent step hanging around in ↵Daniel Burrows1-0/+4
the queue. This was causing steps to be processed multiple times.
2009-06-19Tweak another log line for easier parsing.Daniel Burrows1-1/+1
2009-06-18Spit out the number of actions in a step when logging the "Examining" line.Daniel Burrows1-1/+1
Makes it easier to write a much simpler renderer.
2009-06-18Fix how the size of a choice_indexed_set is counted.Daniel Burrows1-4/+10
2009-06-18Generalize promotions before using them to strike choices.Daniel Burrows1-2/+6
Without this, bad stuff was happening, like spurious entries in the structural-reasons list that triggered internal sanity checks.
2009-06-17Don't follow forced dependencies when the target is not a processed tier.Daniel Burrows1-1/+2
This doesn't have a practical effect (those steps weren't being processed anyway), but it does suppress spurious errors in the logs.
2009-06-17Log the new solvers set that was created by removing a choice after we ↵Daniel Burrows1-4/+4
update it, not before.
2009-06-17Strip out the sanity-check now that I found the error it was looking for.Daniel Burrows1-21/+0
2009-06-17When generating a successor for a solver whose intrinsic tier is below the ↵Daniel Burrows1-1/+2
parent step's tier, use the parent step's tier. Previously, the code was decreasing the tier in the successor.
2009-06-17Add a temporary sanity-check to the incremental promotion code.Daniel Burrows1-0/+21
Some promotions are never being applied, for reasons that are not currently clear. The sanity check ensures that promotions are always applied, and also logs an error if it ever trips, to help track this down.
2009-06-17Tone the logging around unresolved deps back down.Daniel Burrows1-7/+0
If I need this again, I should probably just make it a separate logging category -- hopefully I won't, though.
2009-06-17When finding new unresolved dependencies, check forward dependencies of the ↵Daniel Burrows1-0/+13
newly selected version, not just reverse dependencies.
2009-06-17Better logging of what's happening while dependencies are being generated.Daniel Burrows1-0/+10
2009-06-16Implement a queuing system for new promotions.Daniel Burrows2-21/+255
The idea is that if there are only "a few" new promotions, it's quicker to test them individually than to use the full promotion set. The exact parameters of what "a few" means should probably be configurable at runtime, not least so I can easily get some statistics on what the effects of various settings are.
2009-06-16Give choice_set both the ability to find choices contained in a particular ↵Daniel Burrows2-4/+90
choice, and to find choices that contain a particular choice.
2009-06-16Fix the documentation of get_containing_choice.Daniel Burrows1-1/+1
2009-06-16Compute the size of choice indexed maps.Daniel Burrows1-5/+25
2009-06-15Instead of always doing a full incremental recomputation of each step's tier ↵Daniel Burrows2-25/+93
whenever a promotion is added, just retest tiers when steps are pulled off the queue. This seems to be a win overall, probably because most of the computation in the case where lots of promotions have been added is a waste (since the steps won't be processed anyway, or another promotion will come along and override the one that was applied). I would still like to explore a hybrid model, where promotions are applied incrementally if only "a few" have been added since a step was generated -- that should vastly speed up scanning smallish subtrees.
2009-06-15Use unordered containers to return results from promotion lookups too.Daniel Burrows2-11/+11
These don't have any impact on performance that I can see one way or the other -- which probably means they don't hurt much in smaller cases, so it's a cheap way to avoid scalability surprises since the hash tables should be better for large inputs.
2009-06-15Agressively use boost unordered sets/maps for the internal structures of the ↵Daniel Burrows1-53/+58
promotion set.
2009-06-15Instead of copying deps_solved_by_choice, pass it directly to the ↵Daniel Burrows1-25/+6
promotion-finding routine.
2009-06-15Actually make it feasible to invoke the incipient-promotion-finder on ↵Daniel Burrows1-3/+4
non-bool inputs.