inputcanonicalize_name("Á")
basevalue: "Á"
headvalue: "á"
Likely bugvotes: 2 likely-bug, 1 intended
The PR is titled a performance improvement with no intent to change Unicode handling; no tests/docs were updated.
perf: dual replace
Much faster than re, and even faster than str.translate
Found by: Nemotron strategy search, Ultra's planned example, hostile mutation, search sample · also caught by: Plain Hypothesis, Mutations of the PR's own test strings, Nemotron plan only
ran onToken Factory Sandboxes · image bfdb727b-8008-42aa-8523-32888cb60192
Regression test verified passes on base, fails on head
def test_1064_p1_value_0():
"""Breakwater P1: base behaviour pinned (found by differential testing; label: likely-bug)."""
from packaging.utils import canonicalize_name
assert canonicalize_name('Á') == 'Á'
Reproduce
uv run breakwater probe --repo https://github.com/pypa/packaging --base d5398b8bc19f --head 9627a8821f09 --target packaging.utils:canonicalize_name --backend contree --input "Á"
2 near-duplicate classes same behaviour, inputs with extra traits
canonicalize_name("Á ") base value: "Á " · head value: "á " test verifiedcanonicalize_name("Á\u0000") base value: "Á\u0000" · head value: "á\u0000" test verified
P3Equality / ordering changed
acanonicalize_name("Á")
bcanonicalize_name("ẞ")
basea > b → False
heada > b → True
Likely bugvotes: 2 likely-bug, 1 intended
Ordering changed because Unicode letters are now lower‑cased, not intended by the perf‑only PR.
perf: dual replace
Much faster than re, and even faster than str.translate
Found by: Ultra's planned example, relations pass · also caught by: Nemotron plan only
ran onToken Factory Sandboxes · image bfdb727b-8008-42aa-8523-32888cb60192
Regression test verified passes on base, fails on head
def test_1064_p3_gt_3():
"""Breakwater P3: base behaviour pinned (found by differential testing; label: likely-bug)."""
from packaging.utils import canonicalize_name
a = canonicalize_name('Á')
b = canonicalize_name('ẞ')
assert (a > b) is False
3 near-duplicate relation flipes same behaviour, inputs with extra traits
canonicalize_name("ẞ") vs canonicalize_name("Ω") base a > b → True · head a > b → False test verifiedcanonicalize_name("ẞ") vs canonicalize_name("Ω") base a < b → False · head a < b → True test verifiedcanonicalize_name("Á") vs canonicalize_name("ẞ") base a < b → True · head a < b → False test verified