Skip to content

[REQ] Single-line array/tile matrix extraction with row indexing #1028

Description

@daedalus5

Description

Syntax support for, eg:

tile[i,j,k][1]
arr[i,j][0]

Where tile is a 3D tile of matrices and 1 is the second row of the matrix at i,j,k,
and arr is a 2D array of matrices and 0 is the first row of the matrix at i,j.

Activity

  1. added this to the 1.11.0 milestone on Oct 16, 2025
  2. self-assigned this
    on Oct 16, 2025
  3. modified the milestones: 1.11.0, 1.12.0 on Nov 13, 2025
  4. modified the milestones: 1.12.0, 1.13.0 on Jan 27, 2026
  5. modified the milestones: 1.13.0, 1.14.0 on Apr 8, 2026
  6. changed the title [-][REQ] Single-line tile matrix extraction with row indexing[/-] [+][REQ] Single-line array/tile matrix extraction with row indexing[/+] on May 14, 2026
  7. modified the milestones: 1.14.0, 1.15.0 on May 21, 2026
  8. modified the milestones: 1.15.0, 1.16.0 on Jun 26, 2026
  9. modified the milestones: 1.16.0, 1.17.0 on Jul 23, 2026
  10. shi-eric commented on Jul 23, 2026

    @shi-eric
    Contributor

    Related: #1688 covers the same rank-awareness problem in tile_extract() and chained subscripts for composite-valued tiles. #1688 exercises the rank-2 wp.vec3 case, while this issue covers applying a matrix-row index after extracting an element from a rank-3 tile. They likely share a fix area, but neither is a duplicate of the other.

  11. modified the milestones: 1.17.0, 1.18.0 on Jul 25, 2026
  12. shi-eric commented on Aug 20, 2026

    @shi-eric
    Contributor

    This is addressed by 4cd493b.

    The change adds rank-aware matrix-row extraction for matrix-dtype tiles, so kernel expressions such as tile[i, j, k][1] now return the selected row vector. It also supports row writes, negative row indices, and adjoints. The array form arr[i, j][0] was already supported and covered by existing matrix-array extraction tests; both forms requested here were reverified against this commit.

    Public API behavior

    • This is kernel-side subscript behavior; no host-side Python API was added.
    • tile[i, j, k][r] now works for matrix-dtype tiles, with row reads and writes across supported tile ranks, negative row indices, and adjoints.
    • Existing matrix-valued array expressions such as arr[i, j][r] remain supported.

    Test coverage

    • New warp/tests/tile/test_tile_composite_row.py coverage exercises matrix-row reads and writes for 1D–4D tiles, negative row indices, read/write adjoints, and overwrite-gradient clearing; TestTileCompositeRow is registered in the default and debug suites.
    • Existing warp/tests/matrix/test_mat.py::test_mat_array_extract covers chained row extraction from a 2D matrix-valued array, including gradients.

    Behavioral verification

    The issue's rank-3 tile expression produced the expected matrix row on CUDA, and the rank-2 array expression produced the expected row on both CPU and CUDA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature requestRequest for something to be added

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions