Skip to content

fix(precompute): scope compiled matchers to config - #604

Merged
zzylol merged 2 commits into
mainfrom
fix/595-generation-scoped-regex
Sep 4, 2026
Merged

zzylol merged 2 commits into
mainfrom
fix/595-generation-scoped-regex

Conversation

@zzylol

@zzylol zzylol commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Closes #595.

Removes the unbounded process-global regex cache. Runtime configs now own their compiled regex objects, so retiring a plan generation releases its matcher memory. Compilation happens once during immutable config cloning; the observation hot path only calls MatchString.

Also exports ValidateMatchers for config/plan boundaries to reject malformed regexes before activation. Tests prove caller mutation cannot change installed matcher semantics and invalid patterns are rejected.

Stacked on #603.

@zzylol

zzylol commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up review fix: malformed regex configs now fail closed. Invalid initial configs are not activated, and invalid updates leave the current active/staged config unchanged; tests cover both paths.

@zzylol
zzylol force-pushed the perf/594-generation-cache-pruning branch from b435aa9 to 1acdee0 Compare September 4, 2026 12:08
@zzylol
zzylol force-pushed the fix/595-generation-scoped-regex branch from f53f55c to ffa64ab Compare September 4, 2026 12:08
@zzylol
zzylol force-pushed the perf/594-generation-cache-pruning branch from 1acdee0 to 3fd59c4 Compare September 4, 2026 12:09
@zzylol
zzylol force-pushed the fix/595-generation-scoped-regex branch from ffa64ab to 7c14a12 Compare September 4, 2026 12:09
@zzylol
zzylol changed the base branch from perf/594-generation-cache-pruning to main September 4, 2026 12:35
@zzylol
zzylol merged commit 9f366b7 into main Sep 4, 2026
1 check 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.

asap-precompute-go: bound regex matcher memory across plan/config updates

1 participant