FA-78046 / Subtitle cue timing / Open access
Overlapping cue row stacking: processing order · case 01
Long cues that start first are pushed up by shorter later cues.
ROOT CAUSE
Cues are processed in end-time order.
VERIFIED REPAIR
Process cues by start time, breaking ties by input index.
Unsuccessful approach: Reversing the tie-break swaps rows of cues that start together.
Case contract
Assign overlapping cues to display rows. Cues are processed by (start, input index); a row is free at time t when the last cue placed there ended at or before t (end exclusive). Each cue takes the lowest free row, or opens a new row. Return the row of each cue in input order.
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):
order=sorted(range(len(cues)),key=lambda i:(cues[i][1],i))
row_end=[]
rows=[0]*len(cues)
for i in order:
s,e=cues[i]
for r in range(len(row_end)):
if row_end[r]<=s:
row_end[r]=e
rows[i]=r
break
else:
row_end.append(e)
rows[i]=len(row_end)-1
return rows
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: processing order', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('regression variant: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair probe: processing order', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('partial repair variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0]), ('normal control', [[[200, 300], [500, 900]]], [0, 0])], [('regression: processing order', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('regression variant: processing order', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0]), ('partial repair probe: processing order', [[[0, 300], [0, 400]]], [0, 1]), ('partial repair variant: processing order', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[0, 400], [300, 600]]], [0, 1]), ('normal control', [[[100, 101]]], [0]), ('normal control', [[[1000, 1100], [200, 500]]], [0, 0])], [('regression: processing order', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: processing order', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('partial repair variant: processing order', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('normal control', [[[300, 1200], [0, 200]]], [0, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: processing order', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: processing order', [[[100, 1000], [300, 301], [300, 500], [500, 501]]], [0, 1, 2, 1]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[500, 1400]]], [0]), ('normal control', [[[200, 201], [100, 101]]], [0, 0]), ('normal control', [[[100, 1000], [300, 1200], [0, 1]]], [0, 1, 0])], [('regression: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: processing order', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[300, 1200], [1000, 1400], [200, 201]]], [0, 1, 0]), ('normal control', [[[1000, 1900], [200, 500], [300, 1200], [500, 1400]]], [2, 0, 1, 0]), ('normal control', [[[1000, 1100], [200, 300], [300, 700], [500, 1400]]], [0, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: processing order | [1, 0, 0] | [0, 1, 1] | Failed |
| regression variant: processing order | [1, 2, 0, 0, 1] | [0, 0, 1, 1, 2] | Failed |
| partial repair probe: processing order | [0, 0, 1, 1, 2, 0] | [0, 0, 1, 1, 2, 0] | Passed |
| partial repair variant: processing order | [0, 0, 0, 1, 0, 2] | [0, 2, 0, 0, 0, 1] | Failed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0, 0] | [0, 0] | Passed |
SHA-256 / fdb5acdca155665849272376179ab19964b518ba428936cd6d652085231b418c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(cues):
order=sorted(range(len(cues)),key=lambda i:(cues[i][0],-i))
row_end=[]
rows=[0]*len(cues)
for i in order:
s,e=cues[i]
for r in range(len(row_end)):
if row_end[r]<=s:
row_end[r]=e
rows[i]=r
break
else:
row_end.append(e)
rows[i]=len(row_end)-1
return rows
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: processing order', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('regression variant: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair probe: processing order', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('partial repair variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0]), ('normal control', [[[200, 300], [500, 900]]], [0, 0])], [('regression: processing order', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('regression variant: processing order', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0]), ('partial repair probe: processing order', [[[0, 300], [0, 400]]], [0, 1]), ('partial repair variant: processing order', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[0, 400], [300, 600]]], [0, 1]), ('normal control', [[[100, 101]]], [0]), ('normal control', [[[1000, 1100], [200, 500]]], [0, 0])], [('regression: processing order', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: processing order', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('partial repair variant: processing order', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('normal control', [[[300, 1200], [0, 200]]], [0, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: processing order', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: processing order', [[[100, 1000], [300, 301], [300, 500], [500, 501]]], [0, 1, 2, 1]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[500, 1400]]], [0]), ('normal control', [[[200, 201], [100, 101]]], [0, 0]), ('normal control', [[[100, 1000], [300, 1200], [0, 1]]], [0, 1, 0])], [('regression: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: processing order', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[300, 1200], [1000, 1400], [200, 201]]], [0, 1, 0]), ('normal control', [[[1000, 1900], [200, 500], [300, 1200], [500, 1400]]], [2, 0, 1, 0]), ('normal control', [[[1000, 1100], [200, 300], [300, 700], [500, 1400]]], [0, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: processing order | [0, 1, 1] | [0, 1, 1] | Passed |
| regression variant: processing order | [1, 0, 0, 2, 1] | [0, 0, 1, 1, 2] | Failed |
| partial repair probe: processing order | [1, 0, 2, 0, 1, 0] | [0, 0, 1, 1, 2, 0] | Failed |
| partial repair variant: processing order | [0, 2, 1, 1, 1, 0] | [0, 2, 0, 0, 0, 1] | Failed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0, 0] | [0, 0] | Passed |
SHA-256 / eb68bcee37164993e6ec687e0281458c99fb9c17db34c287ec84c83d436f8d35
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(cues):
order=sorted(range(len(cues)),key=lambda i:(cues[i][0],i))
row_end=[]
rows=[0]*len(cues)
for i in order:
s,e=cues[i]
for r in range(len(row_end)):
if row_end[r]<=s:
row_end[r]=e
rows[i]=r
break
else:
row_end.append(e)
rows[i]=len(row_end)-1
return rows
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: processing order', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('regression variant: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair probe: processing order', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('partial repair variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0]), ('normal control', [[[200, 300], [500, 900]]], [0, 0])], [('regression: processing order', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('regression variant: processing order', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0]), ('partial repair probe: processing order', [[[0, 300], [0, 400]]], [0, 1]), ('partial repair variant: processing order', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[0, 400], [300, 600]]], [0, 1]), ('normal control', [[[100, 101]]], [0]), ('normal control', [[[1000, 1100], [200, 500]]], [0, 0])], [('regression: processing order', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: processing order', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('partial repair variant: processing order', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('normal control', [[[300, 1200], [0, 200]]], [0, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: processing order', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: processing order', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: processing order', [[[100, 1000], [300, 301], [300, 500], [500, 501]]], [0, 1, 2, 1]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[500, 1400]]], [0]), ('normal control', [[[200, 201], [100, 101]]], [0, 0]), ('normal control', [[[100, 1000], [300, 1200], [0, 1]]], [0, 1, 0])], [('regression: processing order', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: processing order', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: processing order', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: processing order', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[300, 1200], [1000, 1400], [200, 201]]], [0, 1, 0]), ('normal control', [[[1000, 1900], [200, 500], [300, 1200], [500, 1400]]], [2, 0, 1, 0]), ('normal control', [[[1000, 1100], [200, 300], [300, 700], [500, 1400]]], [0, 0, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: processing order | [0, 1, 1] | [0, 1, 1] | Passed |
| regression variant: processing order | [0, 0, 1, 1, 2] | [0, 0, 1, 1, 2] | Passed |
| partial repair probe: processing order | [0, 0, 1, 1, 2, 0] | [0, 0, 1, 1, 2, 0] | Passed |
| partial repair variant: processing order | [0, 2, 0, 0, 0, 1] | [0, 2, 0, 0, 0, 1] | Passed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0, 0] | [0, 0] | Passed |
SHA-256 / b3b9717186ea126325ed8c3893161e29946082d9a46da8fac56d0b31fe5bab9d
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:31.427827+00:00.
Case digest / a2448a9d0b857a322e3160ce849370f1271f40442da206dec185c988e383b5b8