public sealed class CorpusThe inputs worth keeping for one target.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Kept for producing a behaviour nothing before it produced, which is the whole of the guidance here — see Run for what that signature is and what it is not. An input that decodes exactly as far as the last thousand did adds nothing to work from, and a corpus that keeps everything is a corpus the mutator picks uselessly out of.
The on-disk half is for regressions, not for growth. A crashing input is written next to the code and committed, and every later build replays it before it fuzzes anything — so a defect that was found once is a test from then on, which is the difference between fuzzing and having fuzzed. The grown corpus is deliberately *not* persisted: it would be a large binary directory whose contents depend on the machine that produced it, and the seeds plus a fixed generator seed reproduce a run without it.
Fields and properties (5)
public const int MaxEntriesHow many inputs are kept before new ones start replacing old ones.
public const int MaxSignaturesHow many distinct behaviours are remembered before novelty stops being tracked.
public int CountHow many inputs are held.
public int SignatureCountHow many distinct behaviours have been seen.
public IReadOnlyList<byte[]> EntriesThe inputs, in the order they were kept.
Methods (7)
public bool Offer(byte[] input, long signature)Adds an input if its behaviour is one not seen before.
public void Protect()Marks everything added so far as never to be evicted.
public void Add(byte[] input)Adds an input regardless of whether it is novel, for seeds and regressions.
public byte[] Pick(ulong index)Picks one, by index modulo how many there are.
public static IReadOnlyList<byte[]> ReadRegressions(string directory, string target)Reads the committed regression inputs for a target.
public static string WriteRegression(string directory, string target, byte[] input)Writes an input that failed, so it is replayed on every later build.
public static ulong Fingerprint(ReadOnlySpan<byte> input)A stable 64-bit name for a run of bytes.
Used by (3)
- FuzzFindingVixen.Net.Fuzz
- FuzzGateTestsVixen.Net.Fuzz.Tests
- FuzzSessionVixen.Net.Fuzz