Repository navigation
Avoid repropagating unchanged IELR annotations - #872
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compute_inadequacy_annotationspropagates a state's entire annotation list whenever the state is requeued, including annotations whose contribution matrices have not changed.Keep a local snapshot of each propagated matrix and send only new or changed annotations to the predecessors. Take snapshots before propagation so updates made through cycles are picked up on the next visit. Preserve annotation order and propagate each changed matrix in full, including changes to unconditional contributions.
For Ruby's
parse.y, this reduces the annotations processed byannotate_predecessorfrom 468,735 to 247,717 while keeping the final 31,677 annotations unchanged. Add regression tests for new and merged annotations, unconditional contributions, multiple predecessors, and self-loops.Measured on Ruby 4.0.9, arm64 macOS, with YJIT disabled and 12 balanced, randomized baseline/candidate pairs per mode:
CLI elapsed time improves in all 12 pairs, with a paired mean reduction of 8.4% and a bootstrap 95% interval of 7.2–9.6%. Allocations decrease by 8.1%. Peak RSS and GC time show no clear improvement, and the two smaller grammars show no clear CLI elapsed-time improvement.