hypervolume: fix flaky floating point comparisons tests - #627
Open
jschueller wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
/cc @darioizzo |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
assertContribs() still compares hv.contributions(ref) to answers with exact vector equality in all three configurations. Those values are computed doubles, so the same platform-dependent rounding this PR is fixing can still fail here. Compare the contribution vectors elementwise with the same tolerance and add a regression that exercises this helper.
jschueller
added a commit
to jschueller/pagmo2
that referenced
this pull request
Sep 3, 2026
…d regression Fix remaining exact vector equality checks for hv.contributions(ref) identified in review of PR esa#627. Contributions are computed doubles subject to platform-dependent rounding, so compare elementwise with BOOST_CHECK_SMALL using 1e-12 tolerance in all three configurations (copy true/false and set_copy_points false), consistent with the exclusive checks. Also update remaining exact checks (hv2d, fake algo) to use tolerance. Add hypervolume_contributions_tolerance_regression_test that exercises assertContribs with fractional points and a small perturbation that would fail with exact equality but passes with tolerance.
Replace equality checks (==) with BOOST_CHECK_SMALL using a 1e-12 tolerance for computed double values throughout the hypervolume test suite, fixing test failures on platforms with differing floating point precision. Closes esa#516
Contributor
Author
|
@sylvesterkaczmarek done |
sylvesterkaczmarek
approved these changes
Sep 6, 2026
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
assertContribs() now compares every contribution/exclusive value elementwise with tolerance in all copy/no-copy configurations instead of relying on exact vector equality. That addresses the platform-rounding failure I raised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace equality checks (==) with BOOST_CHECK_SMALL using a 1e-12 tolerance for computed double values throughout the hypervolume test suite, fixing test failures on platforms with differing floating point precision.
Closes #516