Skip to content

GH-50816: [C++][IPC] Improve sparse tensor index validation - #50817

Draft
rok wants to merge 4 commits into
apache:mainfrom
rok:cpp-ipc-validate-sparse-tensor-indices
Draft

GH-50816: [C++][IPC] Improve sparse tensor index validation#50817
rok wants to merge 4 commits into
apache:mainfrom
rok:cpp-ipc-validate-sparse-tensor-indices

Conversation

@rok

@rok rok commented Aug 5, 2026

Copy link
Copy Markdown
Member

Rationale for this change

Invalid sparse tensor indices should be rejected consistently before sparse-to-dense conversion.

What changes are included in this PR?

  • Validate sparse index bounds and index tensor buffers.
  • Validate compressed pointer consistency.
  • Validate CSF axis ordering.
  • Check sparse values and dense tensor sizes before conversion.
  • Keep CSF IPC index buffer sizing consistent with the index element width.

Are these changes tested?

Regression tests were added for invalid CSF axis ordering and out-of-range CSR and CSF indices. C++ formatting and lint checks pass.

Are there any user-facing changes?

Invalid sparse tensor inputs that were previously accepted are now rejected with an Invalid status.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant