Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port fix for VSP floating-point hang from 4.8 #4979

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

SamBent
Copy link
Contributor

@SamBent SamBent commented Aug 2, 2021

Addresses Issue #4978. This is a port of a servicing fix in .NET 4.7-4.8.

Description

The hang is due to floating-point drift. After any scroll, VSP runs logic to verify that it scrolled to the right place (it can be wrong due to new information discovered while de-virtualizing). There's a special case when the scroll reaches the end of the data, comparing the actual offset to the maximum (extent - viewport height). This uses the strict test DoubleUtil.AreClose(actual, maximum), which tolerates floating-point drift of 10^-16 pixel. But the difference in the repro is 10^-14 pixel, so the test fails.

Prior to the 2020-08 update, this would have merely triggered a Debug.Assert, invisible to customers. With the update, it now requests a re-measure, fixing a bug that arose when the numbers were legitimately different. But when the numbers are so close and layout rounding is enabled, the re-measure just ends up in the same situation, and the app hangs.

The fix is to use the looser test LayoutDoubleUtil.AreClose(actual, maximum), which tolerates floating-point drift of 10^-6 pixel.

Customer Impact

Hang while scrolling.

Regression

Exposed by PR #3564.

Testing

Ad-hoc with customer scenarios.
Standard regression testing.

Risk

Low. Straightforward port of .NETFx fix that was released earlier this year.

@SamBent SamBent requested a review from a team as a code owner August 2, 2021 22:57
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 2, 2021
@ghost ghost requested review from fabiant3 and ryalanms August 2, 2021 22:57
@SamBent SamBent merged commit a12e85c into dotnet:main Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants