FA-78231 / Subtitle cue timing / Open access
Karaoke syllable timing: end clipping · case 01
The last syllable keeps highlighting after the cue has disappeared.
ROOT CAUSE
Syllable ends are not clipped to the cue end.
THE FAILURE
Syllable ends are not clipped to the cue end.
Unsuccessful approach: Clipping to one millisecond before the end shortens syllables that end exactly with the cue.
Case contract
Karaoke text is a sequence of {\k|\K|\kf|\ko<cs>}syllable with durations in centiseconds. Syllable i starts at cue start plus the sum of all previous durations (empty syllables still consume time). Syllables starting at or after the cue end are dropped; others are clipped to the cue end. Output [syllable,start_ms,end_ms].
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 re
N = 1
observations = []
def solve(cue, text):
cs,ce=cue
out=[]
t=cs
for m in re.finditer(r'\{\\(kf|ko|k|K)(\d+)\}([^{]*)',text):
d=int(m.group(2))*10
syl=m.group(3)
if syl and t<ce:
out.append([syl,t,t+d])
t+=d
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end clipping', [[0, 300], '{\\k20}a{\\kf20}b'], [['a', 0, 200], ['b', 200, 300]]), ('regression variant: end clipping', [[0, 500], '{\\kf30}Hel{\\k50} {\\k0}lo'], [['Hel', 0, 300], [' ', 300, 500]]), ('partial repair probe: end clipping', [[0, 200], '{\\k20}a{\\k10}{\\k5}b'], [['a', 0, 200]]), ('partial repair variant: end clipping', [[0, 800], '{\\k0}lo{\\ko50}la{\\kf30}lo'], [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 800]]), ('normal control', [[1000, 1500], '{\\kf10} {\\k10}la'], [[' ', 1000, 1100], ['la', 1100, 1200]]), ('normal control', [[1000, 1500], '{\\ko5} {\\ko25}{\\k5}o {\\k0} '], [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]]), ('normal control', [[1000, 1500], '{\\k30}lo{\\k5} {\\k0}'], [['lo', 1000, 1300], [' ', 1300, 1350]])], [('regression: end clipping', [[1000, 1800], '{\\ko50}{\\kf25}{\\k50} '], [[' ', 1750, 1800]]), ('regression variant: end clipping', [[0, 100], '{\\kf0}{\\k30} {\\k0}o {\\ko5}Hel{\\k10} '], [[' ', 0, 100]]), ('partial repair probe: end clipping', [[0, 100], '{\\ko10}x{\\k1}y'], [['x', 0, 100]]), ('partial repair variant: end clipping', [[1000, 1100], '{\\k5}Hel{\\k5}la'], [['Hel', 1000, 1050], ['la', 1050, 1100]]), ('normal control', [[0, 300], '{\\kf5}lo{\\k5} '], [['lo', 0, 50], [' ', 50, 100]]), ('normal control', [[1000, 3000], '{\\k30}{\\ko0}Hel{\\kf50}la'], [['Hel', 1300, 1300], ['la', 1300, 1800]]), ('normal control', [[1000, 1800], '{\\k25}la{\\ko5}la{\\K5} '], [['la', 1000, 1250], ['la', 1250, 1300], [' ', 1300, 1350]])], [('regression: end clipping', [[0, 300], '{\\k10}la{\\k5}la{\\k50}lo{\\ko25}lo'], [['la', 0, 100], ['la', 100, 150], ['lo', 150, 300]]), ('regression variant: end clipping', [[0, 300], '{\\kf10}{\\kf25}la{\\K10}{\\ko10}o {\\K0}o '], [['la', 100, 300]]), ('partial repair probe: end clipping', [[1000, 1800], '{\\ko50}{\\kf25}{\\k50} '], [[' ', 1750, 1800]]), ('partial repair variant: end clipping', [[0, 500], '{\\ko30}Hel{\\K5}Hel{\\k50}lo{\\K30}{\\k30}lo'], [['Hel', 0, 300], ['Hel', 300, 350], ['lo', 350, 500]]), ('normal control', [[0, 500], '{\\kf10}{\\ko25} {\\k10}o '], [[' ', 100, 350], ['o ', 350, 450]]), ('normal control', [[1000, 1800], '{\\k0}la{\\k30}{\\k0}lo{\\ko30}lo'], [['la', 1000, 1000], ['lo', 1300, 1300], ['lo', 1300, 1600]]), ('normal control', [[0, 500], '{\\ko10}lo'], [['lo', 0, 100]])], [('regression: end clipping', [[0, 300], '{\\ko25}la{\\k25}o {\\kf5}la'], [['la', 0, 250], ['o ', 250, 300]]), ('regression variant: end clipping', [[1000, 1300], '{\\K50}la{\\ko30}Hel{\\k50}Hel{\\K25} '], [['la', 1000, 1300]]), ('partial repair probe: end clipping', [[0, 300], '{\\k10}la{\\k5}la{\\k50}lo{\\ko25}lo'], [['la', 0, 100], ['la', 100, 150], ['lo', 150, 300]]), ('partial repair variant: end clipping', [[0, 500], '{\\kf30}Hel{\\k50} {\\k0}lo'], [['Hel', 0, 300], [' ', 300, 500]]), ('normal control', [[1000, 1300], '{\\ko50}{\\K50}la{\\ko5}lo{\\k25}o '], []), ('normal control', [[1000, 1800], '{\\kf30}lo'], [['lo', 1000, 1300]]), ('normal control', [[1000, 1800], '{\\K25}'], [])], [('regression: end clipping', [[0, 500], '{\\ko30}Hel{\\K5}Hel{\\k50}lo{\\K30}{\\k30}lo'], [['Hel', 0, 300], ['Hel', 300, 350], ['lo', 350, 500]]), ('regression variant: end clipping', [[1000, 1100], '{\\K50}la'], [['la', 1000, 1100]]), ('partial repair probe: end clipping', [[1000, 1500], '{\\K50}o {\\kf50} '], [['o ', 1000, 1500]]), ('partial repair variant: end clipping', [[1000, 1800], '{\\K25}lo{\\K30}o {\\ko25}lo{\\ko10}la'], [['lo', 1000, 1250], ['o ', 1250, 1550], ['lo', 1550, 1800]]), ('normal control', [[0, 300], '{\\k5} '], [[' ', 0, 50]]), ('normal control', [[1000, 3000], '{\\ko50}o {\\kf0}la{\\kf10}lo{\\ko25}'], [['o ', 1000, 1500], ['la', 1500, 1500], ['lo', 1500, 1600]]), ('normal control', [[1000, 3000], '{\\kf30}o {\\k0}o {\\k10}{\\kf10}Hel'], [['o ', 1000, 1300], ['o ', 1300, 1300], ['Hel', 1400, 1500]])]]
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: end clipping | [['a', 0, 200], ['b', 200, 400]] | [['a', 0, 200], ['b', 200, 300]] | Failed |
| regression variant: end clipping | [['Hel', 0, 300], [' ', 300, 800]] | [['Hel', 0, 300], [' ', 300, 500]] | Failed |
| partial repair probe: end clipping | [['a', 0, 200]] | [['a', 0, 200]] | Passed |
| partial repair variant: end clipping | [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 800]] | [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 800]] | Passed |
| normal control | [[' ', 1000, 1100], ['la', 1100, 1200]] | [[' ', 1000, 1100], ['la', 1100, 1200]] | Passed |
| normal control | [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]] | [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]] | Passed |
| normal control | [['lo', 1000, 1300], [' ', 1300, 1350]] | [['lo', 1000, 1300], [' ', 1300, 1350]] | Passed |
SHA-256 / 8814acb8fd878106ceed2eda5c8ed7158ec6bd63dabe089773e00e5412392583
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import re
N = 1
observations = []
def solve(cue, text):
cs,ce=cue
out=[]
t=cs
for m in re.finditer(r'\{\\(kf|ko|k|K)(\d+)\}([^{]*)',text):
d=int(m.group(2))*10
syl=m.group(3)
if syl and t<ce:
out.append([syl,t,min(t+d,ce-1)])
t+=d
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: end clipping', [[0, 300], '{\\k20}a{\\kf20}b'], [['a', 0, 200], ['b', 200, 300]]), ('regression variant: end clipping', [[0, 500], '{\\kf30}Hel{\\k50} {\\k0}lo'], [['Hel', 0, 300], [' ', 300, 500]]), ('partial repair probe: end clipping', [[0, 200], '{\\k20}a{\\k10}{\\k5}b'], [['a', 0, 200]]), ('partial repair variant: end clipping', [[0, 800], '{\\k0}lo{\\ko50}la{\\kf30}lo'], [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 800]]), ('normal control', [[1000, 1500], '{\\kf10} {\\k10}la'], [[' ', 1000, 1100], ['la', 1100, 1200]]), ('normal control', [[1000, 1500], '{\\ko5} {\\ko25}{\\k5}o {\\k0} '], [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]]), ('normal control', [[1000, 1500], '{\\k30}lo{\\k5} {\\k0}'], [['lo', 1000, 1300], [' ', 1300, 1350]])], [('regression: end clipping', [[1000, 1800], '{\\ko50}{\\kf25}{\\k50} '], [[' ', 1750, 1800]]), ('regression variant: end clipping', [[0, 100], '{\\kf0}{\\k30} {\\k0}o {\\ko5}Hel{\\k10} '], [[' ', 0, 100]]), ('partial repair probe: end clipping', [[0, 100], '{\\ko10}x{\\k1}y'], [['x', 0, 100]]), ('partial repair variant: end clipping', [[1000, 1100], '{\\k5}Hel{\\k5}la'], [['Hel', 1000, 1050], ['la', 1050, 1100]]), ('normal control', [[0, 300], '{\\kf5}lo{\\k5} '], [['lo', 0, 50], [' ', 50, 100]]), ('normal control', [[1000, 3000], '{\\k30}{\\ko0}Hel{\\kf50}la'], [['Hel', 1300, 1300], ['la', 1300, 1800]]), ('normal control', [[1000, 1800], '{\\k25}la{\\ko5}la{\\K5} '], [['la', 1000, 1250], ['la', 1250, 1300], [' ', 1300, 1350]])], [('regression: end clipping', [[0, 300], '{\\k10}la{\\k5}la{\\k50}lo{\\ko25}lo'], [['la', 0, 100], ['la', 100, 150], ['lo', 150, 300]]), ('regression variant: end clipping', [[0, 300], '{\\kf10}{\\kf25}la{\\K10}{\\ko10}o {\\K0}o '], [['la', 100, 300]]), ('partial repair probe: end clipping', [[1000, 1800], '{\\ko50}{\\kf25}{\\k50} '], [[' ', 1750, 1800]]), ('partial repair variant: end clipping', [[0, 500], '{\\ko30}Hel{\\K5}Hel{\\k50}lo{\\K30}{\\k30}lo'], [['Hel', 0, 300], ['Hel', 300, 350], ['lo', 350, 500]]), ('normal control', [[0, 500], '{\\kf10}{\\ko25} {\\k10}o '], [[' ', 100, 350], ['o ', 350, 450]]), ('normal control', [[1000, 1800], '{\\k0}la{\\k30}{\\k0}lo{\\ko30}lo'], [['la', 1000, 1000], ['lo', 1300, 1300], ['lo', 1300, 1600]]), ('normal control', [[0, 500], '{\\ko10}lo'], [['lo', 0, 100]])], [('regression: end clipping', [[0, 300], '{\\ko25}la{\\k25}o {\\kf5}la'], [['la', 0, 250], ['o ', 250, 300]]), ('regression variant: end clipping', [[1000, 1300], '{\\K50}la{\\ko30}Hel{\\k50}Hel{\\K25} '], [['la', 1000, 1300]]), ('partial repair probe: end clipping', [[0, 300], '{\\k10}la{\\k5}la{\\k50}lo{\\ko25}lo'], [['la', 0, 100], ['la', 100, 150], ['lo', 150, 300]]), ('partial repair variant: end clipping', [[0, 500], '{\\kf30}Hel{\\k50} {\\k0}lo'], [['Hel', 0, 300], [' ', 300, 500]]), ('normal control', [[1000, 1300], '{\\ko50}{\\K50}la{\\ko5}lo{\\k25}o '], []), ('normal control', [[1000, 1800], '{\\kf30}lo'], [['lo', 1000, 1300]]), ('normal control', [[1000, 1800], '{\\K25}'], [])], [('regression: end clipping', [[0, 500], '{\\ko30}Hel{\\K5}Hel{\\k50}lo{\\K30}{\\k30}lo'], [['Hel', 0, 300], ['Hel', 300, 350], ['lo', 350, 500]]), ('regression variant: end clipping', [[1000, 1100], '{\\K50}la'], [['la', 1000, 1100]]), ('partial repair probe: end clipping', [[1000, 1500], '{\\K50}o {\\kf50} '], [['o ', 1000, 1500]]), ('partial repair variant: end clipping', [[1000, 1800], '{\\K25}lo{\\K30}o {\\ko25}lo{\\ko10}la'], [['lo', 1000, 1250], ['o ', 1250, 1550], ['lo', 1550, 1800]]), ('normal control', [[0, 300], '{\\k5} '], [[' ', 0, 50]]), ('normal control', [[1000, 3000], '{\\ko50}o {\\kf0}la{\\kf10}lo{\\ko25}'], [['o ', 1000, 1500], ['la', 1500, 1500], ['lo', 1500, 1600]]), ('normal control', [[1000, 3000], '{\\kf30}o {\\k0}o {\\k10}{\\kf10}Hel'], [['o ', 1000, 1300], ['o ', 1300, 1300], ['Hel', 1400, 1500]])]]
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: end clipping | [['a', 0, 200], ['b', 200, 299]] | [['a', 0, 200], ['b', 200, 300]] | Failed |
| regression variant: end clipping | [['Hel', 0, 300], [' ', 300, 499]] | [['Hel', 0, 300], [' ', 300, 500]] | Failed |
| partial repair probe: end clipping | [['a', 0, 199]] | [['a', 0, 200]] | Failed |
| partial repair variant: end clipping | [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 799]] | [['lo', 0, 0], ['la', 0, 500], ['lo', 500, 800]] | Failed |
| normal control | [[' ', 1000, 1100], ['la', 1100, 1200]] | [[' ', 1000, 1100], ['la', 1100, 1200]] | Passed |
| normal control | [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]] | [[' ', 1000, 1050], ['o ', 1300, 1350], [' ', 1350, 1350]] | Passed |
| normal control | [['lo', 1000, 1300], [' ', 1300, 1350]] | [['lo', 1000, 1300], [' ', 1300, 1350]] | Passed |
SHA-256 / c366ff159d3318781ae4e067816a3cfb36d4ee3b819f03c0750f935fe246db24
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:33.367380+00:00.
Case digest / f7ba377c187fb606952ae04b3af7258596e5c8fc29edcc312110e0b199a57eec