{"abstract":"The last syllable keeps highlighting after the cue has disappeared.","category":"Subtitle cue timing","checks":7,"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].","contract_signature":"cue, text","evaluation_group":"w2-subtitle-cue-timing-karaoke-syllables","failed_approach":"Clipping to one millisecond before the end shortens syllables that end exactly with the cue.","family":"w2-subtitle-cue-timing-karaoke-syllables-end-clipping","id":"FA-78231","implementations":{"attempt":{"sha256":"c366ff159d3318781ae4e067816a3cfb36d4ee3b819f03c0750f935fe246db24","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re\nN = 1\nobservations = []\ndef solve(cue, text):\n    cs,ce=cue\n    out=[]\n    t=cs\n    for m in re.finditer(r'\\{\\\\(kf|ko|k|K)(\\d+)\\}([^{]*)',text):\n        d=int(m.group(2))*10\n        syl=m.group(3)\n        if syl and t<ce:\n            out.append([syl,t,min(t+d,ce-1)])\n        t+=d\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('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]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"8814acb8fd878106ceed2eda5c8ed7158ec6bd63dabe089773e00e5412392583","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re\nN = 1\nobservations = []\ndef solve(cue, text):\n    cs,ce=cue\n    out=[]\n    t=cs\n    for m in re.finditer(r'\\{\\\\(kf|ko|k|K)(\\d+)\\}([^{]*)',text):\n        d=int(m.group(2))*10\n        syl=m.group(3)\n        if syl and t<ce:\n            out.append([syl,t,t+d])\n        t+=d\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('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]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-subtitle-cue-timing-karaoke-syllables-end-clipping","generated_at":"2026-09-29T14:49:33.367380+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Subtitle timing defects shift, hide or overlap captions that viewers depend on for comprehension and accessibility.","root_cause":"Syllable ends are not clipped to the cue end.","sha256":"f7ba377c187fb606952ae04b3af7258596e5c8fc29edcc312110e0b199a57eec","title":"Karaoke syllable timing: end clipping · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.093,"exit_code":1,"observations":[{"actual":[["a",0,200],["b",200,299]],"check":"regression: end clipping","expected":[["a",0,200],["b",200,300]],"passed":false},{"actual":[["Hel",0,300],[" ",300,499]],"check":"regression variant: end clipping","expected":[["Hel",0,300],[" ",300,500]],"passed":false},{"actual":[["a",0,199]],"check":"partial repair probe: end clipping","expected":[["a",0,200]],"passed":false},{"actual":[["lo",0,0],["la",0,500],["lo",500,799]],"check":"partial repair variant: end clipping","expected":[["lo",0,0],["la",0,500],["lo",500,800]],"passed":false},{"actual":[[" ",1000,1100],["la",1100,1200]],"check":"normal control","expected":[[" ",1000,1100],["la",1100,1200]],"passed":true},{"actual":[[" ",1000,1050],["o ",1300,1350],[" ",1350,1350]],"check":"normal control","expected":[[" ",1000,1050],["o ",1300,1350],[" ",1350,1350]],"passed":true},{"actual":[["lo",1000,1300],[" ",1300,1350]],"check":"normal control","expected":[["lo",1000,1300],[" ",1300,1350]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: end clipping\", \"actual\": [[\"a\", 0, 200], [\"b\", 200, 299]], \"expected\": [[\"a\", 0, 200], [\"b\", 200, 300]], \"passed\": false}, {\"check\": \"regression variant: end clipping\", \"actual\": [[\"Hel\", 0, 300], [\" \", 300, 499]], \"expected\": [[\"Hel\", 0, 300], [\" \", 300, 500]], \"passed\": false}, {\"check\": \"partial repair probe: end clipping\", \"actual\": [[\"a\", 0, 199]], \"expected\": [[\"a\", 0, 200]], \"passed\": false}, {\"check\": \"partial repair variant: end clipping\", \"actual\": [[\"lo\", 0, 0], [\"la\", 0, 500], [\"lo\", 500, 799]], \"expected\": [[\"lo\", 0, 0], [\"la\", 0, 500], [\"lo\", 500, 800]], \"passed\": false}, {\"check\": \"normal control\", \"actual\": [[\" \", 1000, 1100], [\"la\", 1100, 1200]], \"expected\": [[\" \", 1000, 1100], [\"la\", 1100, 1200]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[\" \", 1000, 1050], [\"o \", 1300, 1350], [\" \", 1350, 1350]], \"expected\": [[\" \", 1000, 1050], [\"o \", 1300, 1350], [\" \", 1350, 1350]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[\"lo\", 1000, 1300], [\" \", 1300, 1350]], \"expected\": [[\"lo\", 1000, 1300], [\" \", 1300, 1350]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.882,"exit_code":1,"observations":[{"actual":[["a",0,200],["b",200,400]],"check":"regression: end clipping","expected":[["a",0,200],["b",200,300]],"passed":false},{"actual":[["Hel",0,300],[" ",300,800]],"check":"regression variant: end clipping","expected":[["Hel",0,300],[" ",300,500]],"passed":false},{"actual":[["a",0,200]],"check":"partial repair probe: end clipping","expected":[["a",0,200]],"passed":true},{"actual":[["lo",0,0],["la",0,500],["lo",500,800]],"check":"partial repair variant: end clipping","expected":[["lo",0,0],["la",0,500],["lo",500,800]],"passed":true},{"actual":[[" ",1000,1100],["la",1100,1200]],"check":"normal control","expected":[[" ",1000,1100],["la",1100,1200]],"passed":true},{"actual":[[" ",1000,1050],["o ",1300,1350],[" ",1350,1350]],"check":"normal control","expected":[[" ",1000,1050],["o ",1300,1350],[" ",1350,1350]],"passed":true},{"actual":[["lo",1000,1300],[" ",1300,1350]],"check":"normal control","expected":[["lo",1000,1300],[" ",1300,1350]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: end clipping\", \"actual\": [[\"a\", 0, 200], [\"b\", 200, 400]], \"expected\": [[\"a\", 0, 200], [\"b\", 200, 300]], \"passed\": false}, {\"check\": \"regression variant: end clipping\", \"actual\": [[\"Hel\", 0, 300], [\" \", 300, 800]], \"expected\": [[\"Hel\", 0, 300], [\" \", 300, 500]], \"passed\": false}, {\"check\": \"partial repair probe: end clipping\", \"actual\": [[\"a\", 0, 200]], \"expected\": [[\"a\", 0, 200]], \"passed\": true}, {\"check\": \"partial repair variant: end clipping\", \"actual\": [[\"lo\", 0, 0], [\"la\", 0, 500], [\"lo\", 500, 800]], \"expected\": [[\"lo\", 0, 0], [\"la\", 0, 500], [\"lo\", 500, 800]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[\" \", 1000, 1100], [\"la\", 1100, 1200]], \"expected\": [[\" \", 1000, 1100], [\"la\", 1100, 1200]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[\" \", 1000, 1050], [\"o \", 1300, 1350], [\" \", 1350, 1350]], \"expected\": [[\" \", 1000, 1050], [\"o \", 1300, 1350], [\" \", 1350, 1350]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[\"lo\", 1000, 1300], [\" \", 1300, 1350]], \"expected\": [[\"lo\", 1000, 1300], [\" \", 1300, 1350]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}