Skip to content

Conversation

alexet
Copy link
Contributor

@alexet alexet commented Sep 5, 2025

With this the regex parsing becomes local.

The assumption is that strings in the base don't become regexs or stop being regexs. From what I have seen that doesn't seem likely.

@github-actions github-actions bot added the Java label Sep 5, 2025
@alexet alexet force-pushed the alexet/java-regex-local branch from 90c450b to 0f65b20 Compare September 8, 2025 15:38
@alexet alexet force-pushed the alexet/java-regex-local branch from 0f65b20 to 2201974 Compare September 16, 2025 14:55
@alexet alexet requested a review from kaspersv September 16, 2025 14:55
@alexet alexet marked this pull request as ready for review September 16, 2025 15:25
@alexet alexet requested a review from a team as a code owner September 16, 2025 15:25
@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 15:25
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes regex flow analysis in Java by making parsing local after global regex finding. The change uses forceLocal to localize the usedAsRegex predicate while maintaining the global regex finding capabilities.

Key changes:

  • Refactors the usedAsRegex predicate to use local evaluation with forceLocal
  • Extracts the original logic into a helper predicate usedAsRegexImpl
  • Adds overlay[local] annotation to the main predicate

* Holds if `regex` is used as a regex, with the mode `mode` (if known).
* If regex mode is not known, `mode` will be `"None"`.
*
* As an optimisation, only regexes containing an infinite repitition quatifier (`+`, `*`, or `{x,}`)
Copy link
Preview

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the comment: 'repitition' should be 'repetition'.

Copilot uses AI. Check for mistakes.

@alexet alexet added the no-change-note-required This PR does not need a change note label Sep 16, 2025
@kaspersv
Copy link
Contributor

Code change looks good. Do you have links to DCA experiments? Since we are moving the overlay frontier there is a risk of optimisation regressions under non-overlay evaluation, so I would expect a DCA experiment that shows no performance impact under non-overlay evaluation and a DCA experiment that shows little to no accuracy regression under overlay evaluation and possibly a speedup.

@alexet
Copy link
Contributor Author

alexet commented Sep 18, 2025

@kaspersv
Copy link
Contributor

Yes, timing results look good. There were extraction differences for smowton__kotlin@2ed108c2___buildless which is causing alert wobble and there is also the same issue with iSoron__uhabits@897a236__323e as in the TC overlay caller PR. Have you confirmed with the Java team that we can ignore these?

@alexet
Copy link
Contributor Author

alexet commented Sep 19, 2025

smowton states that the extractor errors can't possibly be caused by this PR so should be disregarded.

@alexet alexet merged commit c1c0828 into main Sep 19, 2025
18 of 19 checks passed
@alexet alexet deleted the alexet/java-regex-local branch September 19, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants