Rollback debug assertion that the probe sequence isn't excessively long.
PiperOrigin-RevId: 775667341
Change-Id: I6e69839a0d1c007da6c4639816180967addfc96e
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index cbcce8d..94a3249 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -3016,14 +3016,13 @@
absl::PrefetchToLocalCache(slot_array() + seq.offset());
#endif
Group g{ctrl + seq.offset()};
- // TODO(b/424834054): assert that Match doesn't have too many collisions.
for (uint32_t i : g.Match(h2)) {
if (ABSL_PREDICT_TRUE(equal_to(key, slot_array() + seq.offset(i))))
return iterator_at(seq.offset(i));
}
if (ABSL_PREDICT_TRUE(g.MaskEmpty())) return end();
seq.next();
- AssertOnProbe(seq);
+ ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity() && "full table!");
}
}
@@ -3281,7 +3280,6 @@
absl::PrefetchToLocalCache(slot_array() + seq.offset());
#endif
Group g{ctrl + seq.offset()};
- // TODO(b/424834054): assert that Match doesn't have too many collisions.
for (uint32_t i : g.Match(h2)) {
if (ABSL_PREDICT_TRUE(equal_to(key, slot_array() + seq.offset(i))))
return {iterator_at(seq.offset(i)), false};
@@ -3300,7 +3298,7 @@
return {iterator_at(index), true};
}
seq.next();
- AssertOnProbe(seq);
+ ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity() && "full table!");
}
}
@@ -3382,19 +3380,6 @@
IterateOverFullSlots(common(), sizeof(slot_type), assert_consistent);
}
- void AssertOnProbe([[maybe_unused]] const probe_seq<Group::kWidth>& seq) {
- // TODO(b/424834054): investigate and see if we can remove the deleted
- // elements condition.
- ABSL_SWISSTABLE_ASSERT(
- (seq.index() <= 256 || seq.index() <= capacity() / 2 ||
- !common().growth_info().HasNoDeleted()) &&
- "The hash function has low entropy. If the hash function is not "
- "absl::Hash, please replace it with absl::Hash. If you're already "
- "using absl::Hash, please ensure you're following best practices in "
- "go/absl-hash and if so, then report a bug to abseil (go/absl-bug).");
- ABSL_SWISSTABLE_ASSERT(seq.index() <= capacity() && "full table!");
- }
-
// Attempts to find `key` in the table; if it isn't found, returns an iterator
// where the value can be inserted into, with the control byte already set to
// `key`'s H2. Returns a bool indicating whether an insertion can take place.
diff --git a/absl/hash/hash_test.cc b/absl/hash/hash_test.cc
index 0ad78b6..0ad92cf 100644
--- a/absl/hash/hash_test.cc
+++ b/absl/hash/hash_test.cc
@@ -1258,10 +1258,6 @@
// Test that for each pair of adjacent bytes in a string, if there's only
// entropy in those two bytes, then we don't have excessive collisions.
TEST(SwisstableCollisions, LowEntropyStrings) {
-#if defined(__GNUC__) && !defined(__clang__)
- // TODO(b/424834054): make this test pass on GCC.
- GTEST_SKIP() << "Test fails on GCC";
-#endif
if (sizeof(size_t) < 8) {
// TODO(b/424834054): make this test pass on 32-bit platforms. We need to
// make 32-bit Mix() stronger.