Skip to content

[FIX] gpu approx nearest unit test#6452

Open
chunibyo-wly wants to merge 1 commit into
PointCloudLibrary:masterfrom
chunibyo-wly:gputest
Open

[FIX] gpu approx nearest unit test#6452
chunibyo-wly wants to merge 1 commit into
PointCloudLibrary:masterfrom
chunibyo-wly:gputest

Conversation

@chunibyo-wly

Copy link
Copy Markdown
Contributor

This unit test failed due the precision.
The error log

/home/chunibyo/workspace/osc/pcl/test/gpu/octree/test_approx_nearest.cpp:129: Failure
Expected equality of these values:
  dists_pcl[i]
    Which is: 0.03
  dists_gpu[i]
    Which is: 0.03
[  FAILED  ] PCL_OctreeGPU.approxNearesSearch 

And we can see their binary representations are

00111100111101011100001010010111 (0.030000014)
00111100111101011100001010010110 (0.030000012)

Copilot AI review requested due to automatic review settings July 13, 2026 14:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a flaky/incorrect GPU octree unit test by comparing floating-point squared distances using a float-aware assertion rather than exact bitwise equality, addressing small ULP-level differences between CPU and GPU computations.

Changes:

  • Replace ASSERT_EQ with ASSERT_FLOAT_EQ when comparing std::vector<float> distance results between CPU and GPU host paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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