Skip to content

Commit 440cdba

Browse files
committed
capacity fencepost
1 parent 3408521 commit 440cdba

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/sketch/sketch_columns.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ class FixedSizeSketchColumn {
4444
return static_cast<uint8_t>(1 + ceil(log2(num_edges)));
4545
}
4646

47-
[[deprecated]]
48-
4947
void reset_sample_state() {
5048
//no-op
5149
};

src/sketch_columns.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void FixedSizeSketchColumn::merge(FixedSizeSketchColumn &other) {
5959

6060
void FixedSizeSketchColumn::update(const vec_t update) {
6161
vec_hash_t checksum = Bucket_Boruvka::get_index_hash(update, seed);
62-
col_hash_t depth = Bucket_Boruvka::get_index_depth(update, seed, col_idx, capacity);
62+
col_hash_t depth = Bucket_Boruvka::get_index_depth(update, seed, col_idx, capacity-1);
6363
assert(depth < capacity);
6464
buckets[depth] ^= {update, checksum};
6565
deterministic_bucket ^= {update, checksum};
@@ -126,7 +126,7 @@ void ResizeableSketchColumn::update(const vec_t update) {
126126
// TODO - remove magic number
127127
// TODO - get_index_depth needs to be fixed. hashes need to be longer
128128
// than 32 bits if we're not using the deep bucket buffer idea.
129-
col_hash_t depth = Bucket_Boruvka::get_index_depth(update, seed, col_idx, 32);
129+
col_hash_t depth = Bucket_Boruvka::get_index_depth(update, seed, col_idx, 60);
130130
deterministic_bucket ^= {update, checksum};
131131

132132
while (depth >= capacity) {

0 commit comments

Comments
 (0)