Skip to content

Replace the widening_mul harnesses with autoharness - #820

Open
bardiharborow wants to merge 1 commit into
model-checking:mainfrom
bardiharborow:fix-widening-mul-autoharness
Open

bardiharborow wants to merge 1 commit into
model-checking:mainfrom
bardiharborow:fix-widening-mul-autoharness

Conversation

@bardiharborow

Copy link
Copy Markdown

Remove the 10 hand-written widening_mul harnesses and verify all 8 integer types that define widening_mul (i8-i64 and u8-u64) with autoharness instead, over all inputs.

For u16, u32 and u64, the removed harnesses only checked operands in three 21-value intervals. The harness comment said widening_mul calls unchecked_mul, but it is now self as $WideT * rhs as $WideT, and the assertion repeated that expression, so the only useful check was Kani's overflow check on the multiplication. Autoharness performs that check over every input.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

Remove the 10 hand-written `widening_mul` harnesses and verify all 8
integer types that define `widening_mul` (`i8`-`i64` and `u8`-`u64`) with
autoharness instead, over all inputs.

For `u16`, `u32` and `u64`, the removed harnesses only checked operands in
three 21-value intervals. The harness comment said `widening_mul` calls
`unchecked_mul`, but it is now `self as $WideT * rhs as $WideT`, and the
assertion repeated that expression, so the only useful check was Kani's
overflow check on the multiplication. Autoharness performs that check
over every input.
@bardiharborow
bardiharborow requested a review from a team as a code owner December 4, 2026 18:26

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.

1 participant