Skip to content

WO20: the reverse-mode golden gate — ruby + py replay (#286) - #865

Merged
ronaldtse merged 2 commits into
mainfrom
wo20-reverse-gate-ruby
Nov 16, 2026
Merged

ronaldtse merged 2 commits into
mainfrom
wo20-reverse-gate-ruby

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

WO20 (#286, interscript/maps): the reverse-mode golden gate — the ruby + py replay side. The rs capture (interscript-rs#32) records tests/golden/isc-reverse.jsonl (10,024 rows over 313 maps) once; this branch replays it byte-identically in ruby and py.

  • tools/isc_wf1_golden_gate.rb gains --reverse: parse (the DSL cache makes re-parses free), Document#reverse, Interscript::Interpreter.call(rdoc) on each row's src — the capture procedure mirrored. The rs reverse fixtures (tests/reverse_maps, siblings of the golden file) join the load path AFTER the corpus, so a corpus map shadows a same-named fixture exactly like the capture's locate. The reverse gate has no adopting-set exemption (captured once, replayed identically — no adoption flow) and always gates against the golden out fields. Errors map to null, the canonical capture marker; forward mode keeps its ERROR:Class:msg self-comparison marker.
  • Skip-on-missing: a missing golden file now exits 0 with a notice (the rs/ts/py gates already skip in-test) — until the rs branch lands on main, the reverse gate is a no-op here.
  • interscript-py/tests/test_golden_reverse.py: the py mirror of test_golden_capture.py — build the corpus (libs, maps) plus the rs fixtures first-wins, reverse_map + execute_stage on the reversed main stage, errors to null.

Verification

  • ruby: 10,024/10,024 rows, delta vs golden 0 (bundle exec ruby -Ilib tools/isc_wf1_golden_gate.rb --reverse --golden .../isc-reverse.jsonl --maps-root ...).
  • py: test_golden_reverse.py green against the same golden (GOLDEN_ROOT sibling layout).
  • Forward gate untouched and re-verified: 13,745 rows, delta vs golden 0 (--parity).
  • Cross-runtime note: on the 125 maps where the ports still diverge from the rs reference (reversed zero-width-from rule firing; py reversed-parallel selection; rev-dep), rows are excluded upstream by the rs-side manifest tests/golden/reverse-divergent-maps.txt — shrink-to-zero as the engines converge.

Companion branches: wo20-reverse-gate-rs (capture + golden), wo20-reverse-gate-ts (ts replay), wo20-reverse-gate-ci (maps workflow wiring).

The rs reverse golden (interscript-rs tests/golden/isc-reverse.jsonl,
10,024 rows over 313 maps, captured once by iscrs capture --reverse)
replays byte-identically here:

- tools/isc_wf1_golden_gate.rb gains --reverse: parse, Document#reverse,
  Interpreter.call(rdoc) on each row's src — the capture procedure
  mirrored. The rs reverse fixtures (tests/reverse_maps, siblings of
  the golden) join the load path after the corpus, so a corpus map
  shadows a same-named fixture like the capture's locate. Errors map
  to null, the canonical capture marker; no adopting-set exemption
  (captured once, replayed identically, no adoption flow).
- interscript-py/tests/test_golden_reverse.py mirrors the py forward
  gate with reverse_map + execute_stage on the same rows.

Verified locally: ruby 10,024/10,024 delta 0; py green. The forward
golden path is untouched (13,745 rows, delta 0 re-verified). Maps the
ports still diverge on live in the rs manifest
(tests/golden/reverse-divergent-maps.txt) — shrink-to-zero follow-up.
Aligns the ruby gate with the rs/ts/py skip convention: a missing
golden capture means a missing sibling checkout, not a failure — the
WO20 reverse golden lands on rs main with its branch, and until merge
this gate must stay a no-op in CI.
@ronaldtse
ronaldtse merged commit c053995 into main Nov 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant