Repository navigation
Conversation
ide
marked this pull request as ready for review
December 4, 2026 20:56
`FabricMountingManager` converts each layout coordinate of a mount item to pixels with `scale`, which cleared the floating-point status flags before the multiplication and tested them twice after it to log an overflow or an underflow. Each of those is a libm call that reads or writes the Arm floating-point status register (FPSR). `scale` now tests the product: an infinite result from a finite coordinate is an overflow. A product that underflows is below `FLT_MIN` and rounds to zero pixels, so `scale` no longer logs it. ReactAndroid builds, and RNTester's Release build mounts its screens on an arm64 Android 16 emulator. On that emulator, a benchmark that scales 65,536 coordinates with both versions measured a median of 21.6 to 33.4 ns per call before and 0.4 to 0.9 ns after, over three runs. The rounded pixel values match, and both versions log an overflow for `3e38 * 2.625`. Signed-off-by: James Ide <ide@expo.dev>
ide
force-pushed
the
@ide/android-mount-scale-overflow
branch
from
December 5, 2026 01:18
8cb381f to
d5ab271
Compare
Visual regressionNo visual differences at ios: no capture |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
FabricMountingManagerconverts each layout coordinate of a mount item to pixels withscale, which cleared the floating-point status flags before the multiplication and tested them twice after it to log an overflow or an underflow. Each of those is a libm call that reads or writes the Arm floating-point status register (FPSR).scalenow tests the product: an infinite result from a finite coordinate is an overflow. A product that underflows is belowFLT_MINand rounds to zero pixels, soscaleno longer logs it.Changelog:
[INTERNAL] [CHANGED] - Check Android mount coordinates for overflow without fenv calls.
Test Plan:
ReactAndroid builds, and RNTester's Release build mounts its screens on an arm64 Android 16 emulator. On that emulator, a benchmark that scales 65,536 coordinates with both versions measured a median of 21.6 to 33.4 ns per call before and 0.4 to 0.9 ns after, over three runs. The rounded pixel values match, and both versions log an overflow for
3e38 * 2.625.