Always guess position with a chance. This match the function name and the behavior of other engines. PiperOrigin-RevId: 936051384
diff --git a/fuzztest/internal/domains/container_mutation_helpers.h b/fuzztest/internal/domains/container_mutation_helpers.h index f17d52f..530b523 100644 --- a/fuzztest/internal/domains/container_mutation_helpers.h +++ b/fuzztest/internal/domains/container_mutation_helpers.h
@@ -101,7 +101,8 @@ inline size_t GetOrGuessPositionHint(std::optional<size_t> position_hint, size_t max, absl::BitGenRef prng) { - if (position_hint.has_value()) { + if (position_hint.has_value() && *position_hint <= max && + absl::Bernoulli(prng, 0.5)) { return *position_hint; } else { return ChooseOffset(max + 1, prng);