Repository navigation
Conversation
e1ee524 to
b402b93
Compare
b402b93 to
7bb2083
Compare
7bb2083 to
28608af
Compare
28608af to
906f5d1
Compare
| let (len, tail) = tail.split_once('-')?; | ||
| let len = len.parse::<usize>().ok()?; | ||
| let (package, tail) = tail.split_at_checked(len)?; |
There was a problem hiding this comment.
[P2] Reject zero-padded lengths when decoding conflict names
parse::<usize>() accepts 03, so extra-03-pkg-foo now resolves to the activation of pkg[foo]. However, the encoder produces only extra-3-pkg-foo: both the previous implementation and the BDD path treat the zero-padded spelling as a literal package extra. With foo selected and the literal extra inactive, the small-marker path can therefore include an unwanted dependency. Reject noncanonical length prefixes before lookup and cover this spelling in the encoded-looking-extra tests.
| marker.visit_extras(|_, extra| { | ||
| if !extras.is_empty() { | ||
| extras.insert(extra.clone()); |
There was a problem hiding this comment.
[P3] Preserve shared subgraphs during BDD traversal
visit_extras recursively visits both children without tracking visited nodes; deduplicating names in this callback does not deduplicate traversal. A conjunction of disjunctions with adjacent variable names, such as (extra == 'e00a' or extra == 'e00b') and ..., has a linear-size BDD but exponentially many traversal paths. The restrict_by implementation used by the substitutions also revisits shared children. Thus this path avoids DNF allocation while retaining exponential work on compact markers. Use memoized node traversal for discovery and restriction/substitution, and exercise this shared-subgraph shape.
| // Substitute extras in BDD variable order. Restricting a later variable before an earlier one | ||
| // can leave adjacent version/string ranges pointing at the same child, which is semantically | ||
| // equivalent but not canonical and can prevent downstream reachability from converging. |
There was a problem hiding this comment.
[P3] Remove the obsolete canonicalization ordering claim
Edges::map already calls map_ranges, which coalesces adjacent ranges after restriction. The newly added simplify_extras_preserves_canonical_ranges test also explicitly checks both substitution orders. This comment incorrectly makes canonicalization and convergence appear to depend on caller ordering, obscuring the guarantee owned by the marker implementation. Remove that claim; if sorting remains useful for deterministic execution or performance, document that rationale instead.
906f5d1 to
00d41cb
Compare
00d41cb to
8841e31
Compare
Requirements-txt export resolves activated extras in dependency markers. Expanding a wide marker into disjunctive normal form can create many clauses, while resolving each generated extra by scanning and re-encoding the known conflicts repeats work across graph edges.
Resolve markers with more than eight distinct extras directly in the BDD, and keep the DNF path for small markers. The small-marker path decodes generated extra, group, and project names for direct conflict lookup. The wide-marker path indexes the needed encoded conflicts once and substitutes extras in variable order, with canonical range coalescing so downstream reachability can converge. Markers without extras return unchanged.
Hyperfine 2.0.0 measurements of 1bf677913 → 28608af11 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.Each
uv export --frozen --no-emit-workspacecommand reads a synthetic, parent-generated workspace lock and formats requirements. The member declares extras that request shared wheel dependencies; conflict cases declare those extras mutually exclusive. Conditional cases export the root, which requestsextra-000below Python 3.13 andextra-001at or above 3.13. The constant case exports the member with--extra extra-000. A no-conflict case uses the same declared-extra shape.The table counts declared member extras and shared and common wheel names. Input locks contain markers with up to 4–50 distinct extra names in the conflict cases; the no-conflict control has at most one per input marker. The widths describe input-lock markers, not measured helper inputs; no retained runtime trace establishes whether an export enters the greater-than-eight-extra path. Each complete command includes lock parsing, dependency-graph construction and requirements formatting. Each command starts a fresh process with warm OS pages, local wheel metadata and interpreter-query caches. The parent-generated lock is unchanged between invocations; no package installation or source build runs.
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.
Six conflict-case runtime intervals show reductions, including the constant-member export; the four-extra, eight-extra, and no-conflict intervals include zero. RSS increased in the nine-extra and both 16-extra conflict cases, by 1.40%, 3.37%, and 2.26%, respectively; two RSS intervals show reductions and four include zero. These results cover whole exports. RSS is Hyperfine's Linux
wait4peak, not an allocation count or summed simultaneous process-tree memory.Earlier measurements
Earlier standalone algorithm-model size sweeps used a different source and toolchain context. They did not establish source-matched component or whole-export confidence intervals for
1bf67791→28608af1.