Skip to content
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

Solver refactoring #1739

Merged
merged 10 commits into from
Nov 23, 2024
Merged

Solver refactoring #1739

merged 10 commits into from
Nov 23, 2024

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Aug 15, 2024

This reworks the recursive solver we have into an A*-like sequential one. The advantages are: cleaner implementation, better maintainability, no need to start the search several times to find a good incomplete solution (once we find an incomplete one, it will be decent enough and it means no complete one exists), simpler options for usage.

For users there should be no noticeable changes.

Copy link

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 21, 2024
@mosteo mosteo removed the Stale label Nov 21, 2024
@mosteo mosteo marked this pull request as ready for review November 21, 2024 10:16
Copy link
Member

@Fabien-Chouteau Fabien-Chouteau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I fully understand the code but it looks well organized and documented.

I am a bit worried about the dependency on a growing number of very small libraries.

.gitmodules Outdated
@@ -57,6 +57,9 @@
[submodule "deps/dirty_booleans"]
path = deps/dirty_booleans
url = https://github.com/mosteo/dirty_booleans
[submodule "deps/compare_to_case"]
path = deps/compare_to_case
url = https://github.com/mosteo/compare_to_case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too fond of having a dependency project with only one function in it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the concern. I was operating from the idea of not having in Alire logic unrelated to its function, but what is the minimum reusable code that makes worthwhile moving it into a new crate is certainly debatable.

I will move that function for now into Alire.Utils.

-- a veeery long time when many crates/releases must be considered. TODO:
-- All these policies can go away once we move from a recursive solver to
-- a non-recursive priority-based one.
-- When looking for releases within a crate, which one to try first. The
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is the strategy for Alire?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alire defaults to newest first, unless the global switch --prefer-oldest is used, which affects get, search and show. Notably, alr update (and automatic updates after manual manifest edition) don't honor it, so I've had for a time the idea of moving it to a setting, so the behavior is globally consistent.

@mosteo mosteo merged commit 20dc457 into alire-project:master Nov 23, 2024
24 checks passed
@mosteo mosteo deleted the feat/solver-mk2 branch November 23, 2024 09:24
Commit : constant String := "unknown";
Changes : constant String := "unknown";
Commit : constant String := "c3dade93403aaacec59097e450a22ce83e0ceb0f";
Changes : constant String := "dirty";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to include this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, thanks for the catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants