{"record":{"id":"7e75c5a49427dfcc","repo":"jax-ml/jax","slug":"expected-len-update-block-spec-block-shape-star","errorCode":null,"errorMessage":"Expected {len(update_block_spec.block_shape)} start indices, got {len(clamped_starts)}","messagePattern":"Expected (.+?) start indices, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/fuser/block_spec.py","lineNumber":3361,"sourceCode":"    )\n  if operand_block_spec is not pallas_core.no_block_spec:\n    if update_block_spec is not pallas_core.no_block_spec:\n      raise ValueError(\n          'Cannot push block spec from both operand and update simultaneously.'\n      )\n    return operand_block_spec\n  if update_block_spec is pallas_core.no_block_spec:\n    return pallas_core.no_block_spec\n\n  operand_shape = ctx.avals_in[0].shape\n  update_shape = ctx.avals_in[1].shape\n\n  def new_index_map(*args):\n    clamped_starts = _get_clamped_slice_starts(\n        ctx, operand_shape, update_shape, start_idx_offset=2\n    )\n    if len(clamped_starts) != len(update_block_spec.block_shape):\n      raise ValueError(\n          f'Expected {len(update_block_spec.block_shape)} start indices, got'\n          f' {len(clamped_starts)}'\n      )\n    idx = update_block_spec.index_map(*args)\n    assert len(idx) == len(update_block_spec.block_shape)\n    out_idx = list(idx)\n    bs = update_block_spec.block_shape\n    for i in range(len(out_idx)):\n      out_idx[i] = _offset_indexer(\n          bs[i], out_idx[i], clamped_starts[i], update_shape[i]\n      )\n    return tuple(out_idx)\n\n  return update_block_spec.replace(index_map=new_index_map)\n\n\n@register_push_block_spec_rule(lax.stack_p)\ndef _stack_push_rule(","sourceCodeStart":3343,"sourceCodeEnd":3379,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/fuser/block_spec.py#L3343-L3379","documentation":"Consistency check when pushing a block spec from an update operand onto a sliced ref: the number of computed clamped start indices must equal the number of dimensions in the update block spec's block shape; a mismatch means the slice indexing produced fewer/more starts than dimensions, so a ValueError is raised.","triggerScenarios":"Thrown at jax/_src/pallas/fuser/block_spec.py:3361 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the operand and update shapes agree on the number of slice-start dimensions for the dynamic update slice","Check that the update block spec's block_shape rank matches the number of start indices produced by the clamped slice-start computation","Avoid pushing block specs from both operand and update at once; supply only one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}