Skip to content

Merge dependencies more effectively in D.Solver.Modular.IndexConversion. #5035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 23, 2018

Conversation

grayjay
Copy link
Collaborator

@grayjay grayjay commented Jan 14, 2018

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!


This commit is a more thorough fix for the problem that
4f7ac10 attempted to fix. 4f7ac10 combined
all dependencies on the same package within the same build-depends or
build-tool-depends field, in order to avoid performance problems in the solver
QuickCheck tests. That wasn't enough to prevent the solver from creating many
duplicate dependencies when converting the PackageDescription to the
solver-specific format, though. When a package contained many conditionals that
each contained the same dependency in both branches, the solver lifted those
dependencies out of the conditionals without deduplicating them.

This commit moves the step that merges dependencies after the step that lifts
common dependencies out of conditionals.


This PR should fix the CI failures that appeared in #5023. The issue was introduced by #4929.

This commit is a more thorough fix for the problem that
4f7ac10 attempted to fix.  4f7ac10 combined
all dependencies on the same package within the same build-depends or
build-tool-depends field, in order to avoid performance problems in the solver
QuickCheck tests.  That wasn't enough to prevent the solver from creating many
duplicate dependencies when converting the PackageDescription to the
solver-specific format, though.  When a package contained many conditionals that
each contained the same dependency in both branches, the solver lifted those
dependencies out of the conditionals without deduplicating them.

This commit moves the step that merges dependencies after the step that lifts
common dependencies out of conditionals.
@grayjay grayjay force-pushed the solver-quickcheck-performance-issue branch from 855f66f to 59febb1 Compare January 20, 2018 08:32
This commit adds to the previous one by merging dependencies even when they have
different DependencyReasons.  This change should completely prevent the
dependency-lifting feature from causing exponential growth of dependencies.  It
also improves the memory usage test by putting each dependency under a different
flag, meaning that every dependency has a different DependencyReason.
@grayjay grayjay force-pushed the solver-quickcheck-performance-issue branch from ac72ace to a5fefbd Compare January 21, 2018 05:31
@grayjay
Copy link
Collaborator Author

grayjay commented Jan 23, 2018

I'll merge this, since all but two of the build jobs finished.

@grayjay grayjay merged commit 08cfc6f into haskell:master Jan 23, 2018
@grayjay grayjay deleted the solver-quickcheck-performance-issue branch January 23, 2018 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant