From test-case-reduction
Diagnose problems with shrinkray test-case reduction — unexpected results, reduction getting stuck, slippage to wrong bugs, or interestingness test issues. Use when reduction output is surprising or reduction is not making progress.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-case-reduction:debug-reductionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user diagnose and fix problems with their test-case reduction. Something has gone wrong — the reduced output is unexpected, reduction is stuck, or the interestingness test isn't working properly.
You are helping the user diagnose and fix problems with their test-case reduction. Something has gone wrong — the reduced output is unexpected, reduction is stuck, or the interestingness test isn't working properly.
Symptoms:
Diagnosis: The interestingness test is too broad. The reducer found a simpler input that satisfies the test but exercises a different code path.
Fixes:
Symptoms:
Diagnosis: The interestingness test accepts inputs that don't genuinely exhibit the bug. Often: empty input causes the tool to error, and the test matches any error.
Fixes:
test -s "$1" || exit 1 to reject empty filesSymptoms:
Diagnosis possibilities:
Fixes:
gcc -E file.c > file.i) to eliminate header dependenciesSymptoms:
Diagnosis: The interestingness test gives different results on the same input. Common causes:
Fixes:
setarch $(uname -m) -R ./test.sh file.c--parallelism=1 with shrinkray to eliminate parallel interferencesleep or retry logic (but this slows reduction significantly)Symptoms:
Diagnosis: The interestingness test is slow, or timeouts are too generous.
Fixes:
-S instead of -c, -Wfatal-errors, -w (suppress warnings when they don't matter)--parallelism is set to your core count (default)time ./test.sh file.c to see where time is spentSymptoms:
Diagnosis: The reducer introduced UB during reduction. This is expected and nearly inevitable for C/C++ miscompilation bugs if the interestingness test doesn't guard against it.
Fixes:
-fsanitize=undefined-Wall -Wextra -pedantic -WerrorSymptoms:
./test.sh file.c && echo interesting works fine manuallyDiagnosis: This is almost always a temporary directory problem. shrinkray runs the test in a fresh temp directory, not your working directory. Anything that depends on your local environment will break.
Fixes:
$1 for the test case: The file argument is an absolute path and works from any directory. If the test references the file by a hardcoded relative path or basename, switch to $1.SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)".chmod +x test.sh).Quick diagnostic: Run the test from a different directory to simulate the reducer's environment:
cd /tmp && /absolute/path/to/test.sh /absolute/path/to/original_file
If this fails but running from your project directory succeeds, the test has a directory dependency.
When the user reports a problem, work through these steps:
--timeout setting (auto-calibrated by default — if the initial run is slow, the timeout may be too generous)--input-type matches how the test reads its input--volume=debug for detailed pass-by-pass progress.shrinkray/ history directory for intermediate results--also-interesting=101 in the test to record interesting-but-wrong variants--parallelism=1 to eliminate parallel-related issues--formatter=none if auto-formatting is interfering with reductionnpx claudepluginhub drmaciver/test-case-reduction-skill4-phase systematic debugging with entropy analysis and persistent sessions. Enforces investigation before fixes for non-obvious test or context-dependent failures.
Isolates root cause of bugs through systematic hypothesis-and-test cycles. Active before any fix is written — use when behavior diverges from specification.
Implements disciplined diagnosis loop for hard bugs and performance regressions: reproduce → minimise → hypothesise → instrument → fix → regression-test. Use for bug reports, failures, or 'diagnose this'.