Repository navigation
Conversation
9ea8a81 to
8e7b0da
Compare
8e7b0da to
054fce3
Compare
054fce3 to
92d7d9b
Compare
Merging this PR will improve performance by 12.61%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | from_hex/uppercase[48] |
341 µs | 295.9 µs | +15.27% |
| ⚡ |
Simulation | discover_workspace_from_all_members |
152.6 ms | 138.7 ms | +10.02% |
| 🆕 | Simulation | bdd[16] |
N/A | 11 µs | N/A |
| 🆕 | Simulation | bdd[256] |
N/A | 11 µs | N/A |
| 🆕 | Simulation | bdd[64] |
N/A | 11 µs | N/A |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing zb/bughuntperf/230-conflict-environment-bdd (996a81e) with main (5a94b66)2
Footnotes
-
35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(725b74b) during the generation of this report, so 5a94b66 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
92d7d9b to
de18405
Compare
4fe0965 to
e5fab1f
Compare
| }); | ||
| self.create_node(node.var.clone(), children) | ||
| } | ||
| _ => NodeId::FALSE, |
There was a problem hiding this comment.
[P2] Handle VersionString nodes explicitly
This fallback also matches legitimate Variable::VersionString nodes, which the constructor creates for Darwin platform_release comparisons. On Darwin with release 24.10.0, platform_release >= '24' and extra == 'foo' therefore becomes FALSE instead of retaining the extra condition. Consequently, conflict validation can accept an unresolved outside-subgraph conflict because the result appears constant. Handle VersionString using the parsing and range-selection semantics in evaluate_reporter_impl, add a Darwin regression case, and match variable variants exhaustively so omissions cannot silently become false.
| marker.only_extras_for_environment(&env), | ||
| m("extra == 'foo'") | ||
| ); | ||
| logs_contain("Comparing 10 and 2 lexicographically"); |
There was a problem hiding this comment.
[P3] Assert that the warning was emitted
logs_contain returns a boolean, but this test discards it. Removing the new warning-reporting calls would therefore leave the warning regression test passing. Assert the result or use logs_assert, as the nearby warnings4 test does, so the test actually protects the diagnostic behavior.
| (Variable::String(key), Edges::String { edges }) => { | ||
| let value = env.get_string(*key); | ||
| edges | ||
| .iter() | ||
| .find_map(|(range, child)| { |
There was a problem hiding this comment.
[P3] Share environment-node evaluation between the traversals
This traversal duplicates the environment decisions in MarkerTree::evaluate_reporter_impl, including version parsing, string comparisons, and lexicographic warnings. Dependency evaluation and conflict validation must interpret these expressions identically, but semantic or diagnostic changes now require coordinated edits in two modules. Extract the common environment-child selection into a private helper, keeping memoization and extra-node reconstruction specific to this traversal.
| group.bench_function(BenchmarkId::new("bdd", alternatives), |benchmark| { | ||
| benchmark | ||
| .iter(|| black_box(marker).only_extras_for_environment(black_box(&environment))); |
There was a problem hiding this comment.
[P3] Benchmark the existing conflict_for_environment entry point
Timing only the newly added helper prevents running this benchmark against the base implementation; restoring DNF expansion in conflict_for_environment would also leave these measurements unchanged. Construct uv_resolver::UniversalMarker::from_combined(marker) outside the timed loop and benchmark conflict_for_environment instead. uv-bench already depends on uv-resolver, so this retains the focused component measurement while enabling comparison across revisions and covering the optimized production call path.
424b7e9 to
996a81e
Compare
996a81e to
37584da
Compare
Validating conflicts for a selected locked dependency subgraph restricts mixed environment and conflict markers to the active Python environment. Expanding those markers to DNF first can enumerate many alternatives even when only one environment branch applies. Have
UniversalMarker::conflict_for_environmentfollow the decision diagram directly, memoize shared subtrees, and retain the extra decisions needed for conflict selection. The traversal handles complemented edges, evaluates PEP 751 list markers with empty extras and dependency groups, and retains the lexicographic marker-warning path. For an input ofMarkerTree::TRUE, the resulting conflict marker now remainstrueinstead of becomingfalse.The PR also adds a separate CodSpeed-compatible benchmark for
MarkerTree::only_extras_for_environment, using 16, 64, or 256 synthetic platform/extra alternatives. Its helper clock excludes construction of those inputs.Hyperfine 2.0.0 measurements of 6a7747355 → 996a81eed used identical production API drivers built in release mode with
rustc 1.99.0 (b940084d7 2026-09-28)on an AMD EPYC-Genoa Linux VM, pinned to four CPUs. The measured base is the merge base before three commits; the comparison includes their combined production changes and does not isolate the final commit. Output went to/dev/null.Each fresh
uv-hyperfine-markercomponent process restricts syntheticUniversalMarkerinputs to a fixed environment withconflict_for_environment; it does not invoke theuvCLI. The inputs combine platform and extra alternatives, vary the matching input position, include a miss and a complemented marker, and include a pure-extra control. First and last refer to input construction position, not established decision-diagram traversal order. One case makes a single call; the others make 1,000 calls per process. The constantMarkerTree::TRUEinput is outside these workloads.Argument parsing, marker and environment construction, the API calls, output and teardown are included. Repeated calls within one process are not independent samples. These workloads do not measure a complete
uvcommand. Each process uses the production allocator and warm OS pages. Peak RSS includes input construction and API scratch memory; it is not an allocation count or a helper-only memory delta. No network operation occurs.Values are means, base → head. Changes are
(head / base - 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.
Nine runtime intervals show reductions; the pure-extra control interval includes zero. Four RSS intervals show reductions, and the other six are exactly zero. For the 256-alternative first-input case, every RSS observation was identical within each arm, producing coincident interval endpoints. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory. For very small processes, an inherited startup peak from Hyperfine can impose a floor on reported RSS.