Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 21, 2025

Backport of #122534 to release/10.0

/cc @tannergooding @sdcb

Customer Impact

  • Customer reported
  • Found internally

#122203 - Customers attempting to convert a UInt128 to a double may see incorrect results for values in the range [2^88, 2^104).

Regression

  • Yes
  • No

Not a regression, UInt128 was checked in with this bug which was a simple logic error.

Testing

Explicit tests and validation covering the scenario were added.

Risk

Low. This is a lesser used type and the bug was a case where a path was covering a lesser range than intended. This was due to it shifting by 24 (64 - 40 == 24) when it should've been shifting by 40 instead (64 - 24 == 40).

sdcb added 5 commits December 21, 2025 10:58
- Correctly calculate the sticky bit when converting large UInt128 values (>= 2^104) to double to prevent precision loss.
- Optimize the upper bits extraction by accessing _upper directly instead of shifting.
- Add regression tests for Int128 to ensure it is also fixed.
- Update test comments to better explain the test cases.

Fixes #122203
Use decimal literals instead of scientific notation and hex constructors
instead of bit shifts for clearer test value representation.
Change threshold check from (value._upper >> 24) to (value._upper >> 40)
to correctly handle values up to 2^104 in the intermediate precision branch.
@tannergooding
Copy link
Member

CC. @jeffhandley, @artl93 for initial bar check (addition of servicing-consider label, etc)

@artl93
Copy link
Member

artl93 commented Dec 23, 2025

We should do math right. Approved from my perspective. This is not a technical review.

@artl93 artl93 added the Servicing-consider Issue for next servicing release review label Dec 23, 2025
@artl93
Copy link
Member

artl93 commented Dec 23, 2025

Please make sure to have a technical review before submitting to tactics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants