The marble run earns attention.
Regex Marble Run turns a JavaScript pattern into a physical 3D machine. Its live interface accepts a pattern, test string, and the i, m, s, u, v, and y flags. The public repository describes backtracking and Pike-style execution, a trace log, keyboard controls, shareable URL state, and reduced-motion support.[1][2]
That is the right kind of visual ambition. Gates, branches, loops, and return rails can make an invisible control path inspectable. The machine should not become the authority it is explaining.
A diagram can show a route. Only the named engine can return its result.
There are several truths in one regex run.
The pattern text is one truth. The engine and flags are another. The current input position matters too. MDN documents that JavaScript regular expressions become stateful with the global or sticky flag because exec() stores lastIndex. A sticky match fails immediately if the pattern does not match at that exact index. A global match may scan forward.[3]
The execution model is a separate choice. Russ Cox shows how backtracking and Thompson-style NFA simulation can accept the same regular language while doing different amounts of work. His NFA simulation advances a set of reachable states together. Backtracking tries alternatives and returns after failure. Backreferences complicate that clean equivalence.[4]
The repository has an honest loose wire.
We checked revision beec6e9e94cf1f0fe4204c1a3e45064deb289eaf in an isolated directory with Node 22.22.2 and npm 10.9.7. Dependency installation completed with no reported audit vulnerabilities. The repository's full Vitest command ran 1,222 tests. It passed 1,215 and failed 7. The failures involved duplicate named groups, scoped modifier syntax, and differential cases where the local runtime rejected syntax expected by the tests.
This does not prove that the live browser demo is wrong. We did not run its Playwright suite or compare several browser engines. It does prove that the engine version belongs in the receipt. A green animation without a runtime name can hide a compatibility boundary.
Ship four linked records.
- Save the exact pattern, flags, input, and starting index.
- Name the engine and version that produced the result.
- Label the trace as native, reconstructed, sampled, or simulated.
- Record the match span, captures, ending
lastIndex, and any timeout.
The switchyard below uses this browser's native JavaScript RegExp.exec(). It does not reproduce the Marble Run engine. It makes the browser result and state transition visible.