Repository navigation
Conversation
Merging this PR will improve performance by ×94
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
zaniebot
force-pushed
the
zb/restrict-conflict-world
branch
from
September 29, 2026 22:33
747d45b to
95ecc61
Compare
zaniebot
changed the base branch from
zb/bench-universal-conflict-markers
to
zb/resolve-activated-extras-in-bdd
September 29, 2026 22:34
charliermarsh
pushed a commit
to astral-sh/uv
that referenced
this pull request
Oct 16, 2026
Keep an environment marker when it describes the dependency under every valid conflict selection. Retain conflict-dependent and impossible edges so lockfile readers can still discover conflicting transitive extras. Port astral-sh#2149. Related to #21954.
charliermarsh
added a commit
to astral-sh/uv
that referenced
this pull request
Oct 18, 2026
## Summary When a project declares mutually exclusive extras, we can add every forbidden pair to dependency markers that otherwise depend only on Python version or platform. This makes those markers grow quadratically with the number of conflicting extras. We now keep just the environment condition when it describes the dependency for every valid selection. For example, with mutually exclusive extras `a` and `b` (using shortened extra names): ```diff -python_full_version < '3.11' or (extra == 'a' and extra == 'b') +python_full_version < '3.11' ``` Removing these terms before DNF conversion reduces conversion and serialization work. The narrower environment markers also let us discard wheels that are unreachable in every valid selection. We retain conflict-dependent and impossible edges so lockfile readers can still discover and report conflicting extras requested by transitive dependencies. | Items in conflict set | Pairwise construction | Union construction | | --- | ---: | ---: | | 2 | 165 ns | 165 ns | | 8 | 4.99 µs | 0.772 µs | | 32 | 83.8 µs | 3.12 µs | | 128 | 1.66 ms | 12.4 µs | Ports astral-sh#2149. Related to #21954. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
charliermarsh
pushed a commit
to astral-sh/uv
that referenced
this pull request
Oct 18, 2026
Keep an environment marker when it describes the dependency under every valid conflict selection. Retain conflict-dependent and impossible edges so lockfile readers can still discover conflicting transitive extras. Port astral-sh#2149. Related to #21954.
This branch was successfully deployed
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.
Lockfiles with many
tool.uv.conflictscan repeat every invalid extra combination on dependencies whose availability depends only on the environment. Keep the environment marker when it is equivalent for every valid conflict selection, while retaining conflict-dependent and impossible edges needed to diagnose transitive conflicts. Stacks on #2148.Hyperfine 2.0.0 measurements of 3b3a7b5ed → bcff78c48 used release builds of the complete CLI with
rustc 1.99.0 (b940084d7 2026-09-28)on an AMD EPYC-Genoa Linux VM, pinned to four CPUs. Output went to/dev/null. The supplied interpreter was CPython 3.12.13.Commands include
uv lock --no-index --find-links WHEELS. Synthetic conflict workspaces use local wheels and vary mutually exclusive extras, shared package names, and environment-only dependencies; a no-conflict case provides a control. Within the supported Python range>=3.12,<3.14, the root declaresextra-000below Python 3.13 andextra-001from Python 3.13. Completeuv lockcommands perform resolution and serialize new locks. Each command starts a fresh process; OS pages, local wheel metadata, and interpreter-query caches are warm. Fresh-lock cases removeuv.lockoutside wall time and RSS. No external index, source backend, or package installation is used.Values are means, parent → head. Changes are
(head / parent - 1)with 95% confidence intervals; negative values indicate a reduction.Each workload used ten comparison blocks with alternating revision order, one warmup followed by three measured runs per revision in each block (30 measurements per revision). The pointwise 95% percentile-bootstrap intervals use 20,000 resamples of paired block means and retain all samples. They estimate within-run uncertainty, not variation across machines, independent builds, or separate benchmark campaigns.
The 30- and 50-extra conflict cases ran 4.64% and 9.03% faster, and the wider 16-extra case ran 11.83% faster. The two- and nine-extra cases and the no-conflict control have inconclusive runtime intervals. RSS fell by 0.41% and 0.44% in the eight- and nine-extra cases; the other six RSS intervals include zero. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.