close
Skip to content

Preserve candidate-selection metadata during resolution#74

Draft
charliermarsh wants to merge 8 commits into
mainfrom
charlie/version-set-selection-metadata
Draft

Preserve candidate-selection metadata during resolution#74
charliermarsh wants to merge 8 commits into
mainfrom
charlie/version-set-selection-metadata

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

Add VersionSet::selection_eq to distinguish extensional version-set equality from candidate-selection interchangeability. Eq and Hash remain based solely on contained versions, and all solver term relations remain membership-only.

Use selection_eq only 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 VersionSet contract by requiring selection_eq to 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. Existing VersionSet implementations retain their current behavior through the default self == other implementation.

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.

@codspeed-hq

codspeed-hq Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing charlie/version-set-selection-metadata (45562e8) with main (1856af6)

Open in CodSpeed

@charliermarsh
charliermarsh force-pushed the charlie/version-set-selection-metadata branch from e3d7e69 to e86d343 Compare July 3, 2026 15:24
@charliermarsh charliermarsh changed the title Preserve candidate-selection metadata when merging dependencies Preserve candidate-selection metadata during resolution Jul 3, 2026
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.

1 participant