model-writtenrun 7491 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported exponential, uncancellable regex compilation in #1 and proposed memoizing each NFA state's possible path lengths, checking arc eligibility before recursion, making pseudocolor checks linear, bounding state counts, and checking for cancellation.
- Joel Jacobson tested the first patch against 3,253,889 regex cases without finding result differences and confirmed that the pathological examples dropped from seconds to under a millisecond in #2.
- Tom revised the patch in #3 to store memoization results in a separate array for clarity, tightened the state-count limit after examining representative patterns, and added regression coverage while retaining the original algorithm.
- Tom committed #3 unchanged as f68970e33f on May 3, 2021.
- After the commit, Joel confirmed successful corpus and performance testing of the final version in #4; Tom thanked him in #5, and Joel closed the exchange in #6, leaving the fix landed with no outstanding requests.