Skip to content

Ew/fix regex hang#10

Merged
ethan-wrasman-pkware merged 3 commits into
masterfrom
ew/fix_regex_hang
Apr 24, 2026
Merged

Ew/fix regex hang#10
ethan-wrasman-pkware merged 3 commits into
masterfrom
ew/fix_regex_hang

Conversation

@ethan-wrasman-pkware
Copy link
Copy Markdown

@ethan-wrasman-pkware ethan-wrasman-pkware commented Apr 17, 2026

Bug was brought to my attention with DSM-3647.

How the DFS was implemented, a single state can get traversed through more than once if reached by a different branch.

Ex:
1st Pass: A -> B -> all children of B are traversed
2nd Pass: C -> B -> all children of B are traversed again

The new method uses memoization, which uses dynamic programming to keep track of the children at any given state, so we do not have to traverse it more than once.

A few other tweaks were made that Claude suggested for some cleanup and optimization with infinite regexes.

ethan-wrasman-pkware and others added 3 commits April 15, 2026 14:34
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ethan-wrasman-pkware ethan-wrasman-pkware merged commit f9597d0 into master Apr 24, 2026
2 checks passed
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