Issue #2536: regex::Dfa: a known pattern runs from DFA tables laid down while building

Open and answer this issue on GitHub.

ready · opened 2026-11-21 · updated 2026-11-21 · 0 comments

Part of #673 After #2533

What it is

The first engine of our own: regex::Dfa (S2 as a table, ADR-regex-1 D6, D7). A known pattern that determinises gets a forward and a reverse dense DFA laid down while building, written for the target’s byte order as aligned ref Array[u32], and read in place at run time through regex-automata’s from_bytes_unchecked in a crate under crates/unsafe. This is step 4 of #673; it needs regex::compile (step 3, #2533).

To build

  1. A crate under crates/unsafe opening a dense DFA from a borrowed table with from_bytes_unchecked (D7).
  2. regex::Dfa: regex::compile lays down the forward and reverse dense DFA for the target as a constant entry for the type, and a match is located unanchored with them (D6). Test: a known pattern compiled as regex::Dfa finds the same matches as regex::dynamic on the same text.
  3. The report (D9) in --comptime: which engine a pattern got. Test: a .nika whose --comptime output names regex::Dfa.

Done when

A known pattern compiled as regex::Dfa runs from tables laid down while building, read in place, finds what regex::dynamic finds, and --comptime reports its engine; the commit of item 3 says Fixes #N.

Split from #673 by Claude Code

Back to Open Issues