Skip to content

WO20: reverse-mode golden gate (capture once, replay in all four runtimes) #286

Open

Description

@ronaldtse

Goal

Reverse mode now exists in all four runtimes (rs reference, ruby pin, ts/py compiled-IR ports) but has NO cross-runtime golden gate. Build the reverse-mode capture/replay gate mirroring the forward one (tests/golden/isc-wf0.jsonl + additivity gates).

Approach

  1. Extend the rs capture tooling: for each map with reverse content (the reverse_maps fixtures + corpus maps whose reverse is well-defined), capture forward-input -> reversed-output rows per runtime into tests/golden/isc-reverse.jsonl (or an equivalent additive file — design the shape following the forward golden).
  2. Replay gates per runtime: ts, py, ruby replay the captured reverse rows byte-identically (mirroring tests/test_golden_capture.py / golden-isc-wf0.test.ts / tests/golden_capture.rs patterns).
  3. Wire into maps-CI additivity-gates alongside the forward gates.
  4. rs remains the capture reference; where ruby's documented crash deviations apply, mirror rs's recorded choices exactly (they are already the ports' behavior).

Gates

  • Zero-delta on the forward golden (untouched).
  • The reverse golden: captured once, replayed identically by all four.
  • Suite green everywhere; CI wiring green.

Branches: wo20-reverse-gate-rs (capture extension), wo20-reverse-gate-ruby (py+ruby replay), wo20-reverse-gate-ts (ts replay), maps CI wiring rides the maps-side branch.

Activity

  1. ronaldtse commented on Nov 16, 2026

    @ronaldtse
    ContributorAuthor

    WO20 milestone — the reverse-mode golden gate is built, replayed green in all four runtimes, and wired into maps-CI. Branches + PRs:

    Capture (rs, the reference): interscript/interscript-rs#32 (wo20-reverse-gate-rs)

    • iscrs capture --reverse extends the forward capture: for each map, reverse the document (Document#reverse parity) and capture the REVERSED document's own embedded tests — the swapped pairs, so every row's src is a forward expected output and the row set mirrors the forward golden's shape ({"map", "src", "out"}), one jsonl row per pair.
    • tests/golden/isc-reverse.jsonl: 10,024 rows over 313 maps (428 corpus maps + 10 reverse fixtures, captured against maps main). The fixtures gained their ruby-ground-truth embedded tests so they feed the capture. Maps whose reverse is unsupported (documented ruby-crash deviations) contribute no rows — absence is the recorded choice; execution errors record as null, the canonical marker every replay gate maps its own errors to.

    Replay (byte-identical, verified locally against the sibling layout):

    Divergences found by the gate (documented, not papered over): the first full-corpus capture diverged — ruby 568 rows/27 maps, ts 603/33, py 3,215/123. Two families: the ruby-engine family fires reversed zero-width-from rules (empty from + boundary assertions, e.g. the ALA-LC Arabic rule-8a word-initial-hamzah deletion) as insertions where the rs engine leaves them inert — rs reproduces those maps' swapped embedded tests, the ports' engines do not — plus reversed parallel rule-selection order; py's compiled-IR port deviates more broadly. Those 125 maps are excluded from the golden via the checked-in manifest tests/golden/reverse-divergent-maps.txt (rs side), which documents the families and shrinks to zero as the engines converge. Follow-up engine work is the natural next WO item.

    CI wiring: #297 (wo20-reverse-gate-ci) — a reverse step per runtime job in additivity-gates.yml, forward steps untouched. Merge order: rs #32, ruby #865, ts #141 first (or together); until then the reverse steps no-op (skip-on-missing is uniform).

    Gates: forward golden untouched and zero-delta (13,745 rows, re-verified by re-capture diff + all four forward gates); reverse golden captured once, replayed identically by all four; suites green.

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