Skip to content

Commit d64827b

Browse files
author
Samuel Groß
committed
Shuffle corpus on import
This way, we avoid creating an artificial bias due to the ordering of samples in the imported corpus. See the added comment for more details.
1 parent bf0ac48 commit d64827b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/Fuzzilli/Fuzzer.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,13 @@ public class Fuzzer {
597597
return
598598
}
599599

600-
currentCorpusImportJob = CorpusImportJob(corpus: corpus, mode: importMode)
600+
// In the default corpus import mode (where we only keep interesting samples), the order
601+
// of imported programs matters as earlier samples may cause later samples to not be
602+
// added to the corpus (because they no longer add any new coverage). To not create an
603+
// artifical bias due to the order/filenames, we shuffle the corpus here.
604+
let shuffledCorpus = corpus.shuffled()
605+
606+
currentCorpusImportJob = CorpusImportJob(corpus: shuffledCorpus, mode: importMode)
601607
changeState(to: .corpusImport)
602608
}
603609

0 commit comments

Comments
 (0)