Skip to content

[FIX] gpu approx nearest unit test#6452

Merged
mvieth merged 1 commit into
PointCloudLibrary:masterfrom
chunibyo-wly:gputest
Jul 16, 2026
Merged

[FIX] gpu approx nearest unit test#6452
mvieth merged 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.

@mvieth mvieth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@mvieth mvieth added module: gpu changelog: fix Meta-information for changelog generation module: test labels Jul 16, 2026
@mvieth
mvieth merged commit a35cfbc into PointCloudLibrary:master Jul 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: fix Meta-information for changelog generation module: gpu module: test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants