Skip to content

Commit 0aecbff

Browse files
fix another rare edge case
1 parent e3a299b commit 0aecbff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

heuristics.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ class coarsen_heuristics {
381381
if(is_uniform || g.values(j) == max_ewt){
382382
uint32_t v = g.graph.entries(j);
383383
uint32_t tiebreaker = xorshiftHash<uint32_t>(v + r);
384+
// >= since 0 must be a valid max val
384385
if(tiebreaker >= local.val){
385386
local.val = tiebreaker;
386387
local.loc = j;
@@ -417,7 +418,8 @@ class coarsen_heuristics {
417418
tiebreaker = xorshiftHash<uint32_t>(v + r);
418419
} else if(is_uniform || max_ewt == g.values(j)){
419420
uint32_t sim_wgt = xorshiftHash<uint32_t>(v + r);
420-
if(tiebreaker < sim_wgt){
421+
// >= since 0 must be a valid max tiebreaker
422+
if(sim_wgt >= tiebreaker){
421423
h = v;
422424
tiebreaker = sim_wgt;
423425
}

0 commit comments

Comments
 (0)