Add semantic tests for extrema algorithms with repeated values#6684
Add semantic tests for extrema algorithms with repeated values#6684harith-hacky03 wants to merge 2 commits intoTheHPXProject:masterfrom
Conversation
5ab364e to
2b53e19
Compare
|
Can one of the admins verify this patch? |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
74b5949 to
9f2fae4
Compare
| #include <hpx/algorithm.hpp> | ||
| #include <hpx/init.hpp> | ||
| #include <hpx/modules/testing.hpp> | ||
| #include <hpx/parallel/algorithms/max_element.hpp> |
There was a problem hiding this comment.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>?
| #include <hpx/algorithm.hpp> | ||
| #include <hpx/init.hpp> | ||
| #include <hpx/modules/testing.hpp> | ||
| #include <hpx/parallel/algorithms/min_element.hpp> |
There was a problem hiding this comment.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>?
| #include <hpx/algorithm.hpp> | ||
| #include <hpx/init.hpp> | ||
| #include <hpx/modules/testing.hpp> | ||
| #include <hpx/parallel/algorithms/minmax_element.hpp> |
There was a problem hiding this comment.
Isn't this header file #included implicitly by <hpx/algorithm.hpp>?
20f30ea to
b98e3ea
Compare
|
@harith-hacky03 please fix the compilation errors reported by the CI, i.e., https://app.circleci.com/pipelines/github/STEllAR-GROUP/hpx/17952/workflows/4f8c9bf6-3bd8-4f14-accb-5fade86d40fa/jobs/404643 |
3581f34 to
a01e4e1
Compare
|
@hkaiser What's the expected behaviour of max_element if i have multiple max elements? |
See: https://en.cppreference.com/w/cpp/algorithm/max_element
|
|
@harith-hacky03 please squash your commits and also remove all unrelated changes from this PR. |
2b59d9b to
8cdb1d5
Compare
|
@hkaiser Don't know why am i getting those commits |
…t, max_element, and minmax_element Signed-off-by: harith-hacky03 <harithhacky3@gmail.com>
1800813 to
ea79800
Compare
…t, max_element, and minmax_element Signed-off-by: harith-hacky03 <harithhacky3@gmail.com>
ea79800 to
9755e1a
Compare
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
| element_type curr_max_value = | ||
| HPX_INVOKE(proj, *curr->max); | ||
| if (!HPX_INVOKE(f, curr_max_value, max_value)) | ||
| if (HPX_INVOKE(f, curr_max_value, max_value)) |
There was a problem hiding this comment.
This is now inconsistent with your sequential implementation above (same for the change below). Which version is correct?
|
@harith-hacky03 ping? |
…extrema algorithms - Added random_repeat utility for duplicate testing - Updated extrema algorithm tests to use random_repeat - Fixed sentinel test failures by injecting unique values - Supersedes TheHPXProject#6684 and TheHPXProject#6724 Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
…extrema algorithms - Added random_repeat utility for duplicate testing - Updated extrema algorithm tests to use random_repeat - Fixed sentinel test failures by injecting unique values - Supersedes TheHPXProject#6684 and TheHPXProject#6724 Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
…extrema algorithms - Added random_repeat utility for duplicate testing - Updated extrema algorithm tests to use random_repeat - Fixed sentinel test failures by injecting unique values - Supersedes TheHPXProject#6684 and TheHPXProject#6724 Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
…extrema algorithms - Added random_repeat utility for duplicate testing - Updated extrema algorithm tests to use random_repeat - Fixed sentinel test failures by injecting unique values - Supersedes TheHPXProject#6684 and TheHPXProject#6724 Signed-off-by: Dhyann Olemmyan <olemmyandhyan@gmail.com>
Fixes #6627
Proposed Changes
Any background context you want to provide?
The existing tests for extrema algorithms did not cover the important semantic behavior when dealing with repeated values. These new tests ensure that the algorithms maintain their expected behavior across different execution policies and comparison functions.
Checklist