jax-ml/jax · error · TypeError
static_slice: unrecognized index {pidx.index}
Error message
static_slice: unrecognized index {pidx.index} What it means
Second defensive fallback in to_static_slice: after re-iterating parsed indices to build start/limit/stride lists, an index whose type fell through all branches raises TypeError. Unreachable through normal classification; indicates internal inconsistency.
Source
Thrown at jax/_src/numpy/indexing.py:458
strides.append(1)
squeeze_axes.append(axis)
elif pidx.typ == IndexType.SLICE:
assert isinstance(pidx.index, slice)
axis, = pidx.consumed_axes
size = self.shape[axis]
start, stop, stride = pidx.index.indices(size)
if stride < 0:
new_start = min(size, stop + 1 + abs(start - stop - 1) % abs(stride))
start_indices.append(new_start)
limit_indices.append(max(new_start, start + 1))
strides.append(abs(stride))
rev_axes.append(axis)
else:
start_indices.append(start)
limit_indices.append(max(start, stop))
strides.append(stride)
else:
raise TypeError(f"static_slice: unrecognized index {pidx.index}")
return _StaticSliceIndexer(
start_indices=start_indices,
limit_indices=limit_indices,
strides=None if all(s == 1 for s in strides) else strides,
rev_axes=rev_axes,
squeeze_axes=squeeze_axes,
newaxis_dims=newaxis_dims,
)
def to_dynamic_slice(
self, *,
arr_is_sharded: bool = False,
normalize_indices: bool = True,
mode: str | slicing.GatherScatterMode | None) -> _DynamicSliceIndexer:
"""Convert to DynamicSliceIndexer data structure.
If this is not possible, raise a ValueError, TypeError, or IndexError.
"""View on GitHub (pinned to 1e1c6a8fc0)
Solutions
- Ensure consistent jax/jaxlib versions
- Use public indexing APIs
- File an upstream issue with a minimal repro
Defensive patterns
Strategy: retry
Prevention
- Pin matching jax/jaxlib versions
- Use public indexing APIs only
When it happens
Trigger: Same as 1425/1435: hand-built index structures or mixed JAX versions.
Common situations: Internal API misuse, version skew, patched internals.
Related errors
- Unrecognized index type: {typ}
- static_slice: unrecognized index {pidx.index} at position {p
- scan number of arguments doesn't match the number of jaxpr a
- dynamic_slice: unrecognized index {pidx.index}
- Expected strategy to be IndexingStrategy; got {strategy}
AI-assisted analysis of jax-ml/jax@1e1c6a8fc0 (2026-08-27).
Data as JSON: /api/errors/61e9ecfa1676172d.
Report an issue: GitHub.