Skip to content

nir/algebraic: test the u2u downcast split - #557

Merged
RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
joshuaswarren:w7q/i2i-cast-tests
Nov 20, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
joshuaswarren:w7q/i2i-cast-tests

Conversation

@joshuaswarren

Copy link
Copy Markdown

Follow-up offered in #449 and confirmed with @RyanTheTide: the two algebraic_tests.cpp cases from #449, rebased onto the current aurora-wip tip after #513 re-landed the fold.

  • downcast_of_sign_extended_value_is_u2u: u2u8 of i2i32-of-16-bit load must stay u2u (a narrowing i2i would fail nir_validate).
  • downcast_sign_extended_inner_narrow: u2u16 of i2i32-of-8-bit load must keep the sign extension as i2i16.

Compiler-only; no hardware run needed. Credits Karmjit Mahil's upstream change 23eedf4 that #513 carries.

The two cases from PR #449 rebased onto the current tip: a narrowing
i2i must not appear for u2u8-of-i2i32-of-i2i16 and the sign extension
must survive for u2u16-of-i2i32-of-i2i8. Follow-up offered in #449;
upstream fold re-landed separately in #513.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T00:33:20.054137Z 2e6f56f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e6f56f6ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

run_pass();

/* An i2i narrowing would fail validation; the downcast has to stay u2u. */
EXPECT_EQ(count_narrowing_i2i(b->shader), 0u);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include the downcast-split fix before enabling this test

When running nir_tests from this revision, this test fails because nir_opt_algebraic.py:3029–3039 still registers u2u8(i2i32(a)) -> i2i8(a), not the downcast split described in the commit message. nir_search.c::construct_value() creates that replacement directly, so the 16-bit input produces a narrowing i2i8: this expectation and EXPECT_TRUE(u2u8_of_16) fail, and the final validation aborts assertion-enabled builds. Include the prerequisite optimizer fix or rebase onto a revision containing it; adding these tests alone breaks the NIR test target.

Useful? React with 👍 / 👎.

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.

2 participants