uros-b opened a new pull request, #58812: URL: https://github.com/apache/spark/pull/58812
### What changes were proposed in this pull request? `InstanceBlock` (in `Instance.scala`) has six `require(...)` invariant checks with no failure message, so a violation throws a bare `requirement failed`. This adds descriptive messages that interpolate the offending values: - the `InstanceBlock` constructor checks -- labels vs matrix rows, the matrix being transposed, and labels vs weights; - `InstanceBlock.blokifyWithMaxMemUsage` -- `maxMemUsage > 0` (both overloads) and the consistent-feature-dimension check. The conditions themselves are unchanged. ### Why are the changes needed? These checks guard internal invariants of the block-encoding path. A bare `requirement failed` is hard to act on; including the invariant and the actual values (lengths, feature dimensions, `maxMemUsage`) makes such failures diagnosable. This matches the messages already attached to sibling `require` checks elsewhere in `mllib`. ### Does this PR introduce _any_ user-facing change? No. `InstanceBlock` is `private[spark]`; this only changes the message of the `IllegalArgumentException` thrown on an internal invariant violation. ### How was this patch tested? Existing tests. The change only adds messages to existing `require` checks; the conditions are unchanged. The `mllib` module compiles cleanly. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
