FA-78311 / Subtitle cue timing / Open access
Active cue lookup with prefix maximum ends: result order · case 01
Active cues are returned from last to first.
ROOT CAUSE
The backward walk order is returned without sorting.
THE FAILURE
The backward walk order is returned without sorting.
Unsuccessful approach: Sorting by end time does not restore index order.
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 res
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: result order', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('regression variant: result order', [[[0, 1000], [100, 1100], [200, 500], [200, 500]], 200], [0, 1, 2, 3]), ('partial repair probe: result order', [[[0, 1000], [200, 300], [400, 450]], 200], [0, 1]), ('partial repair variant: result order', [[[0, 300], [0, 50], [100, 200], [200, 500], [400, 500]], 100], [0, 2]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 100], [100, 1100], [200, 300], [200, 500]], 50], [0]), ('normal control', [[[100, 400], [300, 400], [400, 450], [400, 700], [400, 1400]], 0], [])], [('regression: result order', [[[100, 400], [300, 400], [300, 400], [300, 350], [400, 500], [500, 800]], 300], [0, 1, 2, 3]), ('regression variant: result order', [[[0, 100], [0, 1000], [400, 500], [500, 600], [500, 1500], [500, 550]], 600], [1, 4]), ('partial repair probe: result order', [[[100, 400], [300, 350], [500, 550]], 300], [0, 1]), ('partial repair variant: result order', [[[200, 250], [200, 1200], [300, 350], [300, 350], [400, 700]], 600], [1, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 50], [0, 50], [300, 400]], 1200], []), ('normal control', [[[0, 50], [100, 400], [200, 500], [400, 450], [500, 1500]], 1200], [4]), ('normal control', [[[0, 300], [500, 550]], 50], [0])], [('regression: result order', [[[0, 1000], [200, 300], [400, 450]], 200], [0, 1]), ('regression variant: result order', [[[0, 100], [0, 1000], [300, 1300]], 500], [1, 2]), ('partial repair probe: result order', [[[0, 1000], [100, 1100], [200, 500], [200, 500]], 200], [0, 1, 2, 3]), ('partial repair variant: result order', [[[0, 1000], [0, 300], [100, 1100], [100, 150], [100, 150], [400, 500]], 200], [0, 1, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 100], [0, 100], [100, 150]], 200], []), ('normal control', [[[0, 1000], [300, 1300]], 50], [0]), ('normal control', [[[100, 400], [300, 1300]], 0], [])], [('regression: result order', [[[100, 1100], [200, 1200], [300, 1300], [400, 450], [400, 500], [400, 500]], 300], [0, 1, 2]), ('regression variant: result order', [[[0, 100], [200, 1200], [300, 400], [500, 800]], 600], [1, 3]), ('partial repair probe: result order', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('partial repair variant: result order', [[[0, 300], [100, 150], [200, 250]], 100], [0, 1]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[300, 600], [300, 350], [400, 700], [400, 500]], 600], [2]), ('normal control', [[[400, 450]], 150], []), ('normal control', [[[200, 300]], 150], [])], [('regression: result order', [[[100, 400], [300, 350], [500, 550]], 300], [0, 1]), ('regression variant: result order', [[[200, 500], [200, 1200], [500, 600]], 400], [0, 1]), ('partial repair probe: result order', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('partial repair variant: result order', [[[0, 100], [200, 1200], [200, 250], [200, 1200], [500, 600]], 500], [1, 3, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[500, 1500]], 1499], [0]), ('normal control', [[[300, 600]], 600], []), ('normal control', [[[200, 250], [200, 300], [300, 350], [400, 1400], [500, 550]], 1499], [])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: result order | [2, 0] | [0, 2] | Failed |
| regression variant: result order | [3, 2, 1, 0] | [0, 1, 2, 3] | Failed |
| partial repair probe: result order | [1, 0] | [0, 1] | Failed |
| partial repair variant: result order | [2, 0] | [0, 2] | Failed |
| boundary control | [1] | [1] | Passed |
| boundary control | [] | [] | Passed |
| normal control | [1] | [1] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [] | [] | Passed |
SHA-256 / 60d1e738cd7ab5d309f99bb9cc05f07a115a219ff98aba9f57c61e29ddca61fa
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:
res.append(i)
i-=1
return sorted(res,key=lambda k:cues[k][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: result order', [[[0, 1000], [100, 200], [300, 400]], 350], [0, 2]), ('regression variant: result order', [[[0, 1000], [100, 1100], [200, 500], [200, 500]], 200], [0, 1, 2, 3]), ('partial repair probe: result order', [[[0, 1000], [200, 300], [400, 450]], 200], [0, 1]), ('partial repair variant: result order', [[[0, 300], [0, 50], [100, 200], [200, 500], [400, 500]], 100], [0, 2]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 100], [100, 1100], [200, 300], [200, 500]], 50], [0]), ('normal control', [[[100, 400], [300, 400], [400, 450], [400, 700], [400, 1400]], 0], [])], [('regression: result order', [[[100, 400], [300, 400], [300, 400], [300, 350], [400, 500], [500, 800]], 300], [0, 1, 2, 3]), ('regression variant: result order', [[[0, 100], [0, 1000], [400, 500], [500, 600], [500, 1500], [500, 550]], 600], [1, 4]), ('partial repair probe: result order', [[[100, 400], [300, 350], [500, 550]], 300], [0, 1]), ('partial repair variant: result order', [[[200, 250], [200, 1200], [300, 350], [300, 350], [400, 700]], 600], [1, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[0, 50], [0, 50], [300, 400]], 1200], []), ('normal control', [[[0, 50], [100, 400], [200, 500], [400, 450], [500, 1500]], 1200], [4]), ('normal control', [[[0, 300], [500, 550]], 50], [0])], [('regression: result order', [[[0, 1000], [200, 300], [400, 450]], 200], [0, 1]), ('regression variant: result order', [[[0, 100], [0, 1000], [300, 1300]], 500], [1, 2]), ('partial repair probe: result order', [[[0, 1000], [100, 1100], [200, 500], [200, 500]], 200], [0, 1, 2, 3]), ('partial repair variant: result order', [[[0, 1000], [0, 300], [100, 1100], [100, 150], [100, 150], [400, 500]], 200], [0, 1, 2]), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('normal control', [[[0, 100], [0, 100], [100, 150]], 200], []), ('normal control', [[[0, 1000], [300, 1300]], 50], [0]), ('normal control', [[[100, 400], [300, 1300]], 0], [])], [('regression: result order', [[[100, 1100], [200, 1200], [300, 1300], [400, 450], [400, 500], [400, 500]], 300], [0, 1, 2]), ('regression variant: result order', [[[0, 100], [200, 1200], [300, 400], [500, 800]], 600], [1, 3]), ('partial repair probe: result order', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('partial repair variant: result order', [[[0, 300], [100, 150], [200, 250]], 100], [0, 1]), ('boundary control', [[[0, 100], [100, 200]], 100], [1]), ('boundary control', [[[0, 100]], 100], []), ('normal control', [[[300, 600], [300, 350], [400, 700], [400, 500]], 600], [2]), ('normal control', [[[400, 450]], 150], []), ('normal control', [[[200, 300]], 150], [])], [('regression: result order', [[[100, 400], [300, 350], [500, 550]], 300], [0, 1]), ('regression variant: result order', [[[200, 500], [200, 1200], [500, 600]], 400], [0, 1]), ('partial repair probe: result order', [[[0, 1000], [100, 150], [100, 400], [200, 1200]], 300], [0, 2, 3]), ('partial repair variant: result order', [[[0, 100], [200, 1200], [200, 250], [200, 1200], [500, 600]], 500], [1, 3, 4]), ('boundary control', [[[0, 100]], 100], []), ('boundary control', [[[0, 50], [0, 500], [200, 250]], 300], [1]), ('normal control', [[[500, 1500]], 1499], [0]), ('normal control', [[[300, 600]], 600], []), ('normal control', [[[200, 250], [200, 300], [300, 350], [400, 1400], [500, 550]], 1499], [])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: result order | [2, 0] | [0, 2] | Failed |
| regression variant: result order | [3, 2, 0, 1] | [0, 1, 2, 3] | Failed |
| partial repair probe: result order | [1, 0] | [0, 1] | Failed |
| partial repair variant: result order | [2, 0] | [0, 2] | Failed |
| boundary control | [1] | [1] | Passed |
| boundary control | [] | [] | Passed |
| normal control | [1] | [1] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [] | [] | Passed |
SHA-256 / cdd9ed4f14b9520b5e28f9c7fb5992fbd194737c1a0e890bd2729c5726d3e5f8
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 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:34.040273+00:00.
Case digest / 8869a22de22231ccbaf5aaf7b9772680a676cb747e74d4d46a88dae157da18ad