Skip to content

Fix I32x4 min/max working incorrectly for large values#589

Open
Shnatsel wants to merge 1 commit intoservo:mainfrom
Shnatsel:aarch64-min-max
Open

Fix I32x4 min/max working incorrectly for large values#589
Shnatsel wants to merge 1 commit intoservo:mainfrom
Shnatsel:aarch64-min-max

Conversation

@Shnatsel
Copy link
Copy Markdown

@Shnatsel Shnatsel commented May 2, 2026

The ARM I32x4::{min,max} implementations must compare integer lanes directly. Converting through f32 loses precision above 2^24, so values such as 16_777_217 round to neighboring integers and can produce a numerically wrong vector.

This PR fixes the issue and adds a regression test. The issue was spotted by GPT-5.5 xhigh.

@sagudev
Copy link
Copy Markdown
Member

sagudev commented May 2, 2026

this looks related to #583 and I suspect we can also revert test changes.

This PR fixes the issue and adds a regression test. The issue was spotted by GPT-5.5 xhigh.

But the PR/code was not done by AI, right?

@Shnatsel
Copy link
Copy Markdown
Author

Shnatsel commented May 2, 2026

The regression test/PoC is AI-written. I always have models write a PoC that fails miri before looking into the issue.

The production code change is human.

Feel free to drop the test if you have a policy against including AI contributions.

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