fix(modelchecker): preserve action return values across symmetric clones#354
Merged
Merged
Conversation
CloneWithRefs was initializing the clone's Returns field to an empty StringDict. Since the symmetric-permutation hashing path (findVisitedSymmetric -> getSymmetryTranslations -> symmetricHashWithoutClone -> p2.HashCode()) operates on a clone, per-action return values were silently stripped from the dedup key. Two yield-points that differ only in what an action returned collapsed into one node. Copy p.Returns into the clone so the symmetric hash matches the original HashCode (which includes Returns at line 604). This restores the pre-#297 behavior where actions returning values produce distinct nodes — needed for visualization, MBT, and explorer consumers that depend on the return value being visible in the graph. Regression introduced by #297 ("Consistently use min hash value") when the dedup lookup switched from `visited[node.HashCode()]` to `visited[minHash]` — the new path always goes through CloneWithRefs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
CloneWithRefs was initializing the clone's Returns field to an empty StringDict. Since the symmetric-permutation hashing path (findVisitedSymmetric -> getSymmetryTranslations -> symmetricHashWithoutClone -> p2.HashCode()) operates on a clone, per-action return values were silently stripped from the dedup key. Two yield-points that differ only in what an action returned collapsed into one node.
Copy p.Returns into the clone so the symmetric hash matches the original HashCode (which includes Returns at line 604). This restores the pre-#297 behavior where actions returning values produce distinct nodes — needed for visualization, MBT, and explorer consumers that depend on the return value being visible in the graph.
Regression introduced by #297 ("Consistently use min hash value") when the dedup lookup switched from
visited[node.HashCode()]tovisited[minHash]— the new path always goes through CloneWithRefs.