-
-
Notifications
You must be signed in to change notification settings - Fork 232
Fix pantelides-with-ag corner case #2009
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
Conversation
Fixes the corner case mentioned in the doc comment. In partiuclar, when we have an incomplete alias chain, the alias can change which variable needs to be considered the highest-differentiated. While we're at it, also take care of the todo in the same place.
We're using augmenting path construction here to try to find a maximal matching of the variables at the given differentiation level. However the construct_augmenting_path! function assumes as a pre-condition that eq-color is reset to zero in order for it to actually produce an augmenting path. Failing to do this can cause it to falsely declare a system singular.
# Invariant from alias elimination: Stem is chosen to have | ||
# the highest differentiation order. | ||
@assert stem′ !== nothing | ||
if !haskey(ag, var′) || ag[var′][2] != stem′ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an ASCII diagram to show why this is true and why the clean up step is needed in comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASCII diagram explaining why which condition is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I'm asking which condition you want explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just explain the general process and why the clean up at the end is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cleanup is just addressing the # TODO: remove lower diff vars from whitelist
that was already there, but I can expand the comments a bit.
Fixes the corner case mentioned in the doc comment. In partiuclar, when we have an incomplete alias chain, the alias can change which variable needs to be considered the highest-differentiated. While we're at it, also take care of the todo in the same place.