Preserve candidate-selection metadata during resolution#74
Draft
charliermarsh wants to merge 8 commits into
Draft
Preserve candidate-selection metadata during resolution#74charliermarsh wants to merge 8 commits into
charliermarsh wants to merge 8 commits into
Conversation
charliermarsh
force-pushed
the
charlie/version-set-selection-metadata
branch
from
July 3, 2026 15:24
e3d7e69 to
e86d343
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.
Summary
Add
VersionSet::selection_eqto distinguish extensional version-set equality from candidate-selection interchangeability.EqandHashremain based solely on contained versions, and all solver term relations remain membership-only.Use
selection_eqonly when compacting dependency incompatibilities. Dependencies with equal version membership but different candidate-selection behavior remain separate, while selection-equivalent dependencies can still be merged.Strengthen the
VersionSetcontract by requiringselection_eqto be an equivalence relation and a congruence across version-set operations. Selection-equivalent ranges must also be interchangeable for dependency prioritization and version choice. Candidate-selection metadata may change which contained version is chosen, but it must not change whether a candidate exists. ExistingVersionSetimplementations retain their current behavior through the defaultself == otherimplementation.PubGrub does not propagate metadata from constraints that are already satisfied by version membership. Regression coverage confirms membership-only relations for equal and strict-subset terms, preserves the decided-package invariant, distinguishes metadata-sensitive dependencies during compaction, merges structurally distinct but selection-equivalent dependencies, and retains collision-safe merging behavior.
Supports astral-sh/uv#20098.