Skip to content

Feat/runner native regex slice4#450

Merged
cukas merged 3 commits into
mainfrom
feat/runner-native-regex-slice4
Jun 19, 2026
Merged

Feat/runner native regex slice4#450
cukas merged 3 commits into
mainfrom
feat/runner-native-regex-slice4

Conversation

@cukas

@cukas cukas commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

Why

How

Checklist

  • tsc -b passes
  • pnpm test passes
  • pnpm test:kern passes
  • pnpm lint passes
  • kern review packages/ --recursive checked

…lace/.replaceAll)

Differential oracle certifying the ReferenceRunner as the neutral 3rd leg
(ref === ts === py === expected) for the two string/array-RESULT regex ops the
dual emitters already support: <str>.split(/re/) -> string[] and
<str>.replace/.replaceAll(/re/, "lit") -> string.

Every expected value was verified empirically on the real pipeline (node V8 +
python3 CPython 3.11) via the shipped TS+PY emitters on 2026-06-19. RED-at-base:
46 fail (need the runner impl) / 16 pass (abstain rows already correct).

Discriminating fixtures: capture interleave; non-participating capture -> null;
$0 literal; $10 trailing-digit disambiguation; zero-width replace certifies;
nullable-alternation /g + /m-anchor-over-\r diverge (fence); surrogate subject
abstain; split terminal-tag boundary.
Make the ReferenceRunner EXECUTE <str>.split(/re/) -> string[] and
<str>.replace/.replaceAll(/re/, "lit") -> string as the neutral 3rd leg of
3-way parity. Mirrors the slice-3 gate/eval/route structure; reuses the shared
emitter validators (isZeroWidthCapableRegex, regexCaptureMeta,
validateReplStringForTS) so parity holds by construction.

Fences (all empirically verified node+python3): split RE-ADMITs limit/zero-width/
backref; replace RE-ADMITs non-literal-repl / bad-$-surface / replaceAll-no-g via
the shared validator; replace/replaceAll fence top-level alternation (nullable /g
diverges); BOTH abstain on a surrogate subject and on a /m anchor over a non-\n
line terminator. split binding is terminal-tagged; replace binding is a plain string.

Bare-dot refinement: a bare `.` diverges only over a \r/LS/PS SUBJECT (JS . excludes
them, Python . excludes only \n) — so it is a SUBJECT fence
(assertNoBareDotLineTerminatorDivergence), parallel to the /m fence, NOT a blanket
pattern reject; a bare dot over a clean subject certifies. Oracle hardened with the
no-/m bare-dot-\r rows that a competitive build (codex) missed by checking only /m.

slice-4 oracle 64/64; slice-1/2/3 31/38/43 unchanged; tsc + biome clean.
@cukas cukas force-pushed the feat/runner-native-regex-slice4 branch from 3e25045 to aa0301b Compare June 19, 2026 12:53
@cukas cukas merged commit b8f5075 into main Jun 19, 2026
4 checks passed
@cukas cukas deleted the feat/runner-native-regex-slice4 branch June 19, 2026 13:37
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.

2 participants