FAILURE MAP
← Case archive

FA-12516 / Biological sequence representation / Open access

Removing alignment gaps independently pairs different columns · case 01

Removing alignment gaps independently pairs different columns.

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

ROOT CAUSE

Independent gap stripping shifts aligned positions.

VERIFIED REPAIR

Implement the stated sequence contract while preserving its positional and symbol semantics.

Unsuccessful approach: Dropping only double gaps still counts single-gap columns as comparisons.

Case contract

For equal-length aligned ACGT- strings, return [matches,compared] considering only columns where neither symbol is a gap.

Why this case matters

An offline abstract sequence-data model; useful for testing representation invariants without biological inference.

1 / The failure

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

N = 1
observations = []
def solve(a,b):
    a=a.replace('-',''); b=b.replace('-','')
    p=list(zip(a,b))
    return [sum(x==y for x,y in p),len(p)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable displaced', solve('A-'*N,'-A'*N), [0,0])
check('match', solve('AC','AC'), [2,2])
check('mismatch', solve('AC','AG'), [1,2])
check('all gaps', solve('--','--'), [0,0])
check('empty', solve('',''), [0,0])
check('mixed', solve('A-CG','AT-G'), [2,2])
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
variable displaced[1, 1][0, 0]Failed
match[2, 2][2, 2]Passed
mismatch[1, 2][1, 2]Passed
all gaps[0, 0][0, 0]Passed
empty[0, 0][0, 0]Passed
mixed[2, 3][2, 2]Failed

SHA-256 / 1343ea231ce734dc828fedbea8d1bcea006ca3696f4c78910e9d5874bbb615ac

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(a,b):
    p=[(x,y) for x,y in zip(a,b) if x!='-' or y!='-']
    return [sum(x==y for x,y in p),len(p)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable displaced', solve('A-'*N,'-A'*N), [0,0])
check('match', solve('AC','AC'), [2,2])
check('mismatch', solve('AC','AG'), [1,2])
check('all gaps', solve('--','--'), [0,0])
check('empty', solve('',''), [0,0])
check('mixed', solve('A-CG','AT-G'), [2,2])
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
variable displaced[0, 2][0, 0]Failed
match[2, 2][2, 2]Passed
mismatch[1, 2][1, 2]Passed
all gaps[0, 0][0, 0]Passed
empty[0, 0][0, 0]Passed
mixed[2, 4][2, 2]Failed

SHA-256 / 9a9b33db883a7e6ac80510a2491614473d06753a43babeaf37af99aff4875682

3 / The verified repair

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

N = 1
observations = []
def solve(a,b):
    p=[(x,y) for x,y in zip(a,b) if x!='-' and y!='-']
    return [sum(x==y for x,y in p),len(p)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable displaced', solve('A-'*N,'-A'*N), [0,0])
check('match', solve('AC','AC'), [2,2])
check('mismatch', solve('AC','AG'), [1,2])
check('all gaps', solve('--','--'), [0,0])
check('empty', solve('',''), [0,0])
check('mixed', solve('A-CG','AT-G'), [2,2])
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
variable displaced[0, 0][0, 0]Passed
match[2, 2][2, 2]Passed
mismatch[1, 2][1, 2]Passed
all gaps[0, 0][0, 0]Passed
empty[0, 0][0, 0]Passed
mixed[2, 2][2, 2]Passed

SHA-256 / 1140810629fb0fb475295522d10334ba507cc49b9f18841d389458126d11bcd9

Verification & scope

Synthetic strings and explicit policies only; no biological interpretation or laboratory workflow. 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:57.502493+00:00.

Case digest / 6da6ba0c80a00f7192456870a84e351e365a991099faca09a4d2c303fad8a85a