Skip to content

[WIP] Fix test for signed/unsigned comparison semantics#499

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-signed-unsigned-comparison
Closed

[WIP] Fix test for signed/unsigned comparison semantics#499
Copilot wants to merge 1 commit intomainfrom
copilot/fix-signed-unsigned-comparison

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Fix, test signed/unsigned comparison semantics</issue_title>
<issue_description>There's the classical C footgun:

int x = -1;
unsigned int y = 1;
if (x < y) { ... }  // branch NOT taken — x converts to UINT_MAX

We're currently subject to this behavior, which isn't consistent with Python semantics (which we otherwise try to follow). Tweak map_comparison in ExpressionToCExpressionMapper in loopy/target/c/codegen/expression.py to treat mixed-signedness comparisons correctly. Add exhaustive tests.</issue_description>

Comments on the Issue (you are @copilot in this section)

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
@inducer inducer closed this Mar 31, 2026
Copilot stopped work on behalf of inducer due to an error March 31, 2026 18:34
Copilot AI requested a review from inducer March 31, 2026 18:34
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.

Fix, test signed/unsigned comparison semantics

2 participants