Breakwater

Backtest / #1081

perf: Skip __replace__ in Specifier comparison if not needed

pypa/packaging#1081 · merged 2026-02-09 · base 481295f716 → head 0e88c2d78a · ran on Docker

PASS

No behaviour divergence found by any probe.

Performance · Specifier

No realistic input family measured slower.

Measured in backtest packaging-v2 (same commits, run bt-1081-2ac9ac, image bw-pair:32c4ea16ee4f8abe). The semantic results above are from a later run; perf doesn't use the semantic planner, so it was not re-measured.

head slowerhead faster1×10input size (characters)F5F5: 0.98× at ~8 charsF5: 0.98× at ~10 charsF5: 0.96× at ~24 charsF5: 0.98× at ~94 charsF5: 0.98× at ~94 charsF5: 0.98× at ~94 charsF5: 0.98× at ~94 chars
  • F5
Head/base cachegrind instructions per call, by input size (log-log). Each line is one input family Nemotron proposed; points above 1× are where the "faster" code does more work.
FamilyInputsRatio range Slope base → headVerdict
F5Plain release versions without pre‑release, post‑release, dev or local parts (e.g. "1.2.3", "1.2.3.4"). For these versions the new early‑return checks succeed immediately and avoid the `__replace__` call, giving a measurable speed‑up.claimed speedup · plan0.96× – 0.98×0.32 → 0.32neutral

Receipt

TargetBackendImageRun AuditAdjudication
packaging.specifiers:Specifierlocal Dockerbw-pair:ff8050a1e55ba0d9bt-1081-38a993$0.030$0.000

Nemotron cost on Nebius Token Factory. Backend: where the untrusted code ran. local Docker (an image cited by its content-addressed tag). Every image is content-addressed (repo at each commit + harness), so every card re-runs from the image and seed 0. Raw data: audit.