Repository navigation
Detect phi cycles in PhiMatcher::Find and PhiMatcher::Final. - #400
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
copybara/1005116724
branch
4 times, most recently
from
October 23, 2026 16:43
2d3cf3d to
f7f595a
Compare
`PhiMatcher::Find` and `PhiMatcher::Final` followed phi transitions until a match or final weight was found, checking only for a single-state phi self-loop (`nextstate == s`). A phi cycle of two or more states (or a phi self-loop in `Find` when `phi_loop` is `false`) caused an infinite loop in both fatal and non-fatal error modes. Detect phi cycles in `PhiMatcher::Find` and `PhiMatcher::Final` using Brent's O(1)-space cycle detection algorithm (Richard P. Brent, "An improved Monte Carlo factorization algorithm," *BIT Numerical Mathematics*, 20(2):176-184, 1980), report `FSTERROR()` and set `error_ = true` when a phi cycle is encountered, and stop following phi self-loops in `Find` when `phi_loop_` is `false`. PiperOrigin-RevId: 1005116724
copybara-service
Bot
force-pushed
the
copybara/1005116724
branch
from
October 23, 2026 17:17
f7f595a to
66d81c6
Compare
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.
Detect phi cycles in PhiMatcher::Find and PhiMatcher::Final.
PhiMatcher::FindandPhiMatcher::Finalfollowed phi transitions until a match or final weight was found, checking only for a single-state phi self-loop (nextstate == s). A phi cycle of two or more states (or a phi self-loop inFindwhenphi_loopisfalse) caused an infinite loop in both fatal and non-fatal error modes.Detect phi cycles in
PhiMatcher::FindandPhiMatcher::Finalusing Brent's O(1)-space cycle detection algorithm (Richard P. Brent, "An improved Monte Carlo factorization algorithm," BIT Numerical Mathematics, 20(2):176-184, 1980), reportFSTERROR()and seterror_ = truewhen a phi cycle is encountered, and stop following phi self-loops inFindwhenphi_loop_isfalse.