Skip to content

Raise ArrayInterface compat floor to 7.1 (fix downgrade CI) - #40

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-arrayinterface-compat-floor
Jun 15, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-arrayinterface-compat-floor

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Problem

The downgrade / Downgrade Tests check on main is red. The downgrade job pins ArrayInterface to its compat floor (7.0.0). At 7.0.0, ArrayInterface.fast_scalar_indexing(::JLArray) returns true because the GPUArraysCore-aware definition that correctly reports false for GPU-backed arrays was only added in ArrayInterface 7.1.0.

As a result, the _require_fast_scalar_indexing guard never fires on the downgrade floor: the package proceeds to scalar-index the GPU array, and GPUArrays throws a plain ErrorException ("Scalar indexing is disallowed.") instead of the package's intended ArgumentError. This breaks the JLArray error messages testset in test/interface_compatibility_tests.jl, which asserts an ArgumentError mentioning "fast scalar indexing" / "GPU arrays".

Fix

Raise the ArrayInterface compat floor from "7" to "7.1". The package's documented behavior (rejecting GPU arrays with a clear ArgumentError) only holds from ArrayInterface 7.1.0 onward, so 7.1 is the correct minimum bound.

Verification (local, Julia 1.10.11)

Bisected ArrayInterface against JLArrays 0.1.1 (the downgrade floor for JLArrays):

7.0.0 => fast_scalar_indexing=true   (guard never fires -> ErrorException, test fails)
7.1.0 => fast_scalar_indexing=false  (guard fires -> ArgumentError, test passes)

With ArrayInterface 7.1.0 + JLArrays 0.1.1, all 8 assertions in the "JLArray error messages" testset pass:

[ Info: ArrayInterface=7.1.0 JLArrays=0.1.1 fast_scalar_indexing=false
Test Summary:          | Pass  Total  Time
JLArray error messages |    8      8  0.1s

Please ignore until reviewed by @ChrisRackauckas.

The downgrade CI pins ArrayInterface to its compat floor (7.0.0). At
7.0.0, `ArrayInterface.fast_scalar_indexing(::JLArray)` returns `true`
because the GPUArraysCore-aware definition that correctly reports `false`
for GPU-backed arrays was only added in ArrayInterface 7.1.0.

As a result the `_require_fast_scalar_indexing` guard never fires on the
downgrade floor: the package proceeds to scalar-index the GPU array and
GPUArrays throws a plain `ErrorException` ("Scalar indexing is
disallowed.") instead of the package's intended `ArgumentError`. This
breaks the `JLArray error messages` testset, which asserts an
`ArgumentError` mentioning "fast scalar indexing" / "GPU arrays".

The package's documented behavior (rejecting GPU arrays with a clear
`ArgumentError`) only holds from ArrayInterface 7.1.0 onward, so 7.1 is
the correct minimum bound.

Verified locally on Julia 1.10.11: with ArrayInterface 7.1.0 + JLArrays
0.1.1 (the downgrade floor for JLArrays), all 8 assertions in the
"JLArray error messages" testset pass; at 7.0.0 they fail exactly as in
CI.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review June 15, 2026 15:16
@ChrisRackauckas
ChrisRackauckas merged commit 3733c94 into SciML:main Jun 15, 2026
9 of 11 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.

2 participants