Quick Start

Download the archive for your operating system from the download page and unpack it. Selectivity runs as one executable. On Linux or macOS, this small example starts with four lines and keeps the one recognized by grep:

printf 'first\nTRIGGER\nthird\nfourth\n' > failing.txt
./selectivity --input failing.txt --out reduction -- grep -q TRIGGER '{input}'

Open reduction/report.html when the run finishes. The original input is copied to reduction/original and the latest accepted input is saved as reduction/reduced. The output directory must be new, its parent must exist, and it must be outside the input. Command options go before the separator. The braces are part of the placeholder, so keep them.

The command returns 0 when the behavior you want is present, 1 when it is absent, and another exit code when the input cannot be evaluated. A timeout is unresolved. This matters with crashing programs: a wrapper should recognize the particular failure you are investigating and map that result to 0. A syntax error introduced by deleting a header is a different outcome, and should usually return 125. See the predicate reference.

To reduce a directory and then the lines inside its remaining files, use a command that understands the candidate directory:

./selectivity --input config-bundle --out reduced-config \
  --lines-in-files --timeout 3s --repeats 3 --max-tests 10000 \
  -- /absolute/path/check-config '{input}'

Every observation runs in a fresh temporary directory. The placeholder becomes the absolute path of that observation’s candidate. Use absolute paths for scripts and support files. No shell is implied; the program and its arguments are executed directly. The command inherits your environment and can access your machine, so use a predicate you trust. Windows users can supply a native predicate executable; grep and the shell examples need a Unix-like shell.

The defaults are three observations per candidate, a five-second timeout for each execution and a total budget of 10000 predicate executions. An interrupted or budget-limited run exits with code 2 and leaves a checkpoint with an incomplete report. A completed run exits with code 0 after final verification. That completion code does not establish global minimality. The reference explains the separate locally_minimal field.