Track priorities in a set and allow updating from uv#42
Draft
Track priorities in a set and allow updating from uv#42
Conversation
This wrapper avoids accessing the `incompatibility_store` directly in uv
code.
Before:
```rust
let dep_incompats = self.pubgrub.add_version(
package.clone(),
version.clone(),
dependencies,
);
self.pubgrub.partial_solution.add_version(
package.clone(),
version.clone(),
dep_incompats,
&self.pubgrub.incompatibility_store,
);
```
After:
```rust
self.pubgrub.add_incompatibility_from_dependencies(package.clone(), version.clone(), dependencies);
```
`add_incompatibility_from_dependencies` is one of the main methods for
the custom interface to pubgrub.
* Use new GitHub output syntax * Fix tag message
This is used in uv for logging
This allows discarding a previously made decision if it turned out to be a bad decision, even if all options with this decision have not yet been rejected. We allow attempting to backtrack on packages that were not decided yet to avoid the caller from making the duplicative check. astral-sh/uv#8157
CodSpeed Performance ReportCongrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Eh2406
reviewed
Jan 24, 2025
| let current_decision_level = self.current_decision_level; | ||
| self.package_assignments | ||
| .get_range(self.prioritize_decision_level..) | ||
| .get_range(current_decision_level.0 as usize..) |
There was a problem hiding this comment.
seems like we could directly iterate over prioritized_potential_packages and outdated_priorities instead of iterating over all of package_assignments. I think this method is only used by UV, so not sure what semantics you need.
Member
Author
There was a problem hiding this comment.
we use this to make prefetches, and i think currently in a kind of inefficient way. we need to emit a prefetch at least the first time we see a package, and at most when its range changes; the previous and this was good enough in profiling for now.
f58a60f to
3fb04c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In uv, we were updating package priorities without syncing them uv, so uv and pubgrub were getting out of sync. We couldn't previously do this because the way priority updates were done. Instead, we switch to tracking the packages whose derivations changed in a set, based on pubgrub-rs/pubgrub@dev...Eh2406:pubgrub:stop-prioritize. Since uv priorities don't depend on the ranges, we can speed this up further by not using this set in uv. In pubgrub, we can upstream this and use it as a correctness fix to also reprioritize when the conflict tracker changed, which is currently not handled.
Also exposes
into_rawsince we start using it on the uv side.