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 - pkg/geo - TestBoundingBoxFromGeomT - Test failures due to floating point differences #81733

Closed
prashantkhoje opened this issue May 24, 2022 · 3 comments · Fixed by #81734
Labels
A-spatial Spatial work that is *not* related to builtins. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-disaster-recovery T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner

Comments

@prashantkhoje
Copy link
Contributor

prashantkhoje commented May 24, 2022

Describe the problem

I built the latest (Latest commit 48e48db) cockroachdb from master branch.
When tests are run, tests for pkg/geo fail due to floating point precision differences.

Log of failed test cases

=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.LineString{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2},_srid:4326}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.01745329251994285, HiY:0.03490658503988703}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.017453292519942848, HiY:0.03490658503988703}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.03490658503988659,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.03490658503988703
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.LineString{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2},_srid:4326}}}
=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1},_srid:0}},_ends:[]int{8}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.01745329251994285, HiY:0.03490791314678354}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.017453292519942848, HiY:0.03490791314678354}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.03490658503988659,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.03490791314678354
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1},_srid:0}},_ends:[]int{8}}}
=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_1,_2,_2,_2,_1,_1},_srid:0}},_ends:[]int{8}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.01745329251994285, HiY:0.03490791314678354}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.017453292519942848, HiY:0.03490791314678354}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.03490658503988659,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.03490791314678354
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_1,_2,_2,_2,_1,_1},_srid:0}},_ends:[]int{8}}}
=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.01745329251994285, HiY:0.06981317007977363}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.017453292519942848, HiY:0.06981317007977363}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.06981317007977318,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.06981317007977363
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}}
=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiPolygon{geom3:geom.geom3{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1,_3,_3,_4,_4,_3,_4,_3,_3},_srid:0}},_endss:[][]int{[]int{8},_[]int{16}}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.01745329251994285, HiY:0.06981581982279463}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.017453292519942848, HiY:0.06981581982279463}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.06981317007977318,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.06981581982279463
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiPolygon{geom3:geom.geom3{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1,_3,_3,_4,_4,_3,_4,_3,_3},_srid:0}},_endss:[][]int{[]int{8},_[]int{16}}}}
=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.GeometryCollection{layout:0,_geoms:[]geom.T{(*geom.LineString)(0xc000159830),_(*geom.Point)(0xc000159710)},_srid:0}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.01745329251994285, HiY:0.03490658503988703}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.03490658503988659, LoY:0.017453292519942848, HiY:0.03490658503988703}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.03490658503988659,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.03490658503988703
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.GeometryCollection{layout:0,_geoms:[]geom.T{(*geom.LineString)(0xc000159830),_(*geom.Point)(0xc000159710)},_srid:0}

--- FAIL: TestBoundingBoxFromGeomT (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.LineString{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2},_srid:4326}}} (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1},_srid:0}},_ends:[]int{8}}} (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_1,_2,_2,_2,_1,_1},_srid:0}},_ends:[]int{8}}} (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}} (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiPolygon{geom3:geom.geom3{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1,_3,_3,_4,_4,_3,_4,_3,_3},_srid:0}},_endss:[][]int{[]int{8},_[]int{16}}}} (0.00s)
    --- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.GeometryCollection{layout:0,_geoms:[]geom.T{(*geom.LineString)(0xc000159830),_(*geom.Point)(0xc000159710)},_srid:0} (0.00s)

=== RUN   TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}}
    bbox_test.go:187:
                Error Trace:    bbox_test.go:187
                Error:          Not equal:
                                expected: &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.01745329251994285, HiY:0.06981317007977363}
                                actual  : &geopb.BoundingBox{LoX:0.017453292519943292, HiX:0.06981317007977318, LoY:0.017453292519942848, HiY:0.06981317007977363}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -3,3 +3,3 @@
                                  HiX: (float64) 0.06981317007977318,
                                - LoY: (float64) 0.01745329251994285,
                                + LoY: (float64) 0.017453292519942848,
                                  HiY: (float64) 0.06981317007977363
                Test:           TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}}

FAIL    github.com/cockroachdb/cockroach/pkg/geo        0.272s

To Reproduce

Build script used:

DISTRO=linux-ppc64le
GO_DISTRO=linux-ppc64le

# Install all dependencies
dnf install -y git cmake make gcc-c++ autoconf ncurses-devel libarchive curl \
wget openssl-devel diffutils procps-ng libarchive xz python2

dnf install -y \ http://rpmfind.net/linux/centos/8-stream/AppStream/ppc64le/os/Packages/bison-3.0.4-10.el8.ppc64le.rpm `
http://rpmfind.net/linux/epel/8/Everything/ppc64le/Packages/c/ccache-3.7.7-1.el8.ppc64le.rpm

cd $HOME

# Install nodejs
NODE_VERSION=v12.20.2
wget https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$DISTRO.tar.gz
tar -xzf node-$NODE_VERSION-$DISTRO.tar.gz
export PATH=$HOME/node-$NODE_VERSION-$DISTRO/bin:$PATH

npm install yarn --global

cd $HOME

# Setup go environment and install go
GOPATH=$HOME/go
GO_VERSION=1.17.8
COCKROACH_HOME=$GOPATH/src/github.com/cockroachdb
mkdir -p $COCKROACH_HOME
export GOPATH
curl -O https://dl.google.com/go/go$GO_VERSION.$GO_DISTRO.tar.gz
tar -C /usr/local -xzf go$GO_VERSION.$GO_DISTRO.tar.gz
rm -rf go$GO_VERSION.$GO_DISTRO.tar.gz
export PATH=$PATH:/usr/local/go/bin

# Clone cockroach and build
COCKROACH_VERSION=master
cd $COCKROACH_HOME
git clone https://github.com/cockroachdb/cockroach.git
cd cockroach
git checkout $COCKROACH_VERSION
make buildshort
export GOMAXPROCS=4
make test PKG=./pkg/geo TESTFLAGS='-v -count=1' GOFLAGS='-p 1' IGNORE_GOVERS=1

Expected behavior
A clear and concise description of what you expected to happen.

Additional data / screenshots
[[email protected] cockroach]# grep FAIL /build/v22/06-geo-default.txt
--- FAIL: TestBoundingBoxFromGeomT (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.LineString{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2},_srid:4326}}} (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1},_srid:0}},_ends:[]int{8}}} (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.Polygon{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_1,_2,_2,_2,_1,_1},_srid:0}},_ends:[]int{8}}} (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiLineString{geom2:geom.geom2{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_3,_3,_4,_4},_srid:0}},_ends:[]int{4,_8}}} (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.MultiPolygon{geom3:geom.geom3{geom1:geom.geom1{geom0:geom.geom0{layout:1,_stride:2,_flatCoords:[]float64{1,_1,_2,_2,_1,_2,_1,_1,_3,_3,_4,_4,_3,_4,_3,_3},_srid:0}},_endss:[][]int{[]int{8},_[]int{16}}}} (0.00s)
--- FAIL: TestBoundingBoxFromGeomT/GeographyType:_&geom.GeometryCollection{layout:0,_geoms:[]geom.T{(*geom.LineString)(0xc000159830),_(*geom.Point)(0xc000159710)},_srid:0} (0.00s)
FAIL
FAIL github.com/cockroachdb/cockroach/pkg/geo 0.272s
FAIL

Environment:

  • CockroachDB version [v22.x]
    [[email protected] cockroach]# git log -3 --oneline
    48e48db89e (HEAD -> master, origin/staging, origin/master, origin/HEAD) Merge #81681
    7ad29c34e0 colexecwindow: fix panic when lead or lag arguments are different types
    a8d4ce6cad Merge #81670 #81672
    [[email protected] cockroach]# git branch
    * master
  • Server OS: RHEL UBI 8.5
  • Go
    [[email protected] cockroach]# go version
    go version go1.17.8 linux/ppc64le
  • Node
    [[email protected] cockroach]# node --version
    v12.20.2

Additional context
We support running cockroachdb on ppc64le. We'd like to fix the failures we encounter in order to automate builds for ppc64le.

Jira issue: CRDB-16047

@prashantkhoje prashantkhoje added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label May 24, 2022
@blathers-crl
Copy link

blathers-crl bot commented May 24, 2022

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I have CC'd a few people who may be able to assist you:

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added A-disaster-recovery O-community Originated from the community X-blathers-triaged blathers was able to find an owner T-disaster-recovery labels May 24, 2022
@blathers-crl
Copy link

blathers-crl bot commented May 24, 2022

cc @cockroachdb/bulk-io

@adityamaru adityamaru added A-spatial Spatial work that is *not* related to builtins. and removed A-disaster-recovery labels May 24, 2022
@blathers-crl blathers-crl bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 24, 2022
@otan
Copy link
Contributor

otan commented May 24, 2022

see #81745 (comment)

@otan otan closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2022
craig bot pushed a commit that referenced this issue May 27, 2022
81734: ppc64le - fix test failures of TestBoundingBoxFromGeomT/GeographyType r=otan a=prashantkhoje

Allow floating point approximation within an epsilon
Fixes #81733 

81857: sql/catalog/lease: add some event logging around lease acquisition r=ajwerner a=ajwerner

Before this, there was a black hole of time when we were acquiring a lease.
The singleflight prevents tracing of the actual acquisition.

Release note: None

Co-authored-by: Prashant Khoje <[email protected]>
Co-authored-by: Prashant Khoje <[email protected]>
Co-authored-by: Andrew Werner <[email protected]>
@craig craig bot closed this as completed in #81734 May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spatial Spatial work that is *not* related to builtins. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community T-disaster-recovery T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants