-
Notifications
You must be signed in to change notification settings - Fork 69
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
Feat/generic pool #309
Feat/generic pool #309
Conversation
The Record trait no longer has a `name()` function so I think it acts more like a version than a record.
Wow, impressive that it's passing our test suite! Awesome! I am also not sure how we should proceed given the performance regression. That might be a little annoying to end-users since we already enabled the new solver in pixi. Should we make a solver-development branch instead? |
I think I can solve the performance regressions tomorrow! |
@baszalmstra @wolfv Okay so we'll keep this PR open, until the performance regressions are fixed? |
Yes! should be fixed pretty soon! |
It's for the internal tests anyway I think the error message and format used there is a little more generic because it removes the ambiguity of the upper bound, which I hope helps a random person looking at the solver tests for the first time. Also decoupling it more from conda in the same time. |
Ah, OK, so to confirm, the error messages we would see in pixi are the same? |
For sure! |
I was running the benchmark locally and it was only ~10% slower max so I'm fine with merging |
When I added LTO it is the same again on my M1. |
Description
PR that makes the Rust libsolv solver generic on a couple of traits and the current conda ecosystem uses these traits. The traits you currently need are:
VersionTrait
defines what a version specification is. We might be able to get rid of some requirements on this later. For Conda this is aPackageRecord
.VersionSet
this is the set of version which you can use to match something that implementsVersionTrait
.DependencyProvider
this has a function that determines how candidates selected by the solver should be ordered. This is custom per ecosystem.The reason for doing this is to be able to integrate other ecosystems like
PyPi
into the solver and see if this can work. We now know the generic requirements currently needed by the solver.All the conda specific code has been moved to
rattler_solve
. I think if all tests succeed this is in state that it could potentially be merged. All the tests are succeeding locally so I suppose the whole thing should be a drop in replacement.It does have a performance regression, namely that we are copying a lot of PackageRecords. Regression range from
13% - 77%
depending on the test, so that's quite a lot. However, I think it would be good to review and merge before it gets bigger :) Then look atPackageRecord
improvement.In the solver tests I've made a bespoke version and matching spec that could potentially be a source of inspiration for an implementation.
Todo's in code
Some TODO's have been added to the code where we could potentially improve some aspects.
Some notable todo's:
lru
would just work.Name
type in theVersionTrait
that might be able to move toPool
Traits
of pulling these requirements into thetraits
. This goes against the last point, however. And we should see what we prefer. It's also totally possible to keep these methods ecosystem specific, with some potential duplication.rattler_solve
or is this something we actually want? :)sort_candidates
type-safe as of now they can can by anySolvableId
it would be nice to be able to actually use the subset returned by the pool when matching on the name. Could introduce a new type for this that can only be constructed in such a situation.What's next?
&PackageRecord
type instead of thePackageRecord
value, avoiding copies.