Skip to content

Relabel the parity rows that 1.4.0 does not read, and keep the check as a tool - #1440

Merged
derek73 merged 2 commits into
masterfrom
test/parity-labels
Nov 16, 2026
Merged

derek73 merged 2 commits into
masterfrom
test/parity-labels

Conversation

@derek73

@derek73 derek73 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Part of the 3.1 release checklist's stale-prose sweep (section C of the sweep's findings). No parse behaviour changes: every expected value in tests/v2/cases.py is as it was, and the suite's results for every row are unchanged.

What was wrong

A tests/v2/cases.py row's classification defaults to parity, which claims 1.4.0 read the row's text as the row expects. The suite runs every row against the tree, so nothing checked that claim (root AGENTS.md, Gotchas). Read with the 1.4.0 wheel, 72 of the 698 default-config parity rows do not give their expected fields: 32 of them written this cycle (27 of those #1395's md_* rows), 40 older.

Changes

  1. tools/differential/parity_check.py, a kept tool: reads every default-config parity row with the 1.4.0 wheel's HumanName and lists the rows whose fields 1.4.0 does not give. The worker is hardened as compare.py's is: generated into a temporary folder outside the checkout, run by uv run --no-project with PYTHONPATH/PYTHONHOME stripped and PYTHONSAFEPATH=1, and aborted unless compare.py's own _check_tell sees version 1.4.0 loaded from outside the checkout. Every run also reads two planted rows (one 1.4.0 gives, one it does not) and aborts unless only the second is reported, so a worker answering from the tree cannot produce a clean table. Exit 0 whatever it finds; 1 on a mismatch with --check. Needs the network or uv's cache, so it is not a CI test.
    • What it compares (stated in its docstring): the seven fields (title, given = first, middle, family = last, suffix, nickname, maiden); a field the row does not list is expected empty. The suffix with each ", " join read as a space, and no other comma dropped: 1.4.0 joins a multi-word suffix with ", " (PhD, I.) where the tree keeps the written separators (PhD I.). A trailing comma in one side only (Jr., against Jr.), a reordered word or a moved word still counts. By this rule five rows that differ from 1.4.0 only by that join stay parity (sa_after_a_credential_joins_it, family_comma_numeral_behind_a_suffix_is_not_an_initial, a_suffix_word_ending_the_family_part_stays_the_suffix, and the two ..._dual_particle_before_a_generation_keeps_both_suffixes rows).
    • Skipped: the 91 parity rows carrying a policy or locale. 1.4.0 has no Policy, so no switch on a row (two_family_names, unlisted_caps_suffixes, name_order, a pack, …) has a counterpart there to translate into; all are skipped and counted rather than half-translated. Their parity stays unchecked.
    • tests/v2/test_parity_check.py (no network): the row-to-1.4.0 mapping, the suffix comparison both ways, the selection, the report, the exit codes, the worker's pin and environment, and the harness proofs: a planted wrong parity row is reported, and a baseline that reads every row as the table expects (the tree-on-both-sides failure) or reads nothing aborts.
  2. Relabel the 72 rows with the change each reading came from. For each row the first release giving its reading was found by running the wheels 1.4.0, 2.0.0 … 3.0.1 (same hardened invocation; every row moved once and stayed), then the merge by bisecting the first-parent history between those two releases in a scratch git worktree add --detach outside this checkout, then the commit by bisecting inside the merge's branch. Labels follow the table's existing ones for the same change (fix(#N) for an issue; for readings the 2.0 pipeline had from its first commits, the 1.4.0 ledger's slugs the table already uses: fix(comma-family), fix(comma-precomma-family), and fix(#274) for maiden consumption). One new slug, fix(phd-merge), for John Smith, Ph. D.; MD, where 1.4.0's fix_phd regex merged the pair across the glued ; and 2.0's merge never has (decisions/phd-merge, rules/C10's Accepted bullet).
    • Notes on five relabelled rows claimed parity the wheel contradicts ("unchanged since 1.4.0", "Parity at every baseline", "parity row: … as it always has", "every release before it"): each now names the release the reading dates from and what 1.4.0 read.
  3. Notes: the 15 notes saying "1.4.0 (or 2.0.0) through master read …" say "through 3.0.1", each checked under the 3.0.1 wheel (the ar/he pack rows under the default, 3.0.1 having no such pack). thai_rank_written_short_before_a_name_opening_like_a_longer_rank claimed 1.4.0 through 3.0.1 read given 'พ.ต.'; both read given 'พ.ต.อนุชา', which the note now says. Three older notes saying "2.0 through master" describe 2.x's master and are left alone.
  4. Docs: root AGENTS.md's parity gotcha names the tool and its command, and records a bisecting trap this work hit (below); release checklist step 0 gains a line to run it; tools/differential/README.md gains a "The case table's parity rows" subsection.

A trap found on the way, now in the gotcha: the first bisect pass named #919 for two md_* rows whose parent commit already read them. Rapid checkouts in the scratch worktree left .pyc files whose source had the same mtime and size, and stale bytecode answered. The whole bisect was re-run with python -B and git clean -fdx at each step; only those two rows moved (to #912, fix(#752)).

Classification counts (2,392 rows)

before after
parity 789 717
fix 1,475 1,547
feat 128 128

Relabelled rows

row text 1.4.0 read first release change (commit) classification
a_joined_connective_is_no_run (cases.py:2829) Josep Carod i Rovira given 'Josep', middle 'Carod i', family 'Rovira' 2.4.0 #536, 06f877f fix(#397)
a_numeral_the_clause_free_name_reads_ends_the_clause (cases.py:2834) John née Jones Smith VI given 'John', middle 'née Jones', family 'Smith', suffix 'VI' 2.2.0 #450, 976cd33 fix(#445)
a_shape_numeral_behind_which_a_title_stands_ends_the_clause (cases.py:2845) Jane Doe nee Smith VI Prof. given 'Jane', middle 'Doe nee Smith VI', family 'Prof.' 2.4.0 #550, 7564a0a fix(#535)
a_shape_numeral_before_a_merged_credential_ends_the_clause (cases.py:2857) Jane Doe nee Smith VI Ph. D. given 'Jane', middle 'Doe nee', family 'Smith', suffix 'Ph. D., VI' 2.2.0 #427, 4498582 fix(#424)
a_credential_alone_before_a_comma_is_the_family (cases.py:3657) Md, PhD title 'PhD', given 'Md' 2.2.0 #428, 6f50406 fix(#296)
a_title_particle_before_a_comma_is_still_a_title (cases.py:3689) Freiherr von Berg, PhD title 'Freiherr', given 'von Berg', suffix 'PhD' 2.2.0 #444, ff8f202 fix(#410)
a_suffix_inside_the_part_stops_the_particle (cases.py:3719) van Jr. Berg, Mr. title 'Mr.', family 'van Berg', suffix 'Jr.' 2.2.0 #428, bf764e3 fix(comma-family)
a_title_in_front_keeps_the_particle_fork (cases.py:3729) Dr. van der Berg, PhD title 'Dr.', given 'van der Berg', suffix 'PhD' 2.2.0 #370, a89aece fix(#367)
a_leading_title_particle_stays_a_title_before_a_title_only_comma (cases.py:3744) St John, Dr. title 'St', given 'John', suffix 'Dr.' 2.2.0 #428, 6f50406 fix(#296)
a_part_past_the_second_reports_no_particle_fork (cases.py:4622) John Smith, Jr., Freiherr von Richthofen given 'John', family 'Smith', suffix 'Jr., Freiherr von Richthofen' 2.4.0 #615, 40a10fa fix(#603)
a_joined_credential_settles_a_bare_ambiguous_chunk (cases.py:5413) John Smith, MA/PhD given 'MA/PhD', family 'John Smith' 3.0.0 #1141, 861f532 fix(#1138)
dotted_latin_degree_glued_to_an_initial_keeps_the_initial (cases.py:5606) Dr.C.Meera Nair title 'Dr.C.Meera', family 'Nair' unreleased #1304, 3744aa0 fix(#1230)
thai_title_licenses_the_bound_given_name_join (cases.py:5737) นาย abdul rahman given 'นาย', middle 'abdul', family 'rahman' unreleased #1327, 85e2873 fix(#317)
thai_glued_title_peels_only_the_first_word (cases.py:5767) ใจดี, ดร.สมชาย นายสมศักดิ์ given 'ดร.สมชาย', middle 'นายสมศักดิ์', family 'ใจดี' unreleased #1318, e1bf2a1 fix(#1166)
a_glued_honorific_chunk_is_not_ascii (cases.py:6075) J.씨 given 'J.씨' 2.1.0 #311, 9075fde fix(#308)
a_maiden_clause_supplies_no_contrast_for_the_caps_shape (cases.py:7308) LLOYD WEBBER née Smith, ANDREW PhD given 'ANDREW', family 'LLOYD WEBBER née Smith', suffix 'PhD' 2.0.0 #288, 9bcd007 fix(#274)
a_period_marked_dual_opening_a_family_comma_stays_family (cases.py:7719) Freiherr. von Berg, Ed title 'Freiherr.', given 'von Berg', suffix 'Ed' 2.0.0 #288, f65bd7c fix(comma-precomma-family)
the_comma_count_counts_names_not_words_behind_a_suffix (cases.py:7863) Smith Jr, Ma given 'Smith', family 'Jr', suffix 'Ma' 2.0.0 #288, c131dde fix(comma-precomma-family)
no_title_stop_before_a_family_comma (cases.py:9757) Doe nee Smith Prof., Jane given 'Jane', family 'Doe nee Smith Prof.' 2.0.0 #288, 9bcd007 fix(#274)
delimiters_keep_the_whole_span_whatever_the_last_word_is (cases.py:10524) Jane Doe (nee Smith MA) given 'Jane', family 'Doe', nickname 'nee Smith MA' 2.2.0 #446, 3c7a14f fix(#335)
delimiters_keep_the_whole_span_in_title_case_too (cases.py:10539) Jane Doe (nee Smith Ma) given 'Jane', family 'Doe', nickname 'nee Smith Ma' 2.2.0 #446, 3c7a14f fix(#335)
a_word_outside_the_delimiters_is_outside_the_clause (cases.py:10550) Jane Doe (nee Smith) MA given 'Jane', family 'Doe', suffix 'MA', nickname 'nee Smith' 2.2.0 #446, 3c7a14f fix(#335)
a_lone_single_letter_connective_after_the_comma_joins_no_title (cases.py:11160) Juan Garcia Lopez, Sr. y Sra. title 'Sr.', given 'y', family 'Juan Garcia Lopez', suffix 'Sra.' 2.3.0 #520, 5568fdc fix(#316)
a_title_chain_ending_in_a_connective_keeps_it (cases.py:11180) John Smith, Mr. and title 'Mr. and', given 'John Smith' 2.2.0 #428, bf764e3 fix(comma-family)
a_numeral_behind_a_class_member_keeps_the_listing_form (cases.py:11230) John Smith, Ma I given 'John', family 'Smith', suffix 'Ma I' 2.0.0 #288, c131dde fix(comma-precomma-family)
only_the_first_suffix_word_can_open_the_comma_part (cases.py:11449) Smith, MA PhD Jones given 'MA', middle 'Jones', family 'Smith', suffix 'PhD' 2.4.0 #609, 5eb2dd3 fix(#602)
a_part_of_titles_behind_a_credential_was_already_postnominal (cases.py:11482) Eric H. Holder, Jr. Attorney General title 'Jr. Attorney', given 'General', family 'Eric H. Holder' 2.2.0 #428, 87a9303 fix(comma-family)
semicolon_glued_to_a_split_credential_keeps_the_listing_form (cases.py:11933) John Smith, Ph. D.; MD given ';', family 'John Smith', suffix 'Ph. D., MD' 2.0.0 #288, 9bcd007 fix(phd-merge)
paren_joined_member_chunk_is_the_suffix_after_the_name (cases.py:12279) John Smith (MA/PhD) given 'John', family 'Smith', nickname 'MA/PhD' 3.0.0 #1141, 861f532 fix(#1138)
bound_given_completed_before_a_suffix_comma (cases.py:12595) طارق عبد العزيز, Jr. given 'طارق', middle 'عبد', family 'العزيز', suffix 'Jr.' 3.0.0 #1070, 8425226 fix(#694)
family_comma_title_led_run_keeps_the_written_comma (cases.py:15668) Smith Jr., Mr. Jr. title 'Mr.', given 'Jr.', family 'Smith', suffix 'Jr.' 2.0.0 #288, 2c45150 fix(comma-family)
family_comma_written_commas_are_kept (cases.py:15682) Smith, MD, PhD title 'MD', family 'Smith', suffix 'PhD' 2.2.0 #428, 6f50406 fix(#325)
md_alone_behind_a_title_stays_the_credential (cases.py:16161) Smith, Dr. Md title 'Dr.', given 'Md', family 'Smith' 2.0.0 #288, 9bcd007 fix(comma-family)
md_alone_behind_a_salutation_stays_the_credential (cases.py:16168) Uddin, Mr Md title 'Mr', given 'Md', family 'Uddin' 2.0.0 #288, 9bcd007 fix(comma-family)
md_dotted_alone_behind_a_title_stays_the_credential (cases.py:16172) Rahman, Mr. Md. title 'Mr.', given 'Md.', family 'Rahman' 2.0.0 #288, 9bcd007 fix(comma-family)
md_alone_behind_mrs_stays_the_credential (cases.py:16176) Rahman, Mrs Md title 'Mrs', given 'Md', family 'Rahman' 2.0.0 #288, 9bcd007 fix(comma-family)
md_behind_a_title_before_a_credential_stays_the_credential (cases.py:16180) Uddin, Mr Md PhD title 'Mr Md', given 'PhD', family 'Uddin' 2.2.0 #428, 87a9303 fix(#325)
md_behind_a_title_before_a_generation_stays_the_credential (cases.py:16184) Uddin, Mr Md Jr. title 'Mr Md', given 'Jr.', family 'Uddin' 2.2.0 #428, 87a9303 fix(#325)
md_alone_behind_a_dual_stays_the_credential (cases.py:16188) Rahman, Sr Md title 'Sr', given 'Md', family 'Rahman' 2.2.0 #428, 6f50406 fix(#325)
md_alone_behind_ms_stays_the_credential (cases.py:16193) Rahman, Ms Md title 'Ms', given 'Md', family 'Rahman' 2.2.0 #428, 87a9303 fix(#325)
md_title_case_before_a_credential_stays_the_credential (cases.py:16196) Smith, Md PhD title 'Md', given 'PhD', family 'Smith' 2.2.0 #428, 6f50406 fix(#325)
md_title_case_before_a_capitals_word_stays_the_credential (cases.py:16201) Smith, Md XYZ title 'Md', given 'XYZ', family 'Smith' 2.6.0 #860, 280a4a9 fix(#853)
md_before_a_gated_title_stays_the_credential (cases.py:16207) SMITH, MD SHEIKH title 'MD', given 'SHEIKH', family 'SMITH' 2.7.0 #912, 7e00c2f fix(#752)
md_before_dean_stays_the_credential (cases.py:16213) SMITH, MD DEAN title 'MD', given 'DEAN', family 'SMITH' 2.6.0 #860, 280a4a9 fix(#853)
md_dotted_in_one_case_alone_stays_the_credential (cases.py:16217) rahman, md. title 'md.', given 'rahman' 2.2.0 #428, 6f50406 fix(#296)
md_before_a_word_holding_no_letter_stays_the_credential (cases.py:16221) RAHMAN, MD 2 title 'MD', given '2', family 'RAHMAN' 2.2.0 #428, 6f50406 fix(#325)
md_before_a_conjunction_stays_the_credential (cases.py:16225) Rahman, Md and Karim title 'Md and Karim', given 'Rahman' 2.6.0 #860, 280a4a9 fix(#853)
md_before_a_gated_title_in_mixed_case_stays_the_credential (cases.py:16231) Rahman, Md Sheikh Karim title 'Md Sheikh', given 'Karim', family 'Rahman' 2.7.0 #912, 7e00c2f fix(#752)
md_before_dean_in_mixed_case_stays_the_credential (cases.py:16240) Rahman, Md Dean title 'Md', given 'Dean', family 'Rahman' 2.6.0 #860, 280a4a9 fix(#853)
md_before_a_name_in_capitals_in_mixed_case_stays_the_credential (cases.py:16244) Rahman, Md KARIM title 'Md', given 'KARIM', family 'Rahman' 2.6.0 #860, 280a4a9 fix(#853)
md_before_abdul_in_capitals_in_mixed_case_stays_the_credential (cases.py:16252) Rahman, Md ABDUL title 'Md', given 'ABDUL', family 'Rahman' 2.6.0 #860, 280a4a9 fix(#853)
a_given_name_written_short_that_is_no_credential_reports_nothing (cases.py:16256) Smith, Wm Jones title 'Wm', given 'Jones', family 'Smith' 2.6.0 #873, 26f7bc1 fix(#789)
md_in_capitals_alone_after_a_family_comma_is_the_credential (cases.py:16261) RAHMAN, MD title 'MD', given 'RAHMAN' 2.2.0 #428, 6f50406 fix(#296)
md_in_one_case_alone_after_a_family_comma_is_the_credential (cases.py:16268) rahman, md title 'md', given 'rahman' 2.2.0 #428, 6f50406 fix(#296)
md_before_a_credential_after_a_family_comma_is_the_credential (cases.py:16273) Smith, MD PhD title 'MD', given 'PhD', family 'Smith' 2.2.0 #428, 6f50406 fix(#325)
md_before_a_split_credential_is_the_credential (cases.py:16277) Smith, MD Ph. D. title 'MD', family 'Smith', suffix 'Ph. D.' 2.2.0 #428, 6f50406 fix(#325)
md_before_a_capitals_word_in_mixed_case_is_the_credential (cases.py:16282) Smith, MD XYZ title 'MD', given 'XYZ', family 'Smith' 2.6.0 #860, 280a4a9 fix(#853)
md_before_an_ambiguous_credential_is_the_credential (cases.py:16288) SMITH, MD MBA, JANE title 'MD', given 'MBA', family 'SMITH', suffix 'JANE' 2.2.0 #428, 6f50406 fix(#325)
md_behind_a_titled_surname_is_the_credential (cases.py:16305) Dr. Rahman, Md title 'Dr.', given 'Rahman', suffix 'Md' 2.2.0 #444, ff8f202 fix(#410)
md_behind_a_two_word_surname_is_the_credential (cases.py:16310) Rahman Khan, Md Abdul title 'Md', given 'Abdul', family 'Rahman Khan' 2.6.0 #860, 280a4a9 fix(#853)
contested_title_after_a_comma_in_capitals (cases.py:16795) John Smith, DEAN given 'DEAN', family 'John Smith' 2.4.0 #577, fc25880 fix(#564)
modifier_in_a_comma_part (cases.py:16906) John Smith, Vice title 'Vice', given 'John Smith' 2.2.0 #428, bf764e3 fix(comma-family)
given_name_modifier_before_its_head_in_a_comma_part (cases.py:16925) Lau, Wing Commander title 'Wing', given 'Commander', family 'Lau' 2.2.0 #428, bf764e3 fix(comma-family)
given_name_modifier_before_a_dotted_suffix (cases.py:16943) John Smith Wing. Jr. given 'John', middle 'Smith', family 'Wing.', suffix 'Jr.' 2.3.0 #520, 5568fdc fix(#316)
princess_royal_behind_a_style (cases.py:17387) Her Royal Highness Princess Royal Anne title 'Her Royal Highness Princess Royal', family 'Anne' 2.8.0 #928, 69ff00a fix(#913)
royal_title_phrase_queen_mother (cases.py:17394) Queen Mother Elizabeth title 'Queen Mother', family 'Elizabeth' 2.3.0 #520, fdf9b86 fix(#489)
given_name_modifier_after_a_style (cases.py:17610) Hon. Wing Lau title 'Hon. Wing', family 'Lau' 2.7.0 #894, 12384fa fix(#752)
given_name_modifier_before_a_salutation_in_a_comma_part (cases.py:17615) LAU, WING MR title 'WING', given 'MR', family 'LAU' 2.2.0 #428, bf764e3 fix(comma-family)
role_word_in_a_comma_part (cases.py:17635) John Smith, Resident title 'Resident', given 'John Smith' 2.2.0 #428, bf764e3 fix(comma-family)
ja_combining_voicing_mark_on_hiragana_stays_hiragana (cases.py:18900) あ゙い たろう given 'あ゙い', family 'たろう' 2.1.0 #297, cb4346d fix(#272)
ja_combining_voicing_mark_kanji_katakana_licensed (cases.py:18909) 山田 ア゙イ given '山田', family 'ア゙イ' 2.1.0 #297, cb4346d fix(#272)
dutch_s_particle_joins_the_surname (cases.py:20559) Willem Jacob 's Gravesande given 'Willem', middle 'Jacob 's', family 'Gravesande' unreleased #1270, 7de65bb fix(#1241)

Tool output

Before the relabel (abridged to the summary; the full list is the table above):

72 of 698 parity rows read otherwise under 1.4.0
91 parity rows carrying a policy or a locale skipped: 1.4.0 has no Policy to read them under

After:

0 of 626 parity rows read otherwise under 1.4.0
91 parity rows carrying a policy or a locale skipped: 1.4.0 has no Policy to read them under

Harness proof, a copy of the table with a planted wrong parity row (--cases):

cases.py:327 planted_wrong_parity 'Smith, John Jr'
    family: expected 'Smith Jr', 1.4.0 'Smith'
    suffix: expected '', 1.4.0 'Jr'
1 of 627 parity rows read otherwise under 1.4.0
91 parity rows carrying a policy or a locale skipped: 1.4.0 has no Policy to read them under

(--check exits 1 on it, 0 on the real table.)

Review round (second commit): the suffix comparison absorbed a trailing comma too, and now absorbs only the ", " join (still 0 of 626, the planted row still reported); suffix_delimiter_core_between_entries_is_a_boundary's note claimed parity under a fix(#436/#437) label, and now says 1.4.0 (with CONSTANTS.suffix_delimiter = ' | ') and every release from 2.0.0 read its fields, the label naming the change the row guards.

Verification

  • uv run pytest: 49,805 passed, 45 skipped, 3 xfailed; the case table still holds 2,392 rows with no expected value changed
  • uv run mypy, uv run ruff check: clean
  • uv run python tools/differential/parity_check.py --check: 0 of 626, exit 0

🤖 Generated with Claude Code

…as a tool

A cases.py row's classification defaults to "parity", a claim about
1.4.0 that no test checks. tools/differential/parity_check.py reads
every default-config parity row with the 1.4.0 wheel, in a worker
hardened as compare.py's is, and lists the rows whose fields 1.4.0 does
not give; two planted rows make a run against the tree abort. The
suffix is compared by its words, 1.4.0 joining them with ", "; the 91
parity rows carrying a policy or a locale are skipped and counted.

It listed 72 of 698 rows. Each is relabelled with the change its
reading came from, found by running the release wheels and bisecting
in a scratch worktree; five notes claiming parity say what 1.4.0 read.
The notes saying "through master" say "through 3.0.1", checked under
that wheel, and the Thai rank note gives the reading 1.4.0 and 3.0.1
gave. No expected value changes.

AGENTS.md's parity gotcha names the tool and a stale-bytecode trap in
bisecting; release step 0 runs it; the differential README describes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.1 milestone Nov 16, 2026
@derek73 derek73 self-assigned this Nov 16, 2026
…label names

parity_check's suffix comparison stripped commas from both ends of
every word, so a trailing comma in one suffix and not the other went
unnoticed; it now reads each ", " join as a space and keeps every other
comma in its word, with test rows for a trailing comma and an unspaced
one. The tool still reports 0 of 626 and the planted row.

suffix_delimiter_core_between_entries_is_a_boundary claimed parity
under a fix(#436/#437) label: 1.4.0, with CONSTANTS.suffix_delimiter
set to its counterpart, and every release from 2.0.0 read its fields,
so the note says the label names the change the row guards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 7cf4bcd into master Nov 16, 2026
14 checks passed
@derek73
derek73 deleted the test/parity-labels branch November 16, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant