Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions centipede/centipede.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,19 +627,25 @@ void Centipede::Rerun(std::vector<ByteArray> &to_rerun) {
auto features_file = DefaultBlobFileWriterFactory(env_.riegeli);
FUZZTEST_CHECK_OK(features_file->Open(features_file_path, "a"));

FUZZTEST_LOG(INFO) << to_rerun.size() << " inputs to rerun";
const int num_attempts = std::max(1, env_.replay_coverage_attempts);
FUZZTEST_LOG(INFO) << to_rerun.size() << " inputs to rerun across "
<< num_attempts << " attempt(s)";
// Re-run all inputs for which we don't know their features.
// Run in batches of at most env_.batch_size inputs each.
while (!to_rerun.empty()) {
for (int attempt = 0; attempt < num_attempts; ++attempt) {
if (stop_condition_.ShouldStop()) break;
size_t batch_size = std::min(to_rerun.size(), env_.batch_size);
if (RunBatch(
InputsToMutantRefs({to_rerun.end() - batch_size, to_rerun.end()}),
nullptr, nullptr, features_file.get())) {
UpdateAndMaybeLogStats("rerun-old", 1);
BlobFileWriter* writer = (attempt == 0) ? features_file.get() : nullptr;
for (size_t i = 0; i < to_rerun.size(); i += env_.batch_size) {
if (stop_condition_.ShouldStop()) break;
const size_t batch_size = std::min(to_rerun.size() - i, env_.batch_size);
if (RunBatch(InputsToMutantRefs({to_rerun.begin() + i,
to_rerun.begin() + i + batch_size}),
nullptr, nullptr, writer)) {
UpdateAndMaybeLogStats("rerun-old", 1);
}
}
to_rerun.resize(to_rerun.size() - batch_size);
}
to_rerun.clear();
}

void Centipede::GenerateCoverageReport(std::string_view filename_annotation,
Expand Down
2 changes: 2 additions & 0 deletions centipede/centipede_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -530,3 +530,5 @@ CENTIPEDE_FLAG(
size_t, replay_crash_attempts, 1,
"Number of attempts to replay a crash input during batch failure triage "
"or deduplication before considering it non-reproducible.")
CENTIPEDE_FLAG(int, replay_coverage_attempts, 1,
"Number of attempts to replay coverage/corpus inputs.")
Loading