Repository navigation
Fix madspace_tests failure on cuda: copy read-only arrays in test_beam_rapidity - #297
Merged
Merged
Conversation
Co-authored-by: oliviermattelaer <33414646+oliviermattelaer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for manneback madspace_tests
Fix madspace_tests failure on cuda: copy read-only arrays in test_beam_rapidity
Oct 16, 2026
oliviermattelaer
marked this pull request as ready for review
October 16, 2026 23:22
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.
The
manneback / madspace_testsjob on the cuda runner fails intest_beam_rapidity(4 parametrizations).lab.map_inverse(...)raisesTypeError: __dlpack__() got an unexpected keyword argument 'max_version'. I couldn't run the tests locally, so this fix is unverified.Cause
x1andx2withnp.broadcast_to, which returns read-only, zero-stride arrays.max_version, and it doesn't acceptmax_versioneither, so the retry indlpack_to_tensor(function_runtime.cpp) fails with theTypeError.Change
madspace/tests/test_beam_frame.py:.copy()the broadcastx1andx2so they are writable and contiguous before they go tomap_inverse.Not changed
dlpack_to_tensorshares onedlpack_version_cacheacross all arguments of a call. In the fallback branch, a failure caused by an argument other thanmax_version(here, the read-only export error) is retried withmax_version. That retry then raises theTypeErrorabove, which hides the original error. Users passing read-only numpy arrays on an old numpy would hit the same failure. I haven't changed this.