Skip to content

Fix madspace_tests failure on cuda: copy read-only arrays in test_beam_rapidity - #297

Merged
oliviermattelaer merged 2 commits into
mainfrom
copilot/fix-manneback-madspace-tests
Oct 16, 2026
Merged

oliviermattelaer merged 2 commits into
mainfrom
copilot/fix-manneback-madspace-tests

Conversation

Copilot AI commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The manneback / madspace_tests job on the cuda runner fails in test_beam_rapidity (4 parametrizations). lab.map_inverse(...) raises TypeError: __dlpack__() got an unexpected keyword argument 'max_version'. I couldn't run the tests locally, so this fix is unverified.

Cause

  • The test builds x1 and x2 with np.broadcast_to, which returns read-only, zero-stride arrays.
  • The runner's numpy appears to be old. It can't export read-only arrays over DLPack without max_version, and it doesn't accept max_version either, so the retry in dlpack_to_tensor (function_runtime.cpp) fails with the TypeError.
  • I inferred the numpy version from the error and haven't confirmed it on the runner.

Change

  • madspace/tests/test_beam_frame.py: .copy() the broadcast x1 and x2 so they are writable and contiguous before they go to map_inverse.

Not changed

dlpack_to_tensor shares one dlpack_version_cache across all arguments of a call. In the fallback branch, a failure caused by an argument other than max_version (here, the read-only export error) is retried with max_version. That retry then raises the TypeError above, 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.

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
oliviermattelaer marked this pull request as ready for review October 16, 2026 23:22
@oliviermattelaer
oliviermattelaer merged commit dc39f09 into main Oct 16, 2026
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