Skip to content

WO20: drive the known parse-parity divergences toward zero (678/144/4) #285

Open

Description

@ronaldtse

Goal

Drive the documented cross-grammar harness divergences toward zero. Current: 412/435 identical, 3 known kinds — item-kind (678), constraints (144), item-value (4) — attributed to py-normalizer design (docs/parity README B-series).

Order of attack

  1. item-value (4 rows) — smallest, likely outright fixable: identify the rows, determine the correct value per the maps' sources, fix the offending side, re-run the harness, expect 4 fewer.
  2. constraints (144) — classify the pattern(s); if a single normalizer rule explains them, fix and re-run; report the residual honestly.
  3. item-kind (678) — likely structural (kind naming between the generated py parser and ts). Classify; if mechanically reconcilable without breaking py-vs-py parity (scripts/parse_parity_py.py, 432/435 current), do it; otherwise document precisely WHY it is design-inherent, with the rule stated so a future reader can re-derive it.

Gates

  • py-vs-py driver: must not regress below 432/435 (canonical + raw).
  • Harness after each step: report the new identical-count and residual kinds.
  • ts parser-parity (289 maps) + maps-CI gates stay green; golden zero-delta.
  • NO grammar (.parg) edits — parser/normalizer layer only (grammar changes are their own pipeline).

Branch: wo20-divergences (ruby repo for py normalizer edits; maps for harness/normalizer docs).

Activity

  1. ronaldtse commented on Nov 16, 2026

    @ronaldtse
    ContributorAuthor

    WO20 progress — all three kinds resolved, harness at 435/435 (zero divergence kinds). PR: #291.

    Order of attack, as specified:

    1. item-value (4) — resolved. All four rows are alalc-ell-Grek-Latn-2010 (after "Ν" before "Κ" + the lowercase mirror). Neither side carries a wrong value: ts preserves written constraint order while the py SubRule model stores the four kinds as named fields, so positional comparison swapped both kinds and values. Closed by the constraints rule below.
    2. constraints (144) — resolved. Single normalizer rule explains the whole class: constraint written order vs the fixed-field model. The four kinds are simultaneous lookarounds (written order carries no semantics), so the canonical schema now projects BOTH parsers onto the fixed before/after/not_before/not_after order, stable within a kind. The audit property holds: a one-sided kind lands at a different position or changes the length, a duplicated kind (ts keeps every written copy, py the last) shows as length/value mismatch. No corpus rule writes a duplicated kind — none of the 286 ordering rows hid one.
    3. item-kind (678) — classified, then reconciled. Three sub-classes:
      • 138 positional swaps induced by (2);
      • 493 none vs "" — both runtimes lower none to the empty string at compile (ts converter.ts case "none" → StringItem("") + compile-item.ts none: {re:"",literal:""}; py actions.py "converter parity"), py cannot represent none distinctly → canonical form is the shared lowering;
      • 47 any_character fn-vs-alias — ts actions.ts yields a function atom, py an AliasItem; both compile through the stdlib-alias path with re: "." (ts converter.ts keeps the alias path; py items.py ALIAS_COMPILED) → canonical form is the shared lowering.

    Residual: zero. No .parg edits, no parser/model changes, py-vs-py parity untouched. Every rule is stated in-code and in new §D of docs/parity/README.md with file:line citations.

    Gates: harness 435/435, 0 kinds (was 412/435, 826 rows); py-vs-py driver (--hand-rev 7a84260) canonical 432/435, raw 432/435 (gate held); py rs-golden zero-delta (1 passed); ts parser-parity off a fresh origin/main clone: parse-all-isc 428/428 + end-to-end.test.ts green; maps-CI ruby parse gate replicated locally: 435/435.

    No interscript-ruby change was required — the entire residual lived in the harness canonical projection (scripts/parse-parity.mjs), which the py-vs-py driver's canonical judgment already shares (it re-sorts constraints into the fixed kind order and lowers none the same way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions