Fix failing unit tests related to the position map #927
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.
Bug fix
Summary
Description:
Mana informed me that the twist-shift BC unit test was failing and it seemed to be caused by the position map.


I found this quite strange because when I ran these unit tests on perlmutter GPU, they were just fine on main.

In any case, I did see a potential issue with memory handling regarding how the gk_geometry modules create a null position map if none is provided. This memory handling could lead to different behavior on different machines (although here, both Mana and I were testing on Perlmutter GPU). Even though I can't reproduce the same failure, I cleaned up the code by intentionally allocating a null position map in the unit tests and passing that to the geometry generators.
Solution
Create a null position map in each unit tests.
Remove code in the gk_geometry generators to detect if no position map is passed.
Removed unused "flags" variable from the position map.
Automated testing: unit tests are updated. position_map tests are updated accordingly.
Community Standards
layer/zeroshould have a unit test, e.g.,core/zero.Testing:
make checkand unit tests all pass.Additional Notes
I would like @manauref to run the appropriate tests before this is merged. I am unable to reproduce the original error, so I cannot verify that these modifications fix the issue.