Presets
Each preset carries the phenomenon it exists to show. Open one, then press play.
A minimal edit
One line changes. D is small and most of the lattice is one long snake — this is why diff is fast on real edits.
Open in the edit graph →#p=minimal-editA pure insertion
Nothing is deleted. The path only moves down, then runs the diagonal: D equals the number of inserted lines.
Open in the edit graph →#p=pure-insertA pure deletion
The mirror of a pure insertion: the path only moves right. D equals the number of deleted lines.
Open in the edit graph →#p=pure-deleteA transposition
Two blocks swap places. A line diff has no notion of "move", so one block is deleted and inserted again elsewhere.
Open in the edit graph →#p=transpositionThe misattributed brace
A new function is inserted between two existing ones. Three edit scripts are equally minimal — step through the alternatives and one of them attributes the closing brace to the wrong function: the ugly diff everybody has seen. This implementation happens to pick a readable one; which you get is decided by tie-breaking, not by any judgement about which reads better.
Open in the edit graph →#p=brace-misattributionWhere patience wins
One entry is replaced by two new ones. All three algorithms agree on D = 5 — equally minimal — but Myers splits it into two separate hunks, because it is free to match the repeated "enabled" and "replicas" lines across entry boundaries. Patience refuses to anchor on any line appearing more than once, so it anchors on the unique "- name:" lines and keeps the change in one block. Same length, different readability.
Open in the edit graph →#p=patience-winsThe worst case
No element is shared, so D = N + M and there are no free diagonals at all. The pathological path is deliberately reachable: the search runs in a worker with a step budget, so the UI never freezes.
Open in the edit graph →#p=worst-caseCharacter granularity
The same input at character level. What counts as an element is a choice, not a property of diff — change the granularity and the lattice changes completely.
Open in the edit graph →#p=char-level