FA-75355 / Text diff and three-way merge / Member archive
LCS edit script: the trailing deletion flush skips a line · case 05
The first of several trailing removed lines disappears from the diff.
Case contract
Given old and new line lists, fill a suffix LCS table L[i][j] for a[i:], b[j:], then walk from the start: equal lines are kept, otherwise delete when L[i+1][j] >= L[i][j+1] and insert otherwise; flush remaining old lines as deletions and new lines as insertions. Return [tag, line] ops with tags " ", "-", "+".
Why this case matters
Line diffs are built from a longest-common-subsequence table; the walk decides how edits are ordered and presented.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| deletion at the end | [[" ", "a"], [" ", "b"], [" ", "c"], [" ", "d"], ["-", "t2"]] | [[" ", "a"], [" ", "b"], [" ", "c"], [" ", "d"], ["-", "t1"], ["-", "t2"]] | 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 ↗