Repository navigation
Count conflicts by lookahead token - #878
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.
Conflict totals currently count conflict objects, although one object can cover several lookahead tokens and several objects can describe the same token. This can overcount S/R conflicts and either overcount or undercount R/R conflicts.
Count S/R conflicts once per state and lookahead token, and R/R conflicts once for each reduction after the first on that token, matching Bison 3.8.2's counting convention.
Use the same per-state counts for warnings, report summaries, and %expect diagnostics. Keep individual conflict pairs for detailed reports and counterexamples. Remove memoized totals so queries made before computation or between LALR and IELR do not retain stale counts.
Measured on Ruby 4.0.9, arm64 macOS, with YJIT disabled and 12 balanced, randomized baseline/candidate pairs per mode. Before is master at 970b304; After is 08aa82a. Values are means. CLI measurements include startup and C output generation; warm measurements follow one warm-up run and GC.start.
The paired mean CLI elapsed-time change is +0.37%, with a bootstrap 95% interval of −0.70% to +1.30%. There is no clear change in
parse.ytime, GC activity, or peak RSS. The smaller IELR fixture shows a 0.086 ms increase in warm CPU time (+1.5%), but no clear CLI time change. This is a diagnostic correctness fix; no speedup is claimed.