Skip to content

Commit

Permalink
Fixing intermittent HBDSCAN pytest failure in CI (rapidsai#4025)
Browse files Browse the repository at this point in the history
There was an OOB access occurring here https://github.com/rapidsai/cuml/blob/0707a46f717023ca0b5047c3aeee9ead1a093272/cpp/src/hdbscan/runner.h#L74 when `b.key == 1`. This error was getting swallowed up and we were seeing those `thrust::transform` errors in CI.

Tagging @cjnolet to confirm if this is the intended way to use this functor and the fix is correct.

Authors:
  - Divye Gala (https://github.com/divyegala)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: rapidsai#4025
  • Loading branch information
divyegala authored Jul 6, 2021
1 parent 041a7fc commit 232625e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cpp/src/hdbscan/runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ struct FixConnectivitiesRedOp {
if (rit < m && a.key > -1 && colors[rit] != colors[a.key]) {
value_t core_dist_rit = core_dists[rit];
value_t core_dist_a = max(core_dist_rit, max(core_dists[a.key], a.value));
value_t core_dist_b = max(core_dist_rit, max(core_dists[b.key], b.value));

value_t core_dist_b;
if (b.key > -1) {
core_dist_b = max(core_dist_rit, max(core_dists[b.key], b.value));
} else {
core_dist_b = b.value;
}

return core_dist_a < core_dist_b ? KVP(a.key, core_dist_a)
: KVP(b.key, core_dist_b);
Expand Down

0 comments on commit 232625e

Please sign in to comment.