{"record":{"id":"578efd6ca2c9f217","repo":"jax-ml/jax","slug":"dynamic-slice-unrecognized-index-pidx-index","errorCode":null,"errorMessage":"dynamic_slice: unrecognized index {pidx.index}","messagePattern":"dynamic_slice: unrecognized index (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"jax/_src/numpy/indexing.py","lineNumber":562,"sourceCode":"        axis, = pidx.consumed_axes\n        size = self.shape[axis]\n        start, stop, stride = pidx.index.indices(size)\n        assert stride in [-1, 1]  # validated above\n        if stride < 0:\n          new_start = stop + 1 + abs(start - stop - 1) % abs(stride)\n          start_indices.append(new_start)\n          slice_sizes.append(max(0, start + 1 - new_start))\n          rev_axes.append(axis)\n        else:\n          start_indices.append(start)\n          slice_sizes.append(max(0, stop - start))\n      elif pidx.typ == IndexType.DYNAMIC_SLICE:\n        assert isinstance(pidx.index, indexing.Slice)\n        start_indices.append(pidx.index.start)\n        slice_sizes.append(pidx.index.size)\n        trivial_slicing = False\n      else:\n        raise TypeError(f\"dynamic_slice: unrecognized index {pidx.index}\")\n\n    if len(start_indices) > 1:\n      # We must be careful with dtypes because dynamic_slice requires all\n      # start indices to have matching types.\n      dt = lax_utils.int_dtype_for_shape(self.shape, signed=True)\n      start_indices = [lax.convert_element_type(i, dt) for i in start_indices]\n\n    return _DynamicSliceIndexer(\n      start_indices=start_indices,\n      slice_sizes=slice_sizes,\n      rev_axes=rev_axes,\n      squeeze_axes=squeeze_axes,\n      newaxis_dims=newaxis_dims,\n      normalize_indices=normalize_indices,\n      trivial_slicing=trivial_slicing,\n    )\n\n  def is_advanced_int_indexer(self):","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/numpy/indexing.py#L544-L580","documentation":"Second catch-all TypeError in to_dynamic_slice, raised in the start-index-building loop when an index type passed validation categorization but has no dynamic-slice start contribution. Indicates an internally unrecognized IndexType.","triggerScenarios":"An index type that is not INTEGER/ELLIPSIS/NONE/SLICE/DYNAMIC_SLICE/ARRAY/BOOLEAN reaches the second loop of to_dynamic_slice — essentially an internal inconsistency or new index kind without dynamic support.","commonSituations":"Extending JAX with custom index types; mismatched JAX internal versions; extremely rare for end users.","solutions":["Use only standard index types (int, slice, None, ..., scalar tracers)","Check for a JAX version mismatch between jax and jaxlib","File an issue with a minimal reproducer if using supported constructs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only standard index types","Keep jax/jaxlib versions in sync"],"tags":["jax","indexing","internal","dynamic-slice"],"backgroundTag":"invalid-index-type","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}