Improve efficiency of mutator by allowing Copy/Clone only in CrossOver
That's very libFuzzer specific tweek
libFuzzer calls LLVMFuzzerCustomMutator and LLVMFuzzerCustomCrossOver
with same probability. However LLVMFuzzerCustomCrossOver is
just a variation of Copy/Clone. So before the patch all mutator activity
was more skewed toward Copy/Clone.
This results in 2x increases in new feature discovery per iteration.
diff --git a/src/mutator.cc b/src/mutator.cc
index 6866b50..0459ab3 100644
--- a/src/mutator.cc
+++ b/src/mutator.cc
@@ -684,6 +684,8 @@
mutations[static_cast<size_t>(Mutation::Delete)] = true;
} else {
mutations.set();
+ mutations[static_cast<size_t>(Mutation::Copy)] = false;
+ mutations[static_cast<size_t>(Mutation::Clone)] = false;
}
while (mutations.any()) {
MutationSampler mutation(keep_initialized_, mutations, &random_);