FAILURE MAP
← Case archive

FA-12586 / Genomic coordinate mapping / Open access

CDS exon phase mistakes remaining bases for consumed bases · case 01

CDS exon phase mistakes remaining bases for consumed bases.

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

ROOT CAUSE

The carried coding remainder is used directly as the next segment phase.

VERIFIED REPAIR

Return the number of leading bases needed to complete the split codon, modulo three.

Unsuccessful approach: Using three minus the remainder without modulo three invents a full-codon skip at aligned junctions.

Case contract

Given lengths of preceding coding segments in transcript order, report GFF-like leading completion phase (3-total modulo 3) modulo 3. This model assumes the initial segment starts on a codon boundary.

Why this case matters

An abstract offline coordinate model isolates this software mapping defect; it does not model biological interpretation.

1 / The failure

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

N = 1
observations = []
def solve(lengths):
    return sum(lengths)%3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one carried base',solve([3*N+1]),2)
check('two carried bases',solve([3*N+2]),1)
check('aligned exon',solve([3*N]),0)
check('no preceding exon',solve([]),0)
check('multiple segments',solve([3*N+1,4]),1)
check('split closes codon',solve([3*N+1,2]),0)
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
one carried base12Failed
two carried bases21Failed
aligned exon00Passed
no preceding exon00Passed
multiple segments21Failed
split closes codon00Passed

SHA-256 / 95cb317d4b3a9ce87e46d6f229efe26a87e6bfe6be80115f27642745cf8d2551

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(lengths):
    return 3-sum(lengths)%3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one carried base',solve([3*N+1]),2)
check('two carried bases',solve([3*N+2]),1)
check('aligned exon',solve([3*N]),0)
check('no preceding exon',solve([]),0)
check('multiple segments',solve([3*N+1,4]),1)
check('split closes codon',solve([3*N+1,2]),0)
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
one carried base22Passed
two carried bases11Passed
aligned exon30Failed
no preceding exon30Failed
multiple segments11Passed
split closes codon30Failed

SHA-256 / 8ea2b41e73dece5b57452933487b19d618cfed678f622610daab4ed293936755

3 / The verified repair

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

N = 1
observations = []
def solve(lengths):
    return (-sum(lengths))%3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one carried base',solve([3*N+1]),2)
check('two carried bases',solve([3*N+2]),1)
check('aligned exon',solve([3*N]),0)
check('no preceding exon',solve([]),0)
check('multiple segments',solve([3*N+1,4]),1)
check('split closes codon',solve([3*N+1,2]),0)
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
one carried base22Passed
two carried bases11Passed
aligned exon00Passed
no preceding exon00Passed
multiple segments11Passed
split closes codon00Passed

SHA-256 / 6add019219780c9c0f9d3430c2f13102367449ea062a28e3a56abfca8dc05005

Verification & scope

Synthetic coordinate fixtures only; not a production annotation or alignment implementation. 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:58.146336+00:00.

Case digest / 2770de9ae26774de178c77f92c81c4cd974905ca34cd955b844dd25e20fb2c01