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

ppc64le - Fix deviation in floating point values caused by FMA #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prashantkhoje
Copy link

This was exposed while testing CockroachDB.
Following tests from pkg/sql/opt/exec/execbuilder fail due to floating point precision differences caused by FMA:

  • TestExecBuild/local/geospatial
  • TestExecBuild/local-vec-off/geospatial
  • TestExecBuild/local-spec-planning/geospatial
  • TestExecBuild/fakedist/geospatial
  • TestExecBuild/fakedist-vec-off/geospatial
  • TestExecBuild/fakedist-metadata/geospatial
  • TestExecBuild/fakedist-disk/geospatial
  • TestExecBuild/fakedist-spec-planning/geospatial

With explicit casts in this patch, these failures are resolved.

References:
https://go.dev/ref/spec#Floating_point_operators
golang/go#53297
golang/go#48145
disintegration/gift#20 (comment)

This was exposed while testing CockroachDB.
Following tests from pkg/sql/opt/exec/execbuilder fail due to floating point precision differences caused by FMA:
- TestExecBuild/local/geospatial
- TestExecBuild/local-vec-off/geospatial
- TestExecBuild/local-spec-planning/geospatial
- TestExecBuild/fakedist/geospatial
- TestExecBuild/fakedist-vec-off/geospatial
- TestExecBuild/fakedist-metadata/geospatial
- TestExecBuild/fakedist-disk/geospatial
- TestExecBuild/fakedist-spec-planning/geospatial

With explicit casts in this patch, these failures are resolved.

References:
https://go.dev/ref/spec#Floating_point_operators
golang/go#53297
golang/go#48145
disintegration/gift#20 (comment)
@prashantkhoje
Copy link
Author

@rsned, please review.

@prashantkhoje
Copy link
Author

@prashantkhoje
Copy link
Author

@otan, fyi

@prashantkhoje
Copy link
Author

@ambujkumar3 fyi

@rsned
Copy link
Collaborator

rsned commented Apr 21, 2023

Can you see if this still occurs with the latest updates.

@prashantkhoje
Copy link
Author

Yes. Cockroachdb still encounters FMA failures with the latest golang/geo.
The changes proposed here fixes the deviation.

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.

2 participants