Skip to content

Regression test for double rounding carrying out of the significand - #9223

Merged
tautschnig merged 1 commit into
diffblue:developfrom
tautschnig:kiro/9200-float-bv-shift-overflow
Nov 6, 2026
Merged

tautschnig merged 1 commit into
diffblue:developfrom
tautschnig:kiro/9200-float-bv-shift-overflow

Conversation

@tautschnig

@tautschnig tautschnig commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

The fix for #9200 (float_bvt::round_fraction computing 1 << 52 in int, which set bit 20 instead of bit 52 when rounding carried out of a double's significand) was merged as part of #9395. That PR's test only covers converting a ppc64le binary128 long double to double. This PR adds the reproducers from #9200 as a regression test: converting a long long just below 2^63 to double, and a double addition rounding up to 2.0, on the default target. With --z3 (run by make -C regression/cbmc test-z3 in CI), both assertions fail without the fix and pass on develop.

Fixes: #9200

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copilot AI balanced review requested due to automatic review settings October 20, 2026 19:38

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.93%. Comparing base (64a588e) to head (189ed16).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9223   +/-   ##
========================================
  Coverage    80.93%   80.93%           
========================================
  Files         1719     1719           
  Lines       190345   190345           
  Branches        73       73           
========================================
  Hits        154052   154052           
  Misses       36293    36293           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

diffblue#9395 fixed float_bvt::round_fraction, which set bit 20 instead of bit
52 when rounding overflowed the significand of a double, as it computed
1 << 52 in int. Its test only covers converting a binary128 long double
to double on ppc64le. The bug, however, equally affects conversions and
arithmetic on the default target with the non-FPA SMT encoding (e.g.,
--z3), as reported in diffblue#9200: converting a long long just below 2^63 to
double, or a double addition that rounds up to 2.0, yielded a tiny
subnormal. Add these reproducers as a regression test, which fails
with --z3 without the fix.

Fixes: diffblue#9200

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig tautschnig changed the title Fix int shift overflow in float_bvt::round_fraction Regression test for double rounding carrying out of the significand Nov 5, 2026
@tautschnig
tautschnig force-pushed the kiro/9200-float-bv-shift-overflow branch from 9656f0d to 189ed16 Compare November 5, 2026 16:54
@tautschnig
tautschnig merged commit 8bd42f2 into diffblue:develop Nov 6, 2026
39 of 43 checks passed
@tautschnig
tautschnig deleted the kiro/9200-float-bv-shift-overflow branch November 6, 2026 05:59
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.

SMT2 backend without FPA: double results that round up to a power of two become a subnormal (int shift overflow in float_bvt::round_fraction)

3 participants