Skip to content

Commit 7cf4bcd

Browse files
derek73claude
andauthored
Relabel the parity rows that 1.4.0 does not read, and keep the check as a tool (#1440)
* Relabel the parity rows that 1.4.0 does not read, and keep the check 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> * Absorb only the suffix's ", " join, and say what the delimiter row's 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> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 512676b commit 7cf4bcd

5 files changed

Lines changed: 648 additions & 34 deletions

File tree

‎AGENTS.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ uv run sphinx-build -b html docs dist/docs
178178
# last release's wheel and load each in the tree; don't derive it
179179
# from a dataclass diff. 2.7's bullet named Lexicon and Parser and
180180
# missed the locale packs, which carry a Lexicon
181+
# Then run `uv run python tools/differential/parity_check.py` and
182+
# relabel every case row it lists: `parity` is cases.py's default, and
183+
# no test checks it against 1.4.0 (Gotchas). 3.1's sweep found 72
184+
# such rows, 32 of them written that cycle.
181185
# And check for open Dependabot PRs on uv.lock (namedivider-python) and merge them
182186
# first — pyproject floats >=0.4 so fresh installs get the newest namedivider, but
183187
# CI's ja-extra job installs from uv.lock and only tests what the lock pins
@@ -337,7 +341,7 @@ The 2.0 rewrite landed as underscore-private modules beside the v1 code, which 2
337341

338342
**Suffix words vs the initial veto** — single-letter roman numeral suffixes (`i`, `v`) are suffix words but also initial-shaped, so `_vocab.is_suffix_strict` (v1's `is_suffix`) vetoes them through `_vocab.is_initial`. `_vocab.is_suffix_lenient` accepts suffix words without the veto and is only safe in unambiguous positions, after a comma (#136, #144). **The veto is Latin-only since #320**: `is_initial` ANDs the bare shape test (`is_initial_shaped`) with "not in a script that writes no initials", the rows of `_policy._SCRIPT_PROPERTIES` whose `writes_initials` is false (Han, Hangul, Hiragana, Katakana, and since #1256 the Myanmar and Thai scripts; decisions/script-properties), so the single-character CJK suffix words (씨, 様, 氏, 군, 양, 님, 殿) written with a period read as suffixes: `"김민준 씨."` gives suffix `씨.`. `V.`/`I.` still lose to the veto and still need the lenient test.
339343

340-
**Comparing against v1 needs `PYTHONSAFEPATH=1` AND a directory outside the worktree** — `uv run --isolated --no-project --with 'nameparser==1.4.0'` still puts the checkout's `nameparser/` ahead of the pinned wheel on `sys.path`, so the "v1" side silently imports the branch and every comparison reports parity. Run it as `cd <scratch dir> && PYTHONSAFEPATH=1 uv run --isolated --no-project --with 'nameparser==1.4.0' python -c "..."`. This produces false confidence rather than an error, so it invalidates results without ever looking wrong. **A `tests/v2/cases.py` row's `parity` means 1.4.0, and nothing checks it** -- the table runs every row against the tree, so a row labelled `parity` that only matches master passes for good. #614 added eight such rows, compared against master; #620 found them by running the wheel this way and relabelled each with the change its reading came from, found by `git bisect run` in a scratch worktree (`git worktree add --detach`, never this one). Run the wheel before writing `parity`.
344+
**Comparing against v1 needs `PYTHONSAFEPATH=1` AND a directory outside the worktree** — `uv run --isolated --no-project --with 'nameparser==1.4.0'` still puts the checkout's `nameparser/` ahead of the pinned wheel on `sys.path`, so the "v1" side silently imports the branch and every comparison reports parity. Run it as `cd <scratch dir> && PYTHONSAFEPATH=1 uv run --isolated --no-project --with 'nameparser==1.4.0' python -c "..."`. This produces false confidence rather than an error, so it invalidates results without ever looking wrong. **A `tests/v2/cases.py` row's `parity` means 1.4.0, and no test checks it** -- the table runs every row against the tree, so a row labelled `parity` that only matches master passes for good, and `parity` is the dataclass default, so a row written with no `classification` claims it. #614 added eight such rows, compared against master; #620 found them by running the wheel this way and relabelled each with the change its reading came from, found by `git bisect run` in a scratch worktree (`git worktree add --detach`, never this one). 3.1's prose sweep found 72 more, 27 of them #1395's `md_*` rows, and the check is a kept tool since: `uv run python tools/differential/parity_check.py` reads every default-config `parity` row with the 1.4.0 wheel, hardened as `compare.py` is, and lists each row 1.4.0 reads otherwise with its fields (`--check` exits 1 on one). It needs the network or uv's cache, so no CI job runs it, and it skips the rows carrying a policy or a locale, whose `parity` stays unchecked. Run it after adding a row on the default, and relabel what it lists the way #620 did. When bisecting, run Python with `-B` and `git clean -fdx` the scratch tree at each step: two checkouts within one second leave a stale `.pyc` whose source has the same mtime and size, and in 3.1's relabel one answered for two rows, naming a commit whose parent already read them.
341345

342346
**A group-side reading of a family comma's given part that asks `tail_reading` disagrees with the given part's own walk, and the disagreement is accepted.** `tail_reading` reads the part as the comma-less name reads it, plus the bare salutations rules/H8 adds after a family comma, which a predictor of this part asks for with `salutations=True` (#835); assign's walk over the given part after a family comma reads by its own predicates -- V before a third comma part is read strictly (#144), staying a name word (`Smith, John van der Berg V, Jr.` reads middle 'van der Berg V'), and P6 attaches a period-marked title-particle (`St.`) the comma-less reading takes as a title. So a bound or a decline group computes with `tail_reading` acts where the walk then reads no title: #623's chain bound (`Smith, John Mc Prof. V, Jr.` → suffix 'Mc, Jr.', middle 'Prof. V') and #637's join decline (`Smith, abdul Prof. V, Jr.` → middle 'Prof. V', `Smith, abdul St.` → family 'St. Smith'); a numeral VI to X was a third such shape until #784 read it as a suffix on both sides. Both were recorded rather than narrowed (Derek: garbage input; decisions/H5 and #P5, rules/P5's Accepted clause). Before writing another group-side predictor of the given part, sweep those two shapes and decide, rather than rediscovering the gap in review. And a change to the trailing peel ITSELF reaches the given part through those predictors without touching them: #718's words-to-spare count for a one-letter numeral, asked through `trailing_run_start`, made the chain take the V in `Smith, Freiherr von Berg V` (given 'von Berg V', unreported) while assign's walk, which never counts there (S4: "read without it"), read it as the suffix -- found by review on a grid of family-comma and empty-head shapes behind a title-particle; the predictor now passes `count_numeral=False`. When a change moves what the peel takes, put a family comma with a title-particle head in its grid.
343347

0 commit comments

Comments
 (0)