After the first target works, use these guides to choose bounds, interpret status output, retain useful inputs, investigate unstable failures, and prepare longer searches. The same commands run every target, including those made from a Model. The internals chapter covers the embedded engine and its raw interface.

Tune a run§

Give every new target a short, bounded smoke run before a long campaign:

TARGET run \
  --time=60 \
  --max-input-size=4096 \
  --timeout=5 \
  --memory-limit=2048 \
  --print-final-stats

The most useful limits are:

OptionMeaningStarting point
--time=NStop after N seconds; 0 is unbounded.Defaults to 60.
--runs=NStop after N attempted inputs.Useful for repeatable CI checks.
--max-input-size=NLimit corpus input bytes, including framing, for entropy and encoded values.Start small and raise only when needed.
--timeout=NTreat one input taking longer than N seconds as a failure.A few seconds for a normally fast target.
--memory-limit=NStop when the process exceeds this many MB.Set from the expected working set.
--dictionary=FILEAdd important byte tokens to mutations.Useful for text or binary formats.
--seed=NSelect the engine’s random seed.Useful for repeating a campaign with the same runner build and configuration.
--print-final-statsPrint final execution and resource counters.Useful in CI and smoke tests.

--max-input-size bounds the binary input, not necessarily every typed list or string it produces. Generators control search bias; encoded examples and their mutations bypass them. Enforce domain and resource limits in property preconditions or validated input types for both forms, and return Fuzz.reject before an operation becomes too expensive. Generator bounds help the entropy path reach those valid values efficiently.

Do not confuse the campaign seed with a saved input. Different engine builds, coverage layouts, or configurations may generate different mutation sequences from --seed. Reproduce a failure with its saved artifact and replay, not with the campaign seed alone.

The captured run.log contains libFuzzer’s compact status fields:

Coverage growth shows that the fuzzer is exploring. A plateau is a reason to inspect the target, generator, seeds, and dictionary, not proof that the code has no bugs. Very low exec/s, steadily growing rss, or repeated timeouts usually calls for a narrower target or tighter bounds.

Maintain a corpus§

A corpus is a collection of small binary inputs that collectively reach useful code. It is not a directory of every attempted input. Use a stable corpus directory across campaigns:

TARGET run quality/corpus/my-target --time=3600 --max-input-size=4096

Declare a few small Fuzz.example values that reach meaningfully different behavior; they become encoded corpus seeds that the fuzzer can mutate. Use Fuzz.saved for original entropy or encoded witnesses. Both forms reach the same property, and their binary bytes need not resemble the value printed by show. Check manually created seeds with the target executable.

Reduce a large corpus into a new, initially empty directory while preserving coverage:

TARGET reduce-corpus quality/corpus/my-target quality/corpus/my-target-small

For a target with goals, the reduced corpus still holds an input for every goal the original reached.

Keep valuable seeds and fixed crash inputs with the target in version control. Use a deliberate directory such as fuzz/corpus/<target>/, document why each seed matters, and replay it in tests. Generated .roc-fuzz/ directories are ignored at every depth; keep evolving campaign corpora in local storage or CI caches, and preserve findings as CI artifacts until reduced to regressions. Run them after code changes so the target does not silently stop compiling or exercising the intended behavior.

Dictionaries are most effective when recognizable bytes flow fairly directly into a parser. They may help less when a structural generator heavily transforms the raw input.

Changing a generator can change the typed values produced by entropy witnesses. Encoded witnesses use the format parser instead. Keep the relevant generator, parser and input type stable when practical, and use show to check saved inputs after a change. Preserve original bytes when storage shape matters.

Diagnose an unstable failure§

Always replay a saved failure in a fresh process. If it does not reproduce, investigate:

Treat the failure as actionable once its conditions are understood and, ideally, it reproduces from a clean process.

Know what counts as a failure§

Coverage feedback tells the engine which inputs explore new behavior; it does not tell the runner whether a result is correct. The property in the target is the correctness oracle.

roc-fuzz saves explicit Roc crash and failed expect calls, per-input timeouts, and process memory-limit failures. A wrong answer that does not break the target’s property is invisible to the fuzzer, which is why choosing a strong property matters more than simply calling the function under test.

Prepare a long campaign§

Before committing substantial CPU time, check that:

Command reference§

CommandBehavior
TARGET or TARGET run [CORPUS] [OPTIONS]Check examples and baseline, then explore, with one report.
TARGET check [OPTIONS]Run each declared example once in a fresh process and compare the baseline.
TARGET accept [OPTIONS]Explicitly accept the complete valid allocation observations.
TARGET explore [CORPUS] [OPTIONS]Run coverage-guided exploration independently.
TARGET examplesList names, revisions and input digests.
TARGET show INPUTDisplay the decoded representative.
TARGET replay INPUT [--detailed]Reproduce one input under the supervisor.
TARGET measure INPUTPrint one input’s named allocation observations as JSON.
TARGET retain INPUT --name NAME --output DIRKeep original bytes and print a source declaration.
TARGET minimize INPUT OUTPUT [OPTIONS]Minimize a reproducing finding within the campaign budget.
TARGET reduce-corpus INPUT OUTPUTRetain coverage-relevant inputs in OUTPUT.
TARGET raw ...Advanced libFuzzer controls.

Friendly execution options include:

OptionMeaning
--time=NExploration budget in seconds; default 60, 0 unbounded.
--runs=NExploration execution bound.
--timeout=NInvocation deadline in seconds; default 10.
--max-input-size=NBound corpus input bytes, from 1 byte through 2 MiB.
--memory-limit=NExploration process RSS limit in MiB.
--dictionary=FILEMutation tokens.
--seed=NExploration random seed; retain input bytes for reproduction.
--report-dir=DIRAbsent or empty destination for the complete report.
--baseline=PATHOverride <declared-target-name>_baseline.json.
--profile=NAMESelect the named baseline profile.
--detailedCapture a detailed logical trace for replay.
--no-detect-leaksDisable the broader invocation leak check.
--allow-unreached-goalsReport unreached goals without making the campaign inconclusive.

Provenance options are --source-revision, --roc-version, --platform-release and --platform-sha256, each supplied as --name=value. See Read the evidence for the report these options are recorded in, and Accept an exact allocation baseline for --baseline and --profile.

Minimization and corpus reduction accept --time, --runs, --timeout and --report-dir. They default to a 60-second campaign budget and require a positive --time; unbounded exploration remains available with run --time=0 or explore --time=0. A successful minimization writes the best witness, including the unchanged original if no reduction was found. Failed minimization preserves an existing output. Corpus reduction requires an absent or empty output directory that does not overlap the input directory.