I noticed this while reading, so it is possible I'm missing something.
In buildBianryFuse, there is:
for _, key := range keys {
hash := mixsplit(key, filter.Seed)
segment_index := hash >> (64 - blockBits)
for reverseOrder[startPos[segment_index]] != 0 {
segment_index++
segment_index &= (1 << blockBits) - 1
}
reverseOrder[startPos[segment_index]] = hash
startPos[segment_index] += 1
}
so if reverseOrder[startPos[segment_index]] == 0 the slot is considered empty and is filled with the hash. But it seems that mixsplit(key, filter.Seed) can return zero, which would mark the slot as empty again.
A work around would be to not allow zero as a hash value or use a different reserved sentinel, or the code would need a sidecar "slot is empty" array.
I noticed this while reading, so it is possible I'm missing something.
In buildBianryFuse, there is:
so if
reverseOrder[startPos[segment_index]] == 0the slot is considered empty and is filled with the hash. But it seems thatmixsplit(key, filter.Seed)can return zero, which would mark the slot as empty again.A work around would be to not allow zero as a hash value or use a different reserved sentinel, or the code would need a sidecar "slot is empty" array.