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

Fix and tidy coordinate_transform_test #671

Merged

Conversation

harrism
Copy link
Member

@harrism harrism commented Sep 14, 2022

Description

Converting from EXPECT_EQ to expect_vector_equivalent (#669) caused coordinate_transform_test to fail due to floating point differences. It's strange that it passed with exact equality testing (perhaps a problem in Thrust?). In any case, this fixes the test data generation and DRYs up the tests a bit.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@harrism harrism added bug Something isn't working tests Relating to tests and test automation 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels Sep 14, 2022
@harrism harrism added this to the header-only C++ API milestone Sep 14, 2022
@harrism harrism self-assigned this Sep 14, 2022
@harrism harrism requested a review from a team as a code owner September 14, 2022 06:40
@github-actions github-actions bot added the libcuspatial Relates to the cuSpatial C++ library label Sep 14, 2022
@harrism harrism requested review from trxcllnt and thomcom and removed request for zhangjianting and jrhemstad September 14, 2022 06:41
@harrism harrism requested review from isVoid and removed request for trxcllnt September 19, 2022 23:19
Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

On a second thought:

Philosophically this alters the tests from testing against a golden answer to comparing the result between device compute and host compute. This is acceptable as source of truth only when we are certain that the host computation is correct (which is easy to verify since the kernel of coordinate_transform is very simple.

I think it would be nice in #672 we can discuss a bit about "sources of truth". Pen and paper always works and I think developers should exhaust corner cases with simple inputs first. For larger inputs I would also resort to random generated inputs/existing datasets and computes the result with a mature host counterpart, such as shapely, geopandas, arcgis, postgregis, libgeos etc.

It's also ok to include these in python testing docs too, if you think they fit more over there.


It also comes to me what happens if you compare the hardcoded value with the host computed result?

@harrism
Copy link
Member Author

harrism commented Sep 21, 2022

It also comes to me what happens if you compare the hardcoded value with the host computed result?

Indeed, I tested and the host-computed FP32 result does not match the hard-coded FP64 result. So if we want to hard-code expected values we need one per type.

@harrism
Copy link
Member Author

harrism commented Sep 21, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 04d1ca9 into rapidsai:branch-22.10 Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change tests Relating to tests and test automation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants