[PATCH] D105284: Greedy set cover implementation of `Merger::Merge`

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 17:38:18 PDT 2021


morehouse added a comment.

I understand that this merge algorithm decreases the number of inputs by taking the most feature-rich inputs first.   Does this lead to larger average input sizes in the merged corpus?

And what's the effect on total corpus bytes (`du -hs`)?



================
Comment at: compiler-rt/lib/fuzzer/FuzzerMerge.cpp:198
 }
 
+size_t Merger::MergeGreedy(const Set<uint32_t> &InitialFeatures,
----------------
Please document the merge algorithm in a function comment here.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerMerge.cpp:233
+              return a.Features.size() > b.Features.size();
+            });
+
----------------
Given the multiple passes over `Remaining`, is this sort useful anymore?


================
Comment at: compiler-rt/lib/fuzzer/FuzzerMerge.cpp:317
+      Remaining.erase(std::remove(Remaining.begin(), Remaining.end(), i),
+                      Remaining.end());
+    }
----------------
Would a set be a better data structure for `Remaining`?  Then we wouldn't need to do a linear lookup on every erase.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105284/new/

https://reviews.llvm.org/D105284



More information about the llvm-commits mailing list