FAILURE MAP
← Case archive

FA-75358 / Text diff and three-way merge / Member archive

LCS edit script: the first row and column of the table are never filled · case 03

Edits near the start of the files are chosen from zeros and the diff is not minimal.

Member previewVariant 3 · 3 implementations · 10 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
lcs longer than greedy[["-", "a"], ["+", "x"], ["+", "y"], ["+", "a"], [" ", "b"], [" ", "c"], ["-", "x"], ["-", "y"], ["+", "d"]][["+", "x"], ["+", "y"], [" ", "a"], [" ", "b"], [" ", "c"], ["-", "x"], ["-", "y"], ["+", "d"]]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 ↗