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

backport filter pool key #4858

Merged
merged 2 commits into from
Apr 28, 2018
Merged

backport filter pool key #4858

merged 2 commits into from
Apr 28, 2018

Conversation

ivanpopelyshev
Copy link
Collaborator

#3866 and other issues.

@Patrick-Hammond confirmed that we still have the problem, and I want to solve it radical way.

@ivanpopelyshev ivanpopelyshev requested review from bigtimebuddy and GoodBoyDigital and removed request for bigtimebuddy April 23, 2018 13:44
@ivanpopelyshev
Copy link
Collaborator Author

Works like before:

https://jsfiddle.net/3kvazjw1/17/ - key = 'screen'
https://jsfiddle.net/3kvazjw1/20/ - key = '33554944'

I dont have examples with a bug, but I'm sure that solution is correct - we store the result instead of recalculation.

@bigtimebuddy
Copy link
Member

“I’m sure the solution is correct”, I don’t like any uncertainty here. Can you please try to dig up an erroring example so we can verify?

@ivanpopelyshev
Copy link
Collaborator Author

ivanpopelyshev commented Apr 24, 2018

Its the same problem as in #4745 and in #4579 (comment)

Extra multiplication and division can change the number, element cant return to the pool because key was changed.

Are you sure you want a third demo for it?

@ivanpopelyshev
Copy link
Collaborator Author

ivanpopelyshev commented Apr 24, 2018

You are right. it was fun to reproduce it, we have one more case. Here it is: https://jsfiddle.net/3kvazjw1/21/

Chrome at 90% zoom gives us 0.8999999761581421

var res = 0.8999999761581421;
console.log(1 / res * res);

shows 0.9999999999999999

That's why minWidth and minHeight are less than expected, and the key is wrong.

@ivanpopelyshev ivanpopelyshev added Priority: Medium 🛸 X-Files Mysterious, unexplainable or elusive behavior that’s difficult to track down or reproduce. labels Apr 24, 2018
Copy link
Member

@bigtimebuddy bigtimebuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm satisfied here, this seems like a good solution. Thanks for verifying @ivanpopelyshev

Copy link
Member

@cursedcoder cursedcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, math is ridiculous in js, for example const a = 0.1 + 0.7 will give 0.799999999999999

@ivanpopelyshev
Copy link
Collaborator Author

@cursedcoder all according to IEEE 754

@bigtimebuddy bigtimebuddy merged commit ffb5695 into dev Apr 28, 2018
@bigtimebuddy bigtimebuddy deleted the dev-filter-pool-key branch April 28, 2018 14:01
@lock
Copy link

lock bot commented Apr 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🛸 X-Files Mysterious, unexplainable or elusive behavior that’s difficult to track down or reproduce.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants