Mehdi Amini f934db36aa
[mlir][sparse] Reject dense level after non-unique level in encoding verifier (#184157)
The sparse tensor iteration model for dense levels requires exactly one
parent position to linearize into a contiguous range. However, when a
non-unique level (e.g. compressed(nonunique)) precedes a dense level,
the DedupIterator provides a two-element cursor {posLo, segHi}, causing
DenseLevel::peekRangeAt to assert and crash with:

Assertion `parentPos.size() == 1 && "Dense level can not be
non-unique."'

Fix this by adding a check in SparseTensorEncodingAttr::verify that
rejects any encoding where a dense level directly follows a non-unique
level, emitting a proper diagnostic instead of crashing during lowering.

Fixes #130008
2026-03-03 12:42:49 +01:00
..