Skip to content

Conversation

@kparzysz-quic
Copy link
Contributor

The values of min and extent in Range should have the same type, but the usage of convenience may often produce type mismatches, for example Range(0, dim) will assume int32 for the min. These mismatches can then cause hard-to-track errors, in particular assertions in the arithmetic simplifier. Such problems are likely to occur when a mismatched range is bound to a variable.

This patch identifies a few occurrences where a Range is bound to a Var, and checks that all types match. In case of a mismatch, types of compile- time immediates can be adjusted, otherwise an error is reported.

The values of `min` and `extent` in Range should have the same type, but
the usage of convenience may often produce type mismatches, for example
`Range(0, dim)` will assume int32 for the min. These mismatches can then
cause hard-to-track errors, in particular assertions in the arithmetic
simplifier. Such problems are likely to occur when a mismatched range is
bound to a variable.

This patch identifies a few occurrences where a Range is bound to a Var,
and checks that all types match. In case of a mismatch, types of compile-
time immediates can be adjusted, otherwise an error is reported.
@kparzysz-quic
Copy link
Contributor Author

This is a replacement PR for #15909.

@junrushao
Copy link
Member

Ah I just merged a PR #16074, but not sure if it's related.

@tqchen tqchen closed this Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants