FAILURE MAP
← Case archive

FA-11591 / Compression format semantics / Open access

LZ match copying freezes the source before expansion · case 01

LZ match copying freezes the source before expansion.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

A match is read from a snapshot instead of the growing output.

VERIFIED REPAIR

Read each match symbol from the growing output, allowing earlier copied symbols to become the source for later symbols.

Unsuccessful approach: Repeating only the last symbol fixes distance one but destroys longer periodic matches.

Case contract

For a nonempty seed, valid distance into seed, and nonnegative length, append length symbols by repeatedly reading distance symbols behind the growing output.

Why this case matters

A small offline codec model isolates a compression-specific failure without external files or libraries.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(seed, distance, length):
    return seed + seed[-distance:][:length]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overlap',solve('ab',2,2*N+1),'ab'+'ab'*N+'a')
check('distance one',solve('x',1,4),'xxxxx')
check('no match',solve('abc',2,0),'abc')
check('partial period',solve('abc',3,2),'abcab')
check('exact period',solve('abc',3,3),'abcabc')
check('suffix period',solve('zab',2,5),'zabababa')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
overlapababababaFailed
distance onexxxxxxxFailed
no matchabcabcPassed
partial periodabcababcabPassed
exact periodabcabcabcabcPassed
suffix periodzababzabababaFailed

SHA-256 / a1016418e07521cca3fbdaef1e4322151505cc40f3b5a7f17de80a1547ec401d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(seed, distance, length):
    return seed + seed[-1:] * length
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overlap',solve('ab',2,2*N+1),'ab'+'ab'*N+'a')
check('distance one',solve('x',1,4),'xxxxx')
check('no match',solve('abc',2,0),'abc')
check('partial period',solve('abc',3,2),'abcab')
check('exact period',solve('abc',3,3),'abcabc')
check('suffix period',solve('zab',2,5),'zabababa')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
overlapabbbbababaFailed
distance onexxxxxxxxxxPassed
no matchabcabcPassed
partial periodabcccabcabFailed
exact periodabccccabcabcFailed
suffix periodzabbbbbbzabababaFailed

SHA-256 / 9ebae2c3a688ceceae90be8b715c3c389905c1bf76aba0bc1600945d7541c14b

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(seed, distance, length):
    out=list(seed)
    for _ in range(length): out.append(out[-distance])
    return ''.join(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overlap',solve('ab',2,2*N+1),'ab'+'ab'*N+'a')
check('distance one',solve('x',1,4),'xxxxx')
check('no match',solve('abc',2,0),'abc')
check('partial period',solve('abc',3,2),'abcab')
check('exact period',solve('abc',3,3),'abcabc')
check('suffix period',solve('zab',2,5),'zabababa')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
overlapababaababaPassed
distance onexxxxxxxxxxPassed
no matchabcabcPassed
partial periodabcababcabPassed
exact periodabcabcabcabcPassed
suffix periodzabababazabababaPassed

SHA-256 / 90978fed3925174e71765acc570f507dcc24e43c5740c27ad434bb489f9af31c

Verification & scope

Controlled educational model, not a complete implementation of a production compression format. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:38:49.289771+00:00.

Case digest / 7dcfa215d1babae0f5c8d1bb3af71167cad58a486a57010f972c049711cd2905