Repository navigation
Relabel the parity rows that 1.4.0 does not read, and keep the check as a tool - #1440
Merged
Merged
Conversation
…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>
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyis as it was, and the suite's results for every row are unchanged.What was wrong
A
tests/v2/cases.pyrow'sclassificationdefaults toparity, 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-configparityrows do not give their expected fields: 32 of them written this cycle (27 of those #1395'smd_*rows), 40 older.Changes
tools/differential/parity_check.py, a kept tool: reads every default-configparityrow with the 1.4.0 wheel'sHumanNameand lists the rows whose fields 1.4.0 does not give. The worker is hardened ascompare.py's is: generated into a temporary folder outside the checkout, run byuv run --no-projectwithPYTHONPATH/PYTHONHOMEstripped andPYTHONSAFEPATH=1, and aborted unlesscompare.py's own_check_tellsees 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.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.,againstJr.), a reordered word or a moved word still counts. By this rule five rows that differ from 1.4.0 only by that join stayparity(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_suffixesrows).parityrows carrying apolicyorlocale. 1.4.0 has noPolicy, 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. Theirparitystays 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 wrongparityrow is reported, and a baseline that reads every row as the table expects (the tree-on-both-sides failure) or reads nothing aborts.git worktree add --detachoutside 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), andfix(#274)for maiden consumption). One new slug,fix(phd-merge), forJohn Smith, Ph. D.; MD, where 1.4.0'sfix_phdregex merged the pair across the glued;and 2.0's merge never has (decisions/phd-merge, rules/C10's Accepted bullet).ar/hepack rows under the default, 3.0.1 having no such pack).thai_rank_written_short_before_a_name_opening_like_a_longer_rankclaimed 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.tools/differential/README.mdgains 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.pycfiles whose source had the same mtime and size, and stale bytecode answered. The whole bisect was re-run withpython -Bandgit clean -fdxat each step; only those two rows moved (to #912,fix(#752)).Classification counts (2,392 rows)
Relabelled rows
a_joined_connective_is_no_run(cases.py:2829)Josep Carod i Rovirafix(#397)a_numeral_the_clause_free_name_reads_ends_the_clause(cases.py:2834)John née Jones Smith VIfix(#445)a_shape_numeral_behind_which_a_title_stands_ends_the_clause(cases.py:2845)Jane Doe nee Smith VI Prof.fix(#535)a_shape_numeral_before_a_merged_credential_ends_the_clause(cases.py:2857)Jane Doe nee Smith VI Ph. D.fix(#424)a_credential_alone_before_a_comma_is_the_family(cases.py:3657)Md, PhDfix(#296)a_title_particle_before_a_comma_is_still_a_title(cases.py:3689)Freiherr von Berg, PhDfix(#410)a_suffix_inside_the_part_stops_the_particle(cases.py:3719)van Jr. Berg, Mr.fix(comma-family)a_title_in_front_keeps_the_particle_fork(cases.py:3729)Dr. van der Berg, PhDfix(#367)a_leading_title_particle_stays_a_title_before_a_title_only_comma(cases.py:3744)St John, Dr.fix(#296)a_part_past_the_second_reports_no_particle_fork(cases.py:4622)John Smith, Jr., Freiherr von Richthofenfix(#603)a_joined_credential_settles_a_bare_ambiguous_chunk(cases.py:5413)John Smith, MA/PhDfix(#1138)dotted_latin_degree_glued_to_an_initial_keeps_the_initial(cases.py:5606)Dr.C.Meera Nairfix(#1230)thai_title_licenses_the_bound_given_name_join(cases.py:5737)นาย abdul rahmanfix(#317)thai_glued_title_peels_only_the_first_word(cases.py:5767)ใจดี, ดร.สมชาย นายสมศักดิ์fix(#1166)a_glued_honorific_chunk_is_not_ascii(cases.py:6075)J.씨fix(#308)a_maiden_clause_supplies_no_contrast_for_the_caps_shape(cases.py:7308)LLOYD WEBBER née Smith, ANDREW PhDfix(#274)a_period_marked_dual_opening_a_family_comma_stays_family(cases.py:7719)Freiherr. von Berg, Edfix(comma-precomma-family)the_comma_count_counts_names_not_words_behind_a_suffix(cases.py:7863)Smith Jr, Mafix(comma-precomma-family)no_title_stop_before_a_family_comma(cases.py:9757)Doe nee Smith Prof., Janefix(#274)delimiters_keep_the_whole_span_whatever_the_last_word_is(cases.py:10524)Jane Doe (nee Smith MA)fix(#335)delimiters_keep_the_whole_span_in_title_case_too(cases.py:10539)Jane Doe (nee Smith Ma)fix(#335)a_word_outside_the_delimiters_is_outside_the_clause(cases.py:10550)Jane Doe (nee Smith) MAfix(#335)a_lone_single_letter_connective_after_the_comma_joins_no_title(cases.py:11160)Juan Garcia Lopez, Sr. y Sra.fix(#316)a_title_chain_ending_in_a_connective_keeps_it(cases.py:11180)John Smith, Mr. andfix(comma-family)a_numeral_behind_a_class_member_keeps_the_listing_form(cases.py:11230)John Smith, Ma Ifix(comma-precomma-family)only_the_first_suffix_word_can_open_the_comma_part(cases.py:11449)Smith, MA PhD Jonesfix(#602)a_part_of_titles_behind_a_credential_was_already_postnominal(cases.py:11482)Eric H. Holder, Jr. Attorney Generalfix(comma-family)semicolon_glued_to_a_split_credential_keeps_the_listing_form(cases.py:11933)John Smith, Ph. D.; MDfix(phd-merge)paren_joined_member_chunk_is_the_suffix_after_the_name(cases.py:12279)John Smith (MA/PhD)fix(#1138)bound_given_completed_before_a_suffix_comma(cases.py:12595)طارق عبد العزيز, Jr.fix(#694)family_comma_title_led_run_keeps_the_written_comma(cases.py:15668)Smith Jr., Mr. Jr.fix(comma-family)family_comma_written_commas_are_kept(cases.py:15682)Smith, MD, PhDfix(#325)md_alone_behind_a_title_stays_the_credential(cases.py:16161)Smith, Dr. Mdfix(comma-family)md_alone_behind_a_salutation_stays_the_credential(cases.py:16168)Uddin, Mr Mdfix(comma-family)md_dotted_alone_behind_a_title_stays_the_credential(cases.py:16172)Rahman, Mr. Md.fix(comma-family)md_alone_behind_mrs_stays_the_credential(cases.py:16176)Rahman, Mrs Mdfix(comma-family)md_behind_a_title_before_a_credential_stays_the_credential(cases.py:16180)Uddin, Mr Md PhDfix(#325)md_behind_a_title_before_a_generation_stays_the_credential(cases.py:16184)Uddin, Mr Md Jr.fix(#325)md_alone_behind_a_dual_stays_the_credential(cases.py:16188)Rahman, Sr Mdfix(#325)md_alone_behind_ms_stays_the_credential(cases.py:16193)Rahman, Ms Mdfix(#325)md_title_case_before_a_credential_stays_the_credential(cases.py:16196)Smith, Md PhDfix(#325)md_title_case_before_a_capitals_word_stays_the_credential(cases.py:16201)Smith, Md XYZfix(#853)md_before_a_gated_title_stays_the_credential(cases.py:16207)SMITH, MD SHEIKHfix(#752)md_before_dean_stays_the_credential(cases.py:16213)SMITH, MD DEANfix(#853)md_dotted_in_one_case_alone_stays_the_credential(cases.py:16217)rahman, md.fix(#296)md_before_a_word_holding_no_letter_stays_the_credential(cases.py:16221)RAHMAN, MD 2fix(#325)md_before_a_conjunction_stays_the_credential(cases.py:16225)Rahman, Md and Karimfix(#853)md_before_a_gated_title_in_mixed_case_stays_the_credential(cases.py:16231)Rahman, Md Sheikh Karimfix(#752)md_before_dean_in_mixed_case_stays_the_credential(cases.py:16240)Rahman, Md Deanfix(#853)md_before_a_name_in_capitals_in_mixed_case_stays_the_credential(cases.py:16244)Rahman, Md KARIMfix(#853)md_before_abdul_in_capitals_in_mixed_case_stays_the_credential(cases.py:16252)Rahman, Md ABDULfix(#853)a_given_name_written_short_that_is_no_credential_reports_nothing(cases.py:16256)Smith, Wm Jonesfix(#789)md_in_capitals_alone_after_a_family_comma_is_the_credential(cases.py:16261)RAHMAN, MDfix(#296)md_in_one_case_alone_after_a_family_comma_is_the_credential(cases.py:16268)rahman, mdfix(#296)md_before_a_credential_after_a_family_comma_is_the_credential(cases.py:16273)Smith, MD PhDfix(#325)md_before_a_split_credential_is_the_credential(cases.py:16277)Smith, MD Ph. D.fix(#325)md_before_a_capitals_word_in_mixed_case_is_the_credential(cases.py:16282)Smith, MD XYZfix(#853)md_before_an_ambiguous_credential_is_the_credential(cases.py:16288)SMITH, MD MBA, JANEfix(#325)md_behind_a_titled_surname_is_the_credential(cases.py:16305)Dr. Rahman, Mdfix(#410)md_behind_a_two_word_surname_is_the_credential(cases.py:16310)Rahman Khan, Md Abdulfix(#853)contested_title_after_a_comma_in_capitals(cases.py:16795)John Smith, DEANfix(#564)modifier_in_a_comma_part(cases.py:16906)John Smith, Vicefix(comma-family)given_name_modifier_before_its_head_in_a_comma_part(cases.py:16925)Lau, Wing Commanderfix(comma-family)given_name_modifier_before_a_dotted_suffix(cases.py:16943)John Smith Wing. Jr.fix(#316)princess_royal_behind_a_style(cases.py:17387)Her Royal Highness Princess Royal Annefix(#913)royal_title_phrase_queen_mother(cases.py:17394)Queen Mother Elizabethfix(#489)given_name_modifier_after_a_style(cases.py:17610)Hon. Wing Laufix(#752)given_name_modifier_before_a_salutation_in_a_comma_part(cases.py:17615)LAU, WING MRfix(comma-family)role_word_in_a_comma_part(cases.py:17635)John Smith, Residentfix(comma-family)ja_combining_voicing_mark_on_hiragana_stays_hiragana(cases.py:18900)あ゙い たろうfix(#272)ja_combining_voicing_mark_kanji_katakana_licensed(cases.py:18909)山田 ア゙イfix(#272)dutch_s_particle_joins_the_surname(cases.py:20559)Willem Jacob 's Gravesandefix(#1241)Tool output
Before the relabel (abridged to the summary; the full list is the table above):
After:
Harness proof, a copy of the table with a planted wrong
parityrow (--cases):(
--checkexits 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 afix(#436/#437)label, and now says 1.4.0 (withCONSTANTS.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 changeduv run mypy,uv run ruff check: cleanuv run python tools/differential/parity_check.py --check: 0 of 626, exit 0🤖 Generated with Claude Code