message: [XLA] Document DynamicSlice and DynamicUpdateSlice semantics.
diff: @@ -791,8 +791,6 @@ DynamicSlice extracts a sub-array from the input array at dynamic
  `size_indices`, which specify the end point of exclusive slice intervals in each
  dimension: [start, start + size). The shape of `start_indices` must be rank ==
  1, with dimension size equal to the rank of `operand`.
  -Note: handling of out-of-bounds slice indices (generated by incorrect runtime
  -calculation of 'start_indices') is currently implementation-defined.
  <b> `DynamicSlice(operand, start_indices, size_indices)` </b>
  @@ -812,6 +810,17 @@ calculation of 'start_indices') is currently implementation-defined.
  : : : dimension to avoid wrapping modulo :
  : : : dimension size. :
  +The effective slice indices are computed by applying the following
  +transformation for each index `i` in `[1, N)` before performing the slice:
  +
  +```
  +start_indices[i] = clamp(start_indices[i], 0, operand.dimension_size[i] - size_indices[i])
  +```
  +
  +This ensures that the extracted slice is always in-bounds with respect to the
  +operand array. If the slice is in-bounds before the transformation is applied,
  +the transformation has no effect.
  +
  1-dimensional example:
  ```
  @@ -847,8 +856,6 @@ The shape of `update` determines the shape of the sub-array of the result which
  is updated.
  The shape of `start_indices` must be rank == 1, with dimension size equal to
  the rank of `operand`.
  -Note: handling of out-of-bounds slice indices (generated by incorrect runtime
  -calculation of 'start_indices') is currently implementation-defined.
  <b> `DynamicUpdateSlice(operand, update, start_indices)` </b>
  @@ -866,6 +873,17 @@ calculation of 'start_indices') is currently implementation-defined.
  : : : dimension. Value must be greater than or equal :
  : : : to zero. :
  +The effective slice indices are computed by applying the following
  +transformation for each index `i` in `[1, N)` before performing the slice:
  +
  +```
  +start_indices[i] = clamp(start_indices[i], 0, operand.dimension_size[i] - update.dimension_size[i])
  +```
  +
  +This ensures that the updated slice is always in-bounds with respect to the
  +operand array. If the slice is in-bounds before the transformation is applied,
  +the transformation has no effect.
  +
  1-dimensional example:
  ```
  