Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hands-On Delta Debugging in Rust

If you’ve spent time minimizing failing test cases, you’ve probably met a small zoo of algorithms:

  • DDMin, the original delta debugging minimizer;
  • ProbDD, probabilistic delta debugging, which puts a probability model over what to remove;
  • HDD, hierarchical delta debugging, which runs DDMin over a parse tree;
  • WDD, weighted delta debugging, which weights elements by size so that partitioning treats a big chunk differently from a tiny one;
  • Perses, which exploits the grammar more aggressively;
  • T-PDD, which constructs a probabilistic model over the parse tree, and uses it to guide the search for a minimal tree.

This series builds each of them from scratch in Rust.

Rather than unrelated implementations, they turn out to share one shape: a single reduce loop that repeatedly proposes a deletion and tests it against an oracle, plus a swappable Policy that decides what to propose next.

Note

This series mainly focuses on program reduction, a subarea of delta debugging that deals with structured inputs that can be described by a grammar.

Tip

Checkout Program Reduction 101 for a comprehensive tutorial on program reduction, including a gentle introduction to delta debugging.

Dealt a Debugging with Delta Debugging

You hit a bug that makes the compiler break,
With forty thousand lines of code at stake.
Somewhere inside, ten crucial lines reside,
While all the rest is noise to cast aside.

Your task is finding where the secret lies,
For massive files will only strain the eyes.
So you remove a chunk and run anew,
And ask: does this old bug still trigger, too?

If yes, the chunk was noise—toss it away.
If no, put it right back; the code must stay.
You keep on cutting, shrinking every pass,
Eliminating all the bloated mass.

Until no single piece can be erased,
Without the bug itself being displaced.
From forty thousand lines to merely ten,
The smallest breaking proof is captured then.

Stripped of the noise, the naked truth avails:
Just this, and nothing else—right here, it fails.

— Claude Opus and Gemini Pro, 2026