Skip to content

Add signed add overflow elimination coverage - #941

Draft
augmentcode[bot] wants to merge 2 commits into
mainfrom
michaelos443/signed-add-overflow-elimination-tests
Draft

augmentcode[bot] wants to merge 2 commits into
mainfrom
michaelos443/signed-add-overflow-elimination-tests

Conversation

@augmentcode

@augmentcode augmentcode Bot commented Jul 8, 2026

Copy link
Copy Markdown

Problem

  • Signed safeadd had no overflow-elimination coverage, so we weren't exercising the VRA-proven-safe path or the sign-boundary guard.

Solution

  • Teach OverflowEliminationPass to recognize the signed eq(slt(y, 0), slt(add(x, y), x)) check and add unit coverage for both elimination and non-elimination.

Misc

  • Manual session fallback: github-api was unavailable, so this PR was opened via github-app-api.

Pull Request opened by Augment Code | View session

@augmentcode

augmentcode Bot commented Jul 8, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

👋 I've got this PR.

I'll handle review feedback, CI failures, and merge conflicts, and ping you the moment it's ready for review. Drop a comment anytime.

Marking it ready and picking reviewers are your call — I'll leave both alone.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 1 suggestions.

Fix in Cosmos

%y_in = source
%x = mod %x_in, {bound + 1}
%y = mod %y_in, {bound + 1}
%res = add %x, %y

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test name test_no_eliminate_signed_add_overflow_crossing_sign_boundary suggests testing addition across positive/negative boundaries, but mod produces only non-negative values [0, 2^254], so both x and y are non-negative and slt %y, 0 is always false; the test actually validates that the pass correctly rejects elimination when max(x) + max(y) > SIGNED_MAX (2^255 > 2^255-1), not sign-boundary crossing.

Severity: low


🤖 Was this useful? React with 👍 or 👎

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

PR Author Agent⚡

Good catch — I renamed the test to test_no_eliminate_signed_add_overflow_exceeding_signed_max and updated the docstring to match what the setup is actually proving in a2bdf9a.

@augmentcode

augmentcode Bot commented Jul 15, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

This PR appears to be inactive. The agent will stop monitoring until a new comment is posted.

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.

1 participant