FAILURE MAP
← Case archive

FA-77911 / Subtitle cue timing / Open access

Partial subtitle resync from a point: end time shift · case 01

Shifted cues keep their old end time and become too long or inverted.

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

ROOT CAUSE

Only the start time receives the offset; end=end leaves the end unshifted.

THE FAILURE

Only the start time receives the offset; end=end leaves the end unshifted.

Unsuccessful approach: Recomputing end as start+(end-start) after start has already moved cancels out and leaves the end unchanged.

Case contract

Cues [start,end,text] (sorted by start) whose start is at or after from_ms are shifted by offset ms (start and end). A cue whose end becomes <= 0 is dropped; a negative start is clamped to 0 without moving its end. The result is re-sorted by (start,end) and numbered from 1 as [n,start,end,text].

Why this case matters

Subtitle timing defects shift, hide or overlap captions that viewers depend on for comprehension and accessibility.

1 / The failure

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

N = 1
observations = []
def solve(cues, offset, from_ms):
    out=[]
    for start,end,text in cues:
        if start>=from_ms:
            start+=offset
            end=end
        if end<=0:
            continue
        if start<0:
            start=0
        out.append([start,end,text])
    out.sort(key=lambda c:(c[0],c[1]))
    return [[i+1]+c for i,c in enumerate(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end time shift', [[[1000, 2000, 'a'], [3000, 4000, 'b']], -1500, 0], [[1, 0, 500, 'a'], [2, 1500, 2500, 'b']]), ('regression variant: end time shift', [[[400, 401, 'e'], [2900, 3700, 'd'], [5400, 5401, 'd'], [6600, 9600, 'e'], [8600, 8601, 'a']], 250, 1518], [[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]), ('partial repair probe: end time shift', [[[100, 200, 'x']], 50, 100], [[1, 150, 250, 'x']]), ('partial repair variant: end time shift', [[[2500, 2501, 'b']], -300, 2500], [[1, 2200, 2201, 'b']]), ('normal control', [[[150, 151, 'd'], [200, 400, 'e']], 1000, 3319], [[1, 150, 151, 'd'], [2, 200, 400, 'e']]), ('normal control', [[[300, 500, 'd']], -1200, 500], [[1, 300, 500, 'd']]), ('normal control', [[[150, 1650, 'b'], [250, 3250, 'b'], [450, 451, 'e'], [1450, 1451, 'd'], [2700, 3500, 'c']], 4000, 4769], [[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']])], [('regression: end time shift', [[[0, 500, 'a'], [600, 900, 'b']], -500, 600], [[1, 0, 500, 'a'], [2, 100, 400, 'b']]), ('regression variant: end time shift', [[[3000, 3001, 'a'], [3500, 3501, 'c'], [4750, 7750, 'c'], [6150, 6350, 'a'], [7550, 7750, 'c']], 250, 7550], [[1, 3000, 3001, 'a'], [2, 3500, 3501, 'c'], [3, 4750, 7750, 'c'], [4, 6150, 6350, 'a'], [5, 7800, 8000, 'c']]), ('partial repair probe: end time shift', [[[400, 1200, 'e']], -1200, 0], []), ('partial repair variant: end time shift', [[[1100, 1900, 'b'], [2650, 4150, 'c'], [2700, 2900, 'a'], [3100, 3300, 'e']], 4000, 1100], [[1, 5100, 5900, 'b'], [2, 6650, 8150, 'c'], [3, 6700, 6900, 'a'], [4, 7100, 7300, 'e']]), ('normal control', [[[500, 3500, 'c'], [3000, 3800, 'a'], [3050, 6050, 'c'], [3800, 4600, 'd'], [4250, 7250, 'd']], -3000, 6050], [[1, 500, 3500, 'c'], [2, 3000, 3800, 'a'], [3, 3050, 6050, 'c'], [4, 3800, 4600, 'd'], [5, 4250, 7250, 'd']]), ('normal control', [[[2500, 4000, 'c']], -300, 4000], [[1, 2500, 4000, 'c']]), ('normal control', [[[3000, 4500, 'a']], 4000, 4500], [[1, 3000, 4500, 'a']])], [('regression: end time shift', [[[100, 200, 'x']], 50, 100], [[1, 150, 250, 'x']]), ('regression variant: end time shift', [[[150, 151, 'e'], [450, 3450, 'b'], [1850, 4850, 'd']], -800, 0], [[1, 0, 2650, 'b'], [2, 1050, 4050, 'd']]), ('partial repair probe: end time shift', [[[2500, 5500, 'e']], 4000, 2500], [[1, 6500, 9500, 'e']]), ('partial repair variant: end time shift', [[[2300, 5300, 'c'], [3300, 4800, 'e']], -1200, 813], [[1, 1100, 4100, 'c'], [2, 2100, 3600, 'e']]), ('normal control', [[[300, 3300, 'a'], [800, 2300, 'e'], [800, 1600, 'e'], [1050, 1250, 'b'], [1250, 2050, 'a']], 1000, 2404], [[1, 300, 3300, 'a'], [2, 800, 1600, 'e'], [3, 800, 2300, 'e'], [4, 1050, 1250, 'b'], [5, 1250, 2050, 'a']]), ('normal control', [[[500, 1300, 'a'], [2000, 2001, 'b']], 250, 2052], [[1, 500, 1300, 'a'], [2, 2000, 2001, 'b']]), ('normal control', [[[50, 1550, 'b'], [50, 1550, 'd'], [350, 1850, 'c']], 4000, 4374], [[1, 50, 1550, 'b'], [2, 50, 1550, 'd'], [3, 350, 1850, 'c']])], [('regression: end time shift', [[[400, 1200, 'e']], -1200, 0], []), ('regression variant: end time shift', [[[500, 3500, 'b'], [3000, 4500, 'd'], [4400, 4600, 'a']], -1200, 500], [[1, 0, 2300, 'b'], [2, 1800, 3300, 'd'], [3, 3200, 3400, 'a']]), ('partial repair probe: end time shift', [[[400, 401, 'e'], [2900, 3700, 'd'], [5400, 5401, 'd'], [6600, 9600, 'e'], [8600, 8601, 'a']], 250, 1518], [[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]), ('partial repair variant: end time shift', [[[400, 600, 'c'], [400, 1200, 'd'], [2900, 3100, 'b'], [5100, 5101, 'a']], -3000, 5100], [[1, 400, 600, 'c'], [2, 400, 1200, 'd'], [3, 2100, 2101, 'a'], [4, 2900, 3100, 'b']]), ('normal control', [[[500, 1300, 'c'], [1000, 1200, 'b'], [1000, 1200, 'a']], 4000, 5861], [[1, 500, 1300, 'c'], [2, 1000, 1200, 'b'], [3, 1000, 1200, 'a']]), ('normal control', [[[0, 1500, 'e']], 1000, 3783], [[1, 0, 1500, 'e']]), ('normal control', [[[2600, 2800, 'a']], -800, 2800], [[1, 2600, 2800, 'a']])], [('regression: end time shift', [[[2500, 5500, 'e']], 4000, 2500], [[1, 6500, 9500, 'e']]), ('regression variant: end time shift', [[[2500, 2501, 'b']], -300, 2500], [[1, 2200, 2201, 'b']]), ('partial repair probe: end time shift', [[[3000, 3001, 'a'], [3500, 3501, 'c'], [4750, 7750, 'c'], [6150, 6350, 'a'], [7550, 7750, 'c']], 250, 7550], [[1, 3000, 3001, 'a'], [2, 3500, 3501, 'c'], [3, 4750, 7750, 'c'], [4, 6150, 6350, 'a'], [5, 7800, 8000, 'c']]), ('partial repair variant: end time shift', [[[3000, 3800, 'c'], [3700, 6700, 'd']], -1200, 3000], [[1, 1800, 2600, 'c'], [2, 2500, 5500, 'd']]), ('normal control', [[[2000, 2800, 'c'], [2400, 5400, 'c']], -800, 5178], [[1, 2000, 2800, 'c'], [2, 2400, 5400, 'c']]), ('normal control', [[[2000, 2001, 'c'], [4500, 6000, 'b']], 4000, 6000], [[1, 2000, 2001, 'c'], [2, 4500, 6000, 'b']]), ('normal control', [[[2050, 2250, 'a']], 250, 2250], [[1, 2050, 2250, 'a']])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
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
regression: end time shift[[1, 0, 2000, 'a'], [2, 1500, 4000, 'b']][[1, 0, 500, 'a'], [2, 1500, 2500, 'b']]Failed
regression variant: end time shift[[1, 400, 401, 'e'], [2, 3150, 3700, 'd'], [3, 5650, 5401, 'd'], [4, 6850, 9600, 'e'], [5, 8850, 8601, 'a']][[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]Failed
partial repair probe: end time shift[[1, 150, 200, 'x']][[1, 150, 250, 'x']]Failed
partial repair variant: end time shift[[1, 2200, 2501, 'b']][[1, 2200, 2201, 'b']]Failed
normal control[[1, 150, 151, 'd'], [2, 200, 400, 'e']][[1, 150, 151, 'd'], [2, 200, 400, 'e']]Passed
normal control[[1, 300, 500, 'd']][[1, 300, 500, 'd']]Passed
normal control[[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']][[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']]Passed

SHA-256 / 6a7a838a023b8fb7a0dc6216ab477778a035c6eca475e1b91376c17a91d8706e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(cues, offset, from_ms):
    out=[]
    for start,end,text in cues:
        if start>=from_ms:
            start+=offset
            end=start+(end-start)
        if end<=0:
            continue
        if start<0:
            start=0
        out.append([start,end,text])
    out.sort(key=lambda c:(c[0],c[1]))
    return [[i+1]+c for i,c in enumerate(out)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end time shift', [[[1000, 2000, 'a'], [3000, 4000, 'b']], -1500, 0], [[1, 0, 500, 'a'], [2, 1500, 2500, 'b']]), ('regression variant: end time shift', [[[400, 401, 'e'], [2900, 3700, 'd'], [5400, 5401, 'd'], [6600, 9600, 'e'], [8600, 8601, 'a']], 250, 1518], [[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]), ('partial repair probe: end time shift', [[[100, 200, 'x']], 50, 100], [[1, 150, 250, 'x']]), ('partial repair variant: end time shift', [[[2500, 2501, 'b']], -300, 2500], [[1, 2200, 2201, 'b']]), ('normal control', [[[150, 151, 'd'], [200, 400, 'e']], 1000, 3319], [[1, 150, 151, 'd'], [2, 200, 400, 'e']]), ('normal control', [[[300, 500, 'd']], -1200, 500], [[1, 300, 500, 'd']]), ('normal control', [[[150, 1650, 'b'], [250, 3250, 'b'], [450, 451, 'e'], [1450, 1451, 'd'], [2700, 3500, 'c']], 4000, 4769], [[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']])], [('regression: end time shift', [[[0, 500, 'a'], [600, 900, 'b']], -500, 600], [[1, 0, 500, 'a'], [2, 100, 400, 'b']]), ('regression variant: end time shift', [[[3000, 3001, 'a'], [3500, 3501, 'c'], [4750, 7750, 'c'], [6150, 6350, 'a'], [7550, 7750, 'c']], 250, 7550], [[1, 3000, 3001, 'a'], [2, 3500, 3501, 'c'], [3, 4750, 7750, 'c'], [4, 6150, 6350, 'a'], [5, 7800, 8000, 'c']]), ('partial repair probe: end time shift', [[[400, 1200, 'e']], -1200, 0], []), ('partial repair variant: end time shift', [[[1100, 1900, 'b'], [2650, 4150, 'c'], [2700, 2900, 'a'], [3100, 3300, 'e']], 4000, 1100], [[1, 5100, 5900, 'b'], [2, 6650, 8150, 'c'], [3, 6700, 6900, 'a'], [4, 7100, 7300, 'e']]), ('normal control', [[[500, 3500, 'c'], [3000, 3800, 'a'], [3050, 6050, 'c'], [3800, 4600, 'd'], [4250, 7250, 'd']], -3000, 6050], [[1, 500, 3500, 'c'], [2, 3000, 3800, 'a'], [3, 3050, 6050, 'c'], [4, 3800, 4600, 'd'], [5, 4250, 7250, 'd']]), ('normal control', [[[2500, 4000, 'c']], -300, 4000], [[1, 2500, 4000, 'c']]), ('normal control', [[[3000, 4500, 'a']], 4000, 4500], [[1, 3000, 4500, 'a']])], [('regression: end time shift', [[[100, 200, 'x']], 50, 100], [[1, 150, 250, 'x']]), ('regression variant: end time shift', [[[150, 151, 'e'], [450, 3450, 'b'], [1850, 4850, 'd']], -800, 0], [[1, 0, 2650, 'b'], [2, 1050, 4050, 'd']]), ('partial repair probe: end time shift', [[[2500, 5500, 'e']], 4000, 2500], [[1, 6500, 9500, 'e']]), ('partial repair variant: end time shift', [[[2300, 5300, 'c'], [3300, 4800, 'e']], -1200, 813], [[1, 1100, 4100, 'c'], [2, 2100, 3600, 'e']]), ('normal control', [[[300, 3300, 'a'], [800, 2300, 'e'], [800, 1600, 'e'], [1050, 1250, 'b'], [1250, 2050, 'a']], 1000, 2404], [[1, 300, 3300, 'a'], [2, 800, 1600, 'e'], [3, 800, 2300, 'e'], [4, 1050, 1250, 'b'], [5, 1250, 2050, 'a']]), ('normal control', [[[500, 1300, 'a'], [2000, 2001, 'b']], 250, 2052], [[1, 500, 1300, 'a'], [2, 2000, 2001, 'b']]), ('normal control', [[[50, 1550, 'b'], [50, 1550, 'd'], [350, 1850, 'c']], 4000, 4374], [[1, 50, 1550, 'b'], [2, 50, 1550, 'd'], [3, 350, 1850, 'c']])], [('regression: end time shift', [[[400, 1200, 'e']], -1200, 0], []), ('regression variant: end time shift', [[[500, 3500, 'b'], [3000, 4500, 'd'], [4400, 4600, 'a']], -1200, 500], [[1, 0, 2300, 'b'], [2, 1800, 3300, 'd'], [3, 3200, 3400, 'a']]), ('partial repair probe: end time shift', [[[400, 401, 'e'], [2900, 3700, 'd'], [5400, 5401, 'd'], [6600, 9600, 'e'], [8600, 8601, 'a']], 250, 1518], [[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]), ('partial repair variant: end time shift', [[[400, 600, 'c'], [400, 1200, 'd'], [2900, 3100, 'b'], [5100, 5101, 'a']], -3000, 5100], [[1, 400, 600, 'c'], [2, 400, 1200, 'd'], [3, 2100, 2101, 'a'], [4, 2900, 3100, 'b']]), ('normal control', [[[500, 1300, 'c'], [1000, 1200, 'b'], [1000, 1200, 'a']], 4000, 5861], [[1, 500, 1300, 'c'], [2, 1000, 1200, 'b'], [3, 1000, 1200, 'a']]), ('normal control', [[[0, 1500, 'e']], 1000, 3783], [[1, 0, 1500, 'e']]), ('normal control', [[[2600, 2800, 'a']], -800, 2800], [[1, 2600, 2800, 'a']])], [('regression: end time shift', [[[2500, 5500, 'e']], 4000, 2500], [[1, 6500, 9500, 'e']]), ('regression variant: end time shift', [[[2500, 2501, 'b']], -300, 2500], [[1, 2200, 2201, 'b']]), ('partial repair probe: end time shift', [[[3000, 3001, 'a'], [3500, 3501, 'c'], [4750, 7750, 'c'], [6150, 6350, 'a'], [7550, 7750, 'c']], 250, 7550], [[1, 3000, 3001, 'a'], [2, 3500, 3501, 'c'], [3, 4750, 7750, 'c'], [4, 6150, 6350, 'a'], [5, 7800, 8000, 'c']]), ('partial repair variant: end time shift', [[[3000, 3800, 'c'], [3700, 6700, 'd']], -1200, 3000], [[1, 1800, 2600, 'c'], [2, 2500, 5500, 'd']]), ('normal control', [[[2000, 2800, 'c'], [2400, 5400, 'c']], -800, 5178], [[1, 2000, 2800, 'c'], [2, 2400, 5400, 'c']]), ('normal control', [[[2000, 2001, 'c'], [4500, 6000, 'b']], 4000, 6000], [[1, 2000, 2001, 'c'], [2, 4500, 6000, 'b']]), ('normal control', [[[2050, 2250, 'a']], 250, 2250], [[1, 2050, 2250, 'a']])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
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
regression: end time shift[[1, 0, 2000, 'a'], [2, 1500, 4000, 'b']][[1, 0, 500, 'a'], [2, 1500, 2500, 'b']]Failed
regression variant: end time shift[[1, 400, 401, 'e'], [2, 3150, 3700, 'd'], [3, 5650, 5401, 'd'], [4, 6850, 9600, 'e'], [5, 8850, 8601, 'a']][[1, 400, 401, 'e'], [2, 3150, 3950, 'd'], [3, 5650, 5651, 'd'], [4, 6850, 9850, 'e'], [5, 8850, 8851, 'a']]Failed
partial repair probe: end time shift[[1, 150, 200, 'x']][[1, 150, 250, 'x']]Failed
partial repair variant: end time shift[[1, 2200, 2501, 'b']][[1, 2200, 2201, 'b']]Failed
normal control[[1, 150, 151, 'd'], [2, 200, 400, 'e']][[1, 150, 151, 'd'], [2, 200, 400, 'e']]Passed
normal control[[1, 300, 500, 'd']][[1, 300, 500, 'd']]Passed
normal control[[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']][[1, 150, 1650, 'b'], [2, 250, 3250, 'b'], [3, 450, 451, 'e'], [4, 1450, 1451, 'd'], [5, 2700, 3500, 'c']]Passed

SHA-256 / 285f435a618eab9ee4d90fb6976047d2f43e91ba497fd03e3c25af9322f8b2d9

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic bounded teaching model with a stipulated toy contract; it does not claim conformance to any subtitle standard. 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:49:30.112428+00:00.

Case digest / 07f0c3ec7fc753f25dc4b38481447897615afcbe2671888adca45d61d17099d1