FAILURE MAP
← Case archive

FA-78296 / Subtitle cue timing / Open access

Active cue lookup with prefix maximum ends: end exclusivity · case 01

A cue is still reported at the instant it ends.

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

ROOT CAUSE

The activity test treats the end as inclusive.

VERIFIED REPAIR

Use end > t.

Unsuccessful approach: Comparing with t-1 is the same inclusive test.

Case contract

cues [start,end] are sorted by start. Return the ascending indices of cues active at t (start <= t < end). The search bisects the starts and walks backwards while the running maximum end of the prefix exceeds t.

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
import bisect
N = 1
observations = []
def solve(cues, t):
    starts=[c[0] for c in cues]
    hi=bisect.bisect_right(starts,t)
    maxend=[]
    run=0
    for c in cues:
        run=max(run,c[1])
        maxend.append(run)
    res=[]
    i=hi-1
    while i>=0 and maxend[i]>t:
        if cues[i][1]>=t:
            res.append(i)
        i-=1
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end exclusivity', [[[0, 100], [0, 1000], [400, 500], [500, 600], [500, 1500], [500, 550]], 600], [1, 4]), ('regression variant: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair probe: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('partial repair variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 100], [100, 1100], [200, 300], [200, 500]], 50], [0]), ('normal control', [[[100, 400], [300, 400], [300, 400], [300, 350], [400, 500], [500, 800]], 300], [0, 1, 2, 3])], [('regression: end exclusivity', [[[100, 1100], [100, 1100], [400, 500], [400, 700], [400, 450], [500, 550]], 500], [0, 1, 3, 5]), ('regression variant: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair probe: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('partial repair variant: end exclusivity', [[[0, 300], [0, 1000], [100, 1100], [100, 200], [400, 500], [400, 700]], 500], [1, 2, 5]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('normal control', [[[100, 400], [300, 400], [400, 450], [400, 700], [400, 1400]], 0], []), ('normal control', [[[0, 50], [0, 50], [300, 400]], 1200], []), ('normal control', [[[100, 200], [200, 250]], 0], [])], [('regression: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('regression variant: end exclusivity', [[[100, 200], [100, 150], [300, 600], [400, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('partial repair variant: end exclusivity', [[[0, 50], [200, 1200], [200, 300], [300, 400], [400, 700], [500, 600]], 600], [1, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 50], [100, 400], [200, 500], [400, 450], [500, 1500]], 1200], [4]), ('normal control', [[[400, 1400]], 300], []), ('normal control', [[[0, 50]], 400], [])], [('regression: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('regression variant: end exclusivity', [[[0, 1000], [100, 150], [400, 700], [400, 500], [500, 1500]], 500], [0, 2, 4]), ('partial repair probe: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair variant: end exclusivity', [[[0, 1000], [200, 500], [300, 350]], 500], [0]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[0, 100], [0, 100], [100, 150]], 200], []), ('normal control', [[[0, 100], [0, 100], [400, 700], [500, 1500]], 150], []), ('normal control', [[[0, 1000], [300, 1300]], 50], [0])], [('regression: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('regression variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair variant: end exclusivity', [[[0, 1000], [0, 300], [200, 250], [400, 500], [500, 1500], [500, 600]], 500], [0, 4, 5]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('normal control', [[[300, 600], [300, 350], [400, 700], [400, 500]], 600], [2]), ('normal control', [[[0, 300], [100, 1100], [200, 250], [500, 550]], 100], [0, 1])]]
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 exclusivity[1, 3, 4][1, 4]Failed
regression variant: end exclusivity[0, 1, 2][0, 2]Failed
partial repair probe: end exclusivity[0, 1][0]Failed
partial repair variant: end exclusivity[2, 3][2]Failed
boundary control[0, 2][0, 2]Passed
boundary control[1][1]Passed
normal control[1][1]Passed
normal control[0][0]Passed
normal control[0, 1, 2, 3][0, 1, 2, 3]Passed

SHA-256 / 35124d256096cc82601f92c991fde9d579d6efcdbd175259839fcf4e3cb0dcb5

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import bisect
N = 1
observations = []
def solve(cues, t):
    starts=[c[0] for c in cues]
    hi=bisect.bisect_right(starts,t)
    maxend=[]
    run=0
    for c in cues:
        run=max(run,c[1])
        maxend.append(run)
    res=[]
    i=hi-1
    while i>=0 and maxend[i]>t:
        if cues[i][1]>t-1:
            res.append(i)
        i-=1
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end exclusivity', [[[0, 100], [0, 1000], [400, 500], [500, 600], [500, 1500], [500, 550]], 600], [1, 4]), ('regression variant: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair probe: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('partial repair variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 100], [100, 1100], [200, 300], [200, 500]], 50], [0]), ('normal control', [[[100, 400], [300, 400], [300, 400], [300, 350], [400, 500], [500, 800]], 300], [0, 1, 2, 3])], [('regression: end exclusivity', [[[100, 1100], [100, 1100], [400, 500], [400, 700], [400, 450], [500, 550]], 500], [0, 1, 3, 5]), ('regression variant: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair probe: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('partial repair variant: end exclusivity', [[[0, 300], [0, 1000], [100, 1100], [100, 200], [400, 500], [400, 700]], 500], [1, 2, 5]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('normal control', [[[100, 400], [300, 400], [400, 450], [400, 700], [400, 1400]], 0], []), ('normal control', [[[0, 50], [0, 50], [300, 400]], 1200], []), ('normal control', [[[100, 200], [200, 250]], 0], [])], [('regression: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('regression variant: end exclusivity', [[[100, 200], [100, 150], [300, 600], [400, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('partial repair variant: end exclusivity', [[[0, 50], [200, 1200], [200, 300], [300, 400], [400, 700], [500, 600]], 600], [1, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 50], [100, 400], [200, 500], [400, 450], [500, 1500]], 1200], [4]), ('normal control', [[[400, 1400]], 300], []), ('normal control', [[[0, 50]], 400], [])], [('regression: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('regression variant: end exclusivity', [[[0, 1000], [100, 150], [400, 700], [400, 500], [500, 1500]], 500], [0, 2, 4]), ('partial repair probe: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair variant: end exclusivity', [[[0, 1000], [200, 500], [300, 350]], 500], [0]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[0, 100], [0, 100], [100, 150]], 200], []), ('normal control', [[[0, 100], [0, 100], [400, 700], [500, 1500]], 150], []), ('normal control', [[[0, 1000], [300, 1300]], 50], [0])], [('regression: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('regression variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair variant: end exclusivity', [[[0, 1000], [0, 300], [200, 250], [400, 500], [500, 1500], [500, 600]], 500], [0, 4, 5]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('normal control', [[[300, 600], [300, 350], [400, 700], [400, 500]], 600], [2]), ('normal control', [[[0, 300], [100, 1100], [200, 250], [500, 550]], 100], [0, 1])]]
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 exclusivity[1, 3, 4][1, 4]Failed
regression variant: end exclusivity[0, 1, 2][0, 2]Failed
partial repair probe: end exclusivity[0, 1][0]Failed
partial repair variant: end exclusivity[2, 3][2]Failed
boundary control[0, 2][0, 2]Passed
boundary control[1][1]Passed
normal control[1][1]Passed
normal control[0][0]Passed
normal control[0, 1, 2, 3][0, 1, 2, 3]Passed

SHA-256 / a31b4e16261c63e919ad90303c174bc0c0a70e0a22296f1a4d83633035998a25

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import bisect
N = 1
observations = []
def solve(cues, t):
    starts=[c[0] for c in cues]
    hi=bisect.bisect_right(starts,t)
    maxend=[]
    run=0
    for c in cues:
        run=max(run,c[1])
        maxend.append(run)
    res=[]
    i=hi-1
    while i>=0 and maxend[i]>t:
        if cues[i][1]>t:
            res.append(i)
        i-=1
    return sorted(res)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end exclusivity', [[[0, 100], [0, 1000], [400, 500], [500, 600], [500, 1500], [500, 550]], 600], [1, 4]), ('regression variant: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair probe: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('partial repair variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 100], [100, 1100], [200, 300], [200, 500]], 50], [0]), ('normal control', [[[100, 400], [300, 400], [300, 400], [300, 350], [400, 500], [500, 800]], 300], [0, 1, 2, 3])], [('regression: end exclusivity', [[[100, 1100], [100, 1100], [400, 500], [400, 700], [400, 450], [500, 550]], 500], [0, 1, 3, 5]), ('regression variant: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair probe: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('partial repair variant: end exclusivity', [[[0, 300], [0, 1000], [100, 1100], [100, 200], [400, 500], [400, 700]], 500], [1, 2, 5]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('normal control', [[[100, 400], [300, 400], [400, 450], [400, 700], [400, 1400]], 0], []), ('normal control', [[[0, 50], [0, 50], [300, 400]], 1200], []), ('normal control', [[[100, 200], [200, 250]], 0], [])], [('regression: end exclusivity', [[[0, 300], [100, 150], [300, 350], [400, 500]], 150], [0]), ('regression variant: end exclusivity', [[[100, 200], [100, 150], [300, 600], [400, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('partial repair variant: end exclusivity', [[[0, 50], [200, 1200], [200, 300], [300, 400], [400, 700], [500, 600]], 600], [1, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 50], [100, 400], [200, 500], [400, 450], [500, 1500]], 1200], [4]), ('normal control', [[[400, 1400]], 300], []), ('normal control', [[[0, 50]], 400], [])], [('regression: end exclusivity', [[[0, 1000], [0, 1000], [100, 150], [300, 1300], [300, 600], [400, 1400]], 150], [0, 1]), ('regression variant: end exclusivity', [[[0, 1000], [100, 150], [400, 700], [400, 500], [500, 1500]], 500], [0, 2, 4]), ('partial repair probe: end exclusivity', [[[0, 300], [0, 50], [0, 1000], [300, 600], [400, 500], [400, 700]], 50], [0, 2]), ('partial repair variant: end exclusivity', [[[0, 1000], [200, 500], [300, 350]], 500], [0]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[0, 100], [0, 100], [100, 150]], 200], []), ('normal control', [[[0, 100], [0, 100], [400, 700], [500, 1500]], 150], []), ('normal control', [[[0, 1000], [300, 1300]], 50], [0])], [('regression: end exclusivity', [[[200, 500], [300, 400], [300, 1300], [400, 450], [400, 450]], 400], [0, 2, 3, 4]), ('regression variant: end exclusivity', [[[0, 50], [0, 50], [0, 1000], [200, 500]], 500], [2]), ('partial repair probe: end exclusivity', [[[200, 1200], [300, 400], [300, 1300], [400, 700], [500, 550]], 400], [0, 2, 3]), ('partial repair variant: end exclusivity', [[[0, 1000], [0, 300], [200, 250], [400, 500], [500, 1500], [500, 600]], 500], [0, 4, 5]), ('boundary control', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('normal control', [[[300, 600], [300, 350], [400, 700], [400, 500]], 600], [2]), ('normal control', [[[0, 300], [100, 1100], [200, 250], [500, 550]], 100], [0, 1])]]
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 exclusivity[1, 4][1, 4]Passed
regression variant: end exclusivity[0, 2][0, 2]Passed
partial repair probe: end exclusivity[0][0]Passed
partial repair variant: end exclusivity[2][2]Passed
boundary control[0, 2][0, 2]Passed
boundary control[1][1]Passed
normal control[1][1]Passed
normal control[0][0]Passed
normal control[0, 1, 2, 3][0, 1, 2, 3]Passed

SHA-256 / 9772038ab9744dd0c0a99622f43aab683ac31db7cd38113a665010a2939575aa

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:34.028722+00:00.

Case digest / e022131d5b8e4cd904de5f9482c674cc9e8fc248bdfc7c8d63130393d4170661