Skip to content

automata: make PikeVM optional - #1381

Open
jerguslejko wants to merge 1 commit into
rust-lang:masterfrom
topk-io:topk
Open

automata: make PikeVM optional#1381
jerguslejko wants to merge 1 commit into
rust-lang:masterfrom
topk-io:topk

Conversation

@jerguslejko

@jerguslejko jerguslejko commented Aug 4, 2026

Copy link
Copy Markdown

The meta engine hardcodes the PikeVM as the last line of defense: every non-literal pattern ends up in Core, and when the DFAs give up, it silently falls back.

We run regex inside our database (topk.io), so patterns come from users, not us. A pattern falling back to PikeVM runs 10-100x slower — a p99 spike we don't control. We'd rather reject that search than eat it.

This PR makes the PikeVM optional: Config::pikevm(bool), default true, nothing changes unless you opt out. With it off, the bounded engines still pick up whatever they can, and when there's truly nothing left to run, the new try_is_match_with / try_search_with return an error instead. The infallible routines panic, same contract as before.

Happy to rename things or rework the approach.

@jerguslejko
jerguslejko marked this pull request as draft August 4, 2026 11:20
@jerguslejko
jerguslejko force-pushed the topk branch 8 times, most recently from b4711de to d2bb76e Compare August 4, 2026 17:18
@jerguslejko jerguslejko changed the title [wip] automata: make PikeVM optional Aug 4, 2026
@jerguslejko
jerguslejko marked this pull request as ready for review August 5, 2026 16:33
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