Shrinking violations #

When Bombadil finds a violation, the trace leading up to it is often long and full of actions that have nothing to do with the bug. The shrink command takes such a trace and searches for a shorter one that still violates the same property.

Shrinking is experimental. The command-line options and output format may change between releases.

bombadil terminal shrink --trace my-test your-cli

It’s important that the shrink invocation uses the same options as the original test or fuzz invocation, just as when reproducing violations.

Shrinking begins with a calibration phase that tries to assess the flakiness of reproducing the violation. Calibration can be controlled with --calibration-runs and --confirmation-runs-max if needed. At the end of shrinking, you get a new trace file, configured with --output-path and --output-path-overwrite, that can be reproduced or inspected.

Trace inputs are always files, never directories. For a single test or shrink, --output-path names the actual trace file and accepts any filename; its parent directory must already exist. Without it, Bombadil chooses a unique file in system temp. For fuzz, the option is a file base: run.bin writes sibling files run-0.bin, run-1.bin, and so on, without per-run directories. Browser downloads use a separate temporary directory logged before the run and removed afterwards. Shrinking permits a sibling output but rejects an input alias, including symbolic links and hard links. Use --output-path-overwrite to replace an existing file.