FA-78051 / Subtitle cue timing / Open access
Overlapping cue row stacking: lowest row choice · case 01
Free bottom rows stay empty while captions sit high on screen.
ROOT CAUSE
Rows are scanned from the highest index downward.
VERIFIED REPAIR
Scan rows from the lowest index upward.
Unsuccessful approach: Choosing the earliest-freed row instead of the lowest free row still places cues above empty lower rows.
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][0],i))
row_end=[]
rows=[0]*len(cues)
for i in order:
s,e=cues[i]
for r in reversed(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: lowest row choice', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: lowest row choice', [[[0, 400], [1000, 1400], [500, 700], [200, 400], [100, 1000]]], [0, 0, 0, 2, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0])], [('regression: lowest row choice', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('regression variant: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: lowest row choice', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[1000, 1400]]], [0]), ('normal control', [[[0, 900]]], [0]), ('normal control', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0])], [('regression: lowest row choice', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair variant: lowest row choice', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[500, 600], [0, 400]]], [0, 0]), ('normal control', [[[300, 700]]], [0]), ('normal control', [[[1000, 1900], [100, 200], [500, 501], [200, 1100], [300, 301]]], [1, 0, 1, 0, 1])], [('regression: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: lowest row choice', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair variant: lowest row choice', [[[300, 600], [300, 600], [200, 1100], [300, 500], [1000, 1001]]], [1, 2, 0, 3, 1]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[0, 900], [200, 1100]]], [0, 1]), ('normal control', [[[500, 700], [300, 1200]]], [1, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('regression variant: lowest row choice', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair variant: lowest row choice', [[[500, 501], [100, 400], [1000, 1900], [0, 300]]], [0, 1, 0, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[300, 301], [0, 900], [0, 900], [0, 400], [0, 300]]], [3, 0, 1, 2, 3]), ('normal control', [[[300, 500], [0, 200], [500, 700], [500, 800]]], [0, 0, 0, 1]), ('normal control', [[[200, 201], [100, 101]]], [0, 0])]]
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: lowest row choice | [1, 0, 1, 1] | [1, 0, 0, 1] | Failed |
| regression variant: lowest row choice | [0, 1, 1] | [0, 1, 0] | Failed |
| partial repair probe: lowest row choice | [1, 2, 2, 0, 0, 2] | [1, 0, 0, 2, 0, 2] | Failed |
| partial repair variant: lowest row choice | [0, 2, 2, 2, 1] | [0, 0, 0, 2, 1] | Failed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
SHA-256 / f620f89e4b2e9c001d6b2294250be602644aa3bfc68fbfc68642bb2fa58facd8
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 sorted(range(len(row_end)),key=lambda r:row_end[r]):
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: lowest row choice', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: lowest row choice', [[[0, 400], [1000, 1400], [500, 700], [200, 400], [100, 1000]]], [0, 0, 0, 2, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0])], [('regression: lowest row choice', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('regression variant: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: lowest row choice', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[1000, 1400]]], [0]), ('normal control', [[[0, 900]]], [0]), ('normal control', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0])], [('regression: lowest row choice', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair variant: lowest row choice', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[500, 600], [0, 400]]], [0, 0]), ('normal control', [[[300, 700]]], [0]), ('normal control', [[[1000, 1900], [100, 200], [500, 501], [200, 1100], [300, 301]]], [1, 0, 1, 0, 1])], [('regression: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: lowest row choice', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair variant: lowest row choice', [[[300, 600], [300, 600], [200, 1100], [300, 500], [1000, 1001]]], [1, 2, 0, 3, 1]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[0, 900], [200, 1100]]], [0, 1]), ('normal control', [[[500, 700], [300, 1200]]], [1, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('regression variant: lowest row choice', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair variant: lowest row choice', [[[500, 501], [100, 400], [1000, 1900], [0, 300]]], [0, 1, 0, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[300, 301], [0, 900], [0, 900], [0, 400], [0, 300]]], [3, 0, 1, 2, 3]), ('normal control', [[[300, 500], [0, 200], [500, 700], [500, 800]]], [0, 0, 0, 1]), ('normal control', [[[200, 201], [100, 101]]], [0, 0])]]
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: lowest row choice | [1, 0, 0, 1] | [1, 0, 0, 1] | Passed |
| regression variant: lowest row choice | [0, 1, 1] | [0, 1, 0] | Failed |
| partial repair probe: lowest row choice | [1, 0, 2, 0, 0, 2] | [1, 0, 0, 2, 0, 2] | Failed |
| partial repair variant: lowest row choice | [0, 2, 0, 2, 1] | [0, 0, 0, 2, 1] | Failed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
SHA-256 / 2e8ccf24681ffa223186c34a65afa0f93834ed4ba201f5202c0bba2ed8923f8d
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: lowest row choice', [[[200, 500], [0, 900], [1000, 1100], [500, 900]]], [1, 0, 0, 1]), ('regression variant: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair probe: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('partial repair variant: lowest row choice', [[[0, 400], [1000, 1400], [500, 700], [200, 400], [100, 1000]]], [0, 0, 0, 2, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[1000, 1001]]], [0]), ('normal control', [[[100, 1000]]], [0])], [('regression: lowest row choice', [[[500, 700], [200, 400], [300, 400], [500, 900], [300, 500], [1000, 1400]]], [0, 0, 1, 1, 2, 0]), ('regression variant: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair probe: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('partial repair variant: lowest row choice', [[[1000, 1300], [500, 800], [0, 400], [100, 400]]], [0, 0, 0, 1]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('normal control', [[[1000, 1400]]], [0]), ('normal control', [[[0, 900]]], [0]), ('normal control', [[[300, 1200], [1000, 1100], [300, 301], [100, 101]]], [0, 1, 1, 0])], [('regression: lowest row choice', [[[1000, 1900], [100, 1000], [500, 900], [500, 501], [500, 900], [200, 300]]], [0, 0, 1, 2, 3, 1]), ('regression variant: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair probe: lowest row choice', [[[100, 500], [200, 300], [1000, 1100]]], [0, 1, 0]), ('partial repair variant: lowest row choice', [[[0, 400], [200, 1100], [500, 700], [0, 1], [0, 900], [200, 201]]], [0, 1, 0, 1, 2, 3]), ('boundary control', [[[0, 100]]], [0]), ('boundary control', [[[0, 300], [100, 200], [200, 400]]], [0, 1, 1]), ('normal control', [[[500, 600], [0, 400]]], [0, 0]), ('normal control', [[[300, 700]]], [0]), ('normal control', [[[1000, 1900], [100, 200], [500, 501], [200, 1100], [300, 301]]], [1, 0, 1, 0, 1])], [('regression: lowest row choice', [[[100, 1000], [500, 600], [200, 500], [200, 500], [0, 200], [100, 101]]], [1, 0, 0, 2, 0, 2]), ('regression variant: lowest row choice', [[[200, 201], [300, 500], [200, 201], [1000, 1300], [300, 400], [0, 200]]], [0, 0, 1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[500, 800], [300, 400], [1000, 1200], [300, 600], [500, 600], [200, 300]]], [0, 0, 0, 1, 2, 0]), ('partial repair variant: lowest row choice', [[[300, 600], [300, 600], [200, 1100], [300, 500], [1000, 1001]]], [1, 2, 0, 3, 1]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('boundary control', [[[0, 100]]], [0]), ('normal control', [[[0, 900], [200, 1100]]], [0, 1]), ('normal control', [[[500, 700], [300, 1200]]], [1, 0]), ('normal control', [[[200, 600], [300, 700], [100, 200]]], [0, 1, 0])], [('regression: lowest row choice', [[[0, 300], [500, 1400], [0, 1], [1000, 1001], [1000, 1300]]], [0, 0, 1, 1, 2]), ('regression variant: lowest row choice', [[[200, 500], [1000, 1100], [1000, 1200], [0, 900]]], [1, 0, 1, 0]), ('partial repair probe: lowest row choice', [[[1000, 1900], [200, 500], [0, 1], [100, 500], [500, 700], [0, 900]]], [0, 2, 0, 0, 0, 1]), ('partial repair variant: lowest row choice', [[[500, 501], [100, 400], [1000, 1900], [0, 300]]], [0, 1, 0, 0]), ('boundary control', [[[0, 100], [100, 200]]], [0, 0]), ('boundary control', [[[0, 500], [0, 100], [100, 200]]], [0, 1, 1]), ('normal control', [[[300, 301], [0, 900], [0, 900], [0, 400], [0, 300]]], [3, 0, 1, 2, 3]), ('normal control', [[[300, 500], [0, 200], [500, 700], [500, 800]]], [0, 0, 0, 1]), ('normal control', [[[200, 201], [100, 101]]], [0, 0])]]
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: lowest row choice | [1, 0, 0, 1] | [1, 0, 0, 1] | Passed |
| regression variant: lowest row choice | [0, 1, 0] | [0, 1, 0] | Passed |
| partial repair probe: lowest row choice | [1, 0, 0, 2, 0, 2] | [1, 0, 0, 2, 0, 2] | Passed |
| partial repair variant: lowest row choice | [0, 0, 0, 2, 1] | [0, 0, 0, 2, 1] | Passed |
| boundary control | [0, 0] | [0, 0] | Passed |
| boundary control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0, 1, 1] | [0, 1, 1] | Passed |
| normal control | [0] | [0] | Passed |
| normal control | [0] | [0] | Passed |
SHA-256 / 566919836dc3caad724e5d2180544d2521647d04e366fcbf8f6517e18cefbe6d
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.431584+00:00.
Case digest / 7d73a14d673f60522709cde98bb45d3f149dde94ca2d1a5bf7e0fbf54f53d227