[PATCH] D49621: [libFuzzer] Initial implementation of weighted mutation leveraging during runtime.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 2 14:15:21 PDT 2018


morehouse added inline comments.


================
Comment at: lib/fuzzer/FuzzerMutate.cpp:601
+  double SumOfStats = std::accumulate(Stats.begin(), Stats.end(), 0.0);
+  if (!SumOfStats) return;
+  Distribution = std::discrete_distribution<size_t>(Stats.begin(), Stats.end());
----------------
Dor1s wrote:
> morehouse wrote:
> > `SumOfStats` doesn't need to be calculated.
> Matt, we needed `SumOfStats` to be non zero to ensure that we have at least some distribution. Until that moment is reached, we should be using the initial weights. I like this simplification though, but in that case we'll have to initialize `UsefulCount` with `1`, so that initial `Stats` will be `1 / 1` for every mutation.
Either approach SGTM.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49621





More information about the llvm-commits mailing list