Skip to content

Prune unnecessary transaction sequences from corpus#625

Merged
anishnaik merged 13 commits intomasterfrom
prune-sequences
May 20, 2025
Merged

Prune unnecessary transaction sequences from corpus#625
anishnaik merged 13 commits intomasterfrom
prune-sequences

Conversation

@samalws-tob
Copy link
Copy Markdown
Contributor

@samalws-tob samalws-tob commented Apr 29, 2025

This PR adds a job which runs once a minute that prunes unnecessary txn sequences from the corpus. It removes sequences that no longer contribute any new coverage compared to the rest. This can happen when, for example, sequence A adds new coverage, sequence B builds upon sequence A and adds strictly more coverage, making sequence A now unnecessary since it doesn't "contribute anything" to the corpus.
The job works by:

  • Shuffle the corpus
  • Initialize a blank coverage map
  • Run through the corpus one-by-one. For each sequence, run the sequence and add coverage to the coverage map. If there is no new coverage, we can remove this sequence from the corpus

The job takes about 5-10 seconds, during which time no fuzzing at all can occur

This seems to be pretty effective at reducing corpus size. In a small test I've been running, it's been removing about 100 entries per minute during the initial phase of fuzzing where the corpus quickly grows to 1000 entries (first 5 minutes) and has now slowed down to removing about 50 entries per minute (15 minutes in, corpus size 1400). Corpus growth is slow at this phase because of pruning; the corpus would probably have 2000-2500 entries by now (rather than 1400) if not for pruning.

@samalws-tob samalws-tob force-pushed the prune-sequences branch 6 times, most recently from 61ff5c4 to 0761cce Compare May 2, 2025 17:41
@samalws-tob samalws-tob marked this pull request as ready for review May 5, 2025 13:08
@anishnaik anishnaik merged commit a9c00cb into master May 20, 2025
16 of 20 checks passed
@anishnaik anishnaik deleted the prune-sequences branch May 20, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants