Tree-edit-distance computation, split across three files: common (shared
infrastructure - cost model, indexing, delta/forest-distance tables, the
backtrace that turns a populated delta table into an ASTDiff, and the public
entry points), zhang_shasha (the classic Zhang-Shasha algorithm), and engine
(the APTED algorithm: gted/spfL/spfR/spfA plus optimal-strategy
computation).
MoveDetectionRecovery: the final pass of the pipeline, running after the tree-edit-distance
step has fully decided the diff. Scans what got wholly deleted and wholly inserted and pairs
up byte-identical subtrees between the two sets - code that didn’t change but moved, which
plain ordered tree edit distance structurally cannot express as anything but delete+insert
whenever the move crosses a matched boundary (the classic case: a subtree relocating into a
newly-inserted wrapper, or into a container whose own identity changed - see the
rust-turbopack-module-rule analysis in TODO.md).
Per-pass on/off switches for Diff::from_code_with_config’s seven-phase pipeline, for the
passes whose accuracy contribution is ambiguous enough to be worth re-measuring independently.
HeuristicConfig::default is what plain Diff::from_code/diff_code use, and is the
only configuration any production caller should need.