Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using UnreachableEOGPass in python #1951

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Using UnreachableEOGPass in python #1951

wants to merge 8 commits into from

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Jan 19, 2025

This PR adds a special version of the UnreachableEOGPass to the python frontend. It is executed before the symbol resolver and uses the python value evaluator. However, it is not completly usable yet, because the unreachable EOG pass is very slooooow for large code-bases. So this is blocked until #1811 is resolved.

@oxisto oxisto added the blocked Blocked by an external factor label Jan 19, 2025
@oxisto oxisto changed the title python unreachable Using UnreachableEOGPass in python Jan 19, 2025
This PR adds a special version of the `UnreachableEOGPass` to the python frontend. It is executed before the symbol resolver and uses the python value evaluator. However, it is not completly usable yet, because the unreachable EOG pass is very slooooow for large code-bases. So this is blocked until #1811 is resolved.
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 87.75510% with 6 lines in your changes missing coverage. Please review.

Project coverage is 77.91%. Comparing base (bfef80f) to head (d58166a).

Files with missing lines Patch % Lines
.../fraunhofer/aisec/cpg/passes/UnreachableEOGPass.kt 87.23% 0 Missing and 6 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...sec/cpg/frontends/python/PythonLanguageFrontend.kt 80.60% <ø> (ø)
...hofer/aisec/cpg/passes/PythonUnreachableEOGPass.kt 100.00% <100.00%> (ø)
.../fraunhofer/aisec/cpg/passes/UnreachableEOGPass.kt 89.83% <87.23%> (+0.35%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@maximiliankaul maximiliankaul left a comment

Choose a reason for hiding this comment

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

The Python-part LGTM

@@ -63,6 +64,7 @@ import kotlin.math.min
* a value (on the first assignment).
*/
@RegisterExtraPass(PythonAddDeclarationsPass::class)
@RegisterExtraPass(PythonUnreachableEOGPass::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to have this pass on by default? Why isn't it part of defaultPasses (the non-Python version obviously) and then Python replaces it with this?
I'm just wondering if this is a future we only want to have active by default for Python?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well since this pass is massively slow (at the moment), we probably do not want it active per-default. So we can either keep this PR open as blocked or I will remove the register extra pass and if someone wants it, they can activate it.

Base automatically changed from python-evaluator to main January 21, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by an external factor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants