Fix non-deterministic boundary node ordering in panel-type constraints#464
Open
timryanb wants to merge 1 commit into
Open
Fix non-deterministic boundary node ordering in panel-type constraints#464timryanb wants to merge 1 commit into
timryanb wants to merge 1 commit into
Conversation
A-CGray
approved these changes
Jul 10, 2026
| funcsSens[key][self.coordName] = self.funcsSens[key].copy() | ||
| self.constraintsSensUpToDate[conName] = True | ||
|
|
||
| def _getComponentBoundaryNodes(self, compIDs): |
Contributor
There was a problem hiding this comment.
I'll leave it up to you whether you want to do this in this PR, but I feel like we should move this method to the meshloader class.
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.
_getComponentBoundaryNodesbuilt the boundary edge list by calling list() on a set difference (allEdges - dupEdges). Python set iteration order is an implementation detail that varies with Python version — the tuple hash algorithm changed between 3.7 and 3.8 — so the "first" boundary edge, and therefore the rotational ordering of the resulting node chain, was not guaranteed to be the same across environments.This caused tests that compare ordered constraint-value arrays against hardcoded references to fail on CI while passing locally when the two environments ran different Python versions.
Change: Replace list(allEdges - dupEdges) with sorted(allEdges - dupEdges). Sorting by (min_node_id, max_node_id) is entirely deterministic regardless of Python version or hash seed, and has no effect on correctness — boundary node connectivity is unchanged, only the starting point of the traversal is now fixed.