diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-03-20 21:00:39 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-03-25 13:12:00 +0000 |
| commit | f85e28d8a74848f34bdfb105079245c3d38ff9ae (patch) | |
| tree | 4c03dec2a7aaf4238c007ca826b1c4f9b4658c49 /pkg/fuzzer/fuzzer.go | |
| parent | 409ee912f2c4f07e3064b4e6f4a83e1f812531d8 (diff) | |
pkg/fuzzer: implement basic max signal rotation
Once in 15 minutes, drop 1000 elements of the pure max signal (that is,
max signal minus corpus signal).
It seems to have a positive effect on the total fuzzing performance.
Diffstat (limited to 'pkg/fuzzer/fuzzer.go')
| -rw-r--r-- | pkg/fuzzer/fuzzer.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/fuzzer/fuzzer.go b/pkg/fuzzer/fuzzer.go index 14c3f5902..8ce2ebe26 100644 --- a/pkg/fuzzer/fuzzer.go +++ b/pkg/fuzzer/fuzzer.go @@ -323,3 +323,15 @@ func (fuzzer *Fuzzer) logCurrentStats() { fuzzer.Logf(0, "%s", str) } } + +func (fuzzer *Fuzzer) RotateMaxSignal(items int) { + corpusSignal := fuzzer.Config.Corpus.Signal() + pureMaxSignal := fuzzer.Cover.pureMaxSignal(corpusSignal) + if pureMaxSignal.Len() < items { + items = pureMaxSignal.Len() + } + fuzzer.Logf(1, "rotate %d max signal elements", items) + + delta := pureMaxSignal.RandomSubset(fuzzer.rand(), items) + fuzzer.Cover.subtract(delta) +} |
