Skip to content

TST: make test_device_to_device resilient on a no_x64 device - #456

Merged
ev-br merged 2 commits into
data-apis:mainfrom
ev-br:fix_test_device_to_device
Jul 28, 2026
Merged

TST: make test_device_to_device resilient on a no_x64 device#456
ev-br merged 2 commits into
data-apis:mainfrom
ev-br:fix_test_device_to_device

Conversation

@ev-br

@ev-br ev-br commented Jul 28, 2026

Copy link
Copy Markdown
Member

Observed in gh-454:

FAILED tests/test_common.py::test_device_to_device[array_api_strict] - ValueError: Device array_api_strict.Device('no_x64') does not support dtype=array_api_strict.int64.

The culprit is that in -strict, the "no_x64" device does not support int64, which is a default on the default device. Thus just use int32 explicitly, which is supported everywhere.

EDIT: while at it, skip testing array_namespace with api_version=2024.12 and jax.numpy : otherwise jax barfs
that only 2025.12 is supported on python 3.13 and 3.14.

In `-strict`, the "no_x64" device does not support int64, which
is a default on the default device. Thus just use int32 explicitly,
which is supported everywhere.
Copilot AI review requested due to automatic review settings July 28, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates a portability-focused test to avoid relying on the default integer dtype, which can be int64 on some backends/devices (notably array_api_strict’s "no_x64" device). By explicitly choosing int32, the test should behave consistently across devices that do not support 64-bit integers.

Changes:

  • Set an explicit dtype=xp.int32 when creating the initial array in test_device_to_device.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jax errors out otherwise, says taht only 2025.12 is supported.
@ev-br
ev-br force-pushed the fix_test_device_to_device branch from 0ce549a to 6ae6b46 Compare July 28, 2026 13:17
@ev-br ev-br added this to the 1.16 milestone Jul 28, 2026
@ev-br
ev-br merged commit 44b614c into data-apis:main Jul 28, 2026
28 checks passed
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.

3 participants