Skip to content

fix(modelchecker): preserve action return values across symmetric clones#354

Merged
jp-fizzbee merged 1 commit into
mainfrom
user/jp/fix-clone-preserves-returns
May 19, 2026
Merged

fix(modelchecker): preserve action return values across symmetric clones#354
jp-fizzbee merged 1 commit into
mainfrom
user/jp/fix-clone-preserves-returns

Conversation

@jp-fizzbee
Copy link
Copy Markdown
Collaborator

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.

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>
@jp-fizzbee jp-fizzbee merged commit 46d91a5 into main May 19, 2026
1 check passed
@jp-fizzbee jp-fizzbee deleted the user/jp/fix-clone-preserves-returns branch May 19, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants