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

Reimplemented error tree disambiguation in Java #2035

Merged
merged 15 commits into from
Oct 8, 2024

Conversation

PieterOlivier
Copy link
Contributor

@PieterOlivier PieterOlivier commented Oct 2, 2024

This PR replaces the (naive) error disambiguation filter written in Rascal. The time complexity has been reduced from O(n^2) to O(n), where n is the number of nodes in the original parse forest.

In practice this means that in extreme scenarios (where there are many ambiguous error trees), the time it takes to disambiguate a parse forest is about the same as the time it takes to parse the input.

For instance, in the SlowDisambiguationBug test case included in this PR both the parse time and disambiguation time are around 5 seconds on my machine. Disambiguation in Rascal took +- 30 minutes.

@PieterOlivier PieterOlivier mentioned this pull request Oct 2, 2024
Copy link
Member

@DavyLandman DavyLandman left a comment

Choose a reason for hiding this comment

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

Great improvement 👍

I have some clarification questions, and some ideas to increase performance.

Have you measured the performance with a profiler, since 3 seconds might still be a lot, especially compared to original parsing time.

Also, optimized the case where no changes are detected in subtrees.
@PieterOlivier PieterOlivier deleted the branch feat/error-recovery October 4, 2024 07:25
@PieterOlivier PieterOlivier mentioned this pull request Oct 4, 2024
@PieterOlivier PieterOlivier reopened this Oct 4, 2024
@PieterOlivier PieterOlivier changed the base branch from error-recovery to feat/error-recovery October 4, 2024 07:44
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 75.86207% with 21 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/error-recovery@027ba71). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...l/parser/gtd/recovery/ParseErrorDisambiguator.java 71% 15 Missing and 5 partials ⚠️
...g/rascalmpl/values/RascalFunctionValueFactory.java 80% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             feat/error-recovery   #2035   +/-   ##
=====================================================
  Coverage                       ?     49%           
  Complexity                     ?    6556           
=====================================================
  Files                          ?     685           
  Lines                          ?   61077           
  Branches                       ?    8830           
=====================================================
  Hits                           ?   30155           
  Misses                         ?   28717           
  Partials                       ?    2205           

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

Both when introducing error nodes and when disambiguating errors
@PieterOlivier PieterOlivier merged commit dbe2153 into feat/error-recovery Oct 8, 2024
7 checks passed
toinehartman pushed a commit that referenced this pull request Oct 16, 2024
Reimplemented error tree disambiguation in Java
toinehartman pushed a commit that referenced this pull request Oct 21, 2024
Reimplemented error tree disambiguation in Java
toinehartman pushed a commit that referenced this pull request Oct 21, 2024
Reimplemented error tree disambiguation in Java
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