Clear HELD-BY-ROOTS slot of lock targets for all successful operations#88
Merged
Conversation
ecpeterson
approved these changes
Oct 12, 2025
ecpeterson
left a comment
Contributor
There was a problem hiding this comment.
nice find & diagnosis
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.
In #80 we didn't go far enough -- the
held-by-rootsslot should be unset at the end of every successful operation -- not just multireweight operations. Otherwise stale information in this slot can lead to a strange situation where we lock superfluous targets.In the worst case, this can actually result in livelock! 🚨
For example, in the situation below, we get stuck on a
GRAFT 1 #<93356>--->#<90201> [#<372123>: #<93352>-]-->#<93356> from #<372123>that keeps failing.This happens because the
target-root#<93356>still has itsheld-by-rootsslot set to(#<96678>)from an earlier failedHOLDoperation.#<93356>eventually moves on and is pulled into anAUGMENT, but the slot remains set.#<96678>ends up being contracted in several layers of macrovertices, the topmost being#<372123>. Then#<372123>tries toGRAFT 1with#<93356>as thetarget-rootand the lock targets ultimately contain both#<372123>(a macrovertex) and#<96678>(a vertex contained in macrovertex#<372123>) and the lock process fails.If we always unset
held-by-rootsof all lock targets when a supervisor operation is successful, this cannot happen.