Breakwater

Backtest / #1111

perf: Speed up wildcard comparison

pypa/packaging#1111 · merged 2026-03-09 · base 210d878577 → head e3af78f17a · ran on Docker

PASS

No behaviour divergence found by any probe.

Performance · Specifier#contains

No realistic input family measured slower.

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

head slowerhead faster0.71×0.84×1×100input size (characters)F2F2: 0.77× at ~17 charsF2: 0.78× at ~19 charsF2: 0.81× at ~32 charsF2: 0.86× at ~102 charsF2: 0.86× at ~102 charsF2: 0.86× at ~102 charsF2: 0.86× at ~102 chars
  • F2
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
F2wildcard prefix equality (==X.*)claimed speedup · plan0.77× – 0.86×0.59 → 0.65faster

Receipt

TargetBackendImageRun AuditAdjudication
packaging.specifiers:Specifier#containslocal Dockerbw-pair:79d12e24d8354ad9bt-1111-fafb8b$0.12$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.