FA-75510 / Text diff and three-way merge / Member archive
Patience diff anchors: lines repeated in the new side become anchors · case 05
A line duplicated in the new file anchors to its last copy and misaligns the diff.
Case contract
Candidates are lines occurring exactly once in the old side and exactly once in the new side, as (old index, new index) pairs in old order. Keep the longest chain with increasing new index, found with patience piles (bisect on pile tops by new index, back pointers to the previous pile top) and reconstructed from the top of the last pile. Return the anchor pairs.
Why this case matters
Patience diff anchors on unique lines to produce readable diffs of code with many repeated braces and blank lines.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| duplicated in new side are not anchors | [[0, 1], [1, 2], [2, 3]] | [[0, 1], [2, 3]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗