Skip to content

[Bugfix] Handle Numeric conversion recursively - #1294

Open
ppppqp wants to merge 2 commits into
ROCm:mainfrom
ppppqp:fix/index-normalization
Open

ppppqp wants to merge 2 commits into
ROCm:mainfrom
ppppqp:fix/index-normalization

Conversation

@ppppqp

@ppppqp ppppqp commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Fixes #1218

Technical Details

We need to unwrap Numeric recursively since it can wrap ir.IndexType. Adding recursive handle to correctly convert Numeric -> IndexType -> Int64

Test Plan

Add tests to test the failing case and width preservation

Test Result

Submission Checklist

Copilot AI balanced review requested due to automatic review settings October 14, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The crash fix lacks regression coverage for index-wrapped Numeric values.

1 open finding
What changed in this PR

Fixes index normalization when Numeric wraps an MLIR index value.

Changes:

  • Recursively unwraps Numeric values so index operands convert to Int64.
File Description
python/​flydsl/​expr/​primitive.py Recursively normalizes integer-tuple leaves.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

if isinstance(value.value, ir.Value) and type(value).width < 32:
return Int32(value).value
return value.value
return _expand_int_tuple_leaves(value.value)

This branch has not been deployed

No deployments
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.

Bug: the Numeric wrapper bypasses index normalization.

2 participants