haskell / haskell/cabal

Solver: Combine goal-ordering heuristics more effectively by assigning scores to goal choices

Open
#3,488 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: solver type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

@kosmikus mentioned this in https://github.com/haskell/cabal/issues/3453#issuecomment-222078560.

The scoring would be similar to the scoring described in #2860, except that it would apply to goals, instead of package, flag, and stanza choices. Scoring all nodes might actually be a simplification after #2860 is implemented.

Currently, the solver applies goal-ordering heuristics by either stably sorting the available goals or pruning non-preferred goals (when other goals are available). This approach gives too much weight to some of the heuristics, particularly the earlier pruning steps. Pruning is also problematic because it leaves fewer goals for features like `--reorder-goals` and "dynamic goal reordering" to work with. See https://github.com/haskell/cabal/issues/3453#issuecomment-222064219.

If heuristics were instead expressed as scores on goals, then the heuristics could be combined in a way that gives more control over their relative impact on the goal order that is used to explore the tree.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.