Skip to content

v2026.7.22

Choose a tag to compare

@github-actions github-actions released this 06 Jul 14:05

Closing the rust gap — the inner-literal prefilter takes the biggest gap line to parity, the real-regex
crate's find_iter outruns the regex crate, and a third differential fuzzer (against that crate) lands with
its first harvest: an upstream bug, a documented \w divergence, and a \s fix that makes our own drop-in
claim true.

A pattern whose match does not begin with a literal — the date \d{4}-\d{2}-\d{2} — was the duel's worst
line: REAL scanned every position a digit could start a match at, where the regex crate memmem'd the rare -
and skipped the rest. REAL now does the same: it extracts a required inner literal, scans for it, reverse-
matches the prefix to the match start, and confirms forward.

  • The date no-match line went from ~201× the regex crate to ~1.6×. A haystack the literal never appears
    in costs a single memmem; sparse-match haystacks improve by 30–100×; dense matches sit at parity — the
    per-candidate confirm reuses the forward-DFA + one-pass extract, and its setup is amortized per-regex, gated
    below a measured size so a small haystack never regresses.
  • Byte-identical to the core, proven on the 3.2M-case exhaustive with the route on. The leftmost-correctness
    contract (the reverse bound advances only on a yield; the forward backstop is the linearity guard) is the
    arc's lesson.
  • A committed 4-D veto matrix (make matrix-gate, in full-local-gate) now screens pattern × size ×
    match/no-match × density on every hot-path change — because a bench that measures one slice hides a
    regression in another.

find_iter now outruns the regex crate on span throughput (the wrapper reuses one span buffer and takes
a span-0 fast path — no per-match allocation). The crate also gained a native criterion bench and a
rebar-protocol runner.

The crate now has its own differential fuzzer — the third oracle after Python re and std::regex. Its first
runs already paid off:

  • An upstream regex-crate bug, found by REAL and fixed upstream in
    rust-lang/regex#1373: with a top-level alternation, its
    literal prefilter can resume past a leftmost match beginning in another branch. REAL agrees with Python re;
    the fuzzer skips the class (with a depth-aware detector) so it does not read as a REAL bug.
  • A documented \w divergence. REAL's \w follows Python re (its contract), not UTS#18: regex matches
    marks / Join_Control / connector-Pc / Other_Alphabetic (2642 code points) that re does not; re matches
    \p{No} (915) that regex does not. Recorded in the crate's Divergences table, with a reproducible
    category-annotated probe (fuzz/unicode_probe/).
  • A \s fix — our own drop-in claim, made true. The same cross-engine probe surfaced that REAL's \s
    rejected U+001CU+001F, which Python re matches (str.isspace) — a pre-existing divergence from our
    primary contract, hidden because no fuzzer had fed a control char to \s. \s now matches re; a
    drift-guard test pins the hand-written ASCII shorthand sets to the oracle-generated tables so the class
    cannot recur, and the fuzzers' text alphabets gained control-char coverage.

No behaviour change for existing patterns beyond the \s correction toward re. The crate's earlier semantic
fixes ride in this train: $ is end-only (the engine's dollar_endonly flag, like regex), and empty-match
iteration is driven by position (as regex-automata does). The inner-literal route is transparent (the
exhaustive and its routed==core differential assert it). All five published-version surfaces stay CalVer-locked
in step.