{"abstract":"After a PAL speed-up conversion subtitles drift later and later behind the dialogue.","category":"Subtitle cue timing","checks":9,"contract":"Cue times authored against a src frame rate are rescaled for playback at dst by t*src/dst, rounded half up to integer ms. Rates are \"N\", \"N/D\", or the aliases \"23.976\"/\"29.97\" meaning (N+1)*1000/1001. The end is rounded independently; an end that does not exceed the start becomes start+1.","contract_signature":"cues, src, dst","evaluation_group":"w2-subtitle-cue-timing-frame-rate-retime","failed_approach":"Choosing whichever ratio exceeds one fixes speed-ups but still inverts slow-down conversions.","family":"w2-subtitle-cue-timing-frame-rate-retime-scale-direction","id":"FA-77916","implementations":{"attempt":{"sha256":"ebf332296b2f89060448f91d72126fbc33edef15bac451537a6967f0137d4e42","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(cues, src, dst):\n    def rate(r):\n        if '/' in r:\n            a,b=r.split('/')\n            return Fraction(int(a),int(b))\n        if '.' in r:\n            return Fraction(int(float(r)+0.5)*1000,1001)\n        return Fraction(int(r))\n    k=rate(src)/rate(dst) if rate(src)>rate(dst) else rate(dst)/rate(src)\n    out=[]\n    for start,end in cues:\n        rs=math.floor(start*k+Fraction(1,2))\n        re_=math.floor(end*k+Fraction(1,2))\n        if re_<=rs:\n            re_=rs+1\n        out.append([rs,re_])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: scale direction', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('regression variant: scale direction', [[[268354, 268356], [12345, 14346], [0, 42]], '60', '25'], [[644050, 644054], [29628, 34430], [0, 101]]), ('partial repair probe: scale direction', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('partial repair variant: scale direction', [[[7, 2849], [7, 10], [1, 1001], [7, 3995]], '15', '29.97'], [[4, 1426], [4, 5], [1, 501], [4, 1999]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[1, 1001]], '30000/1001', '29.97'], [[1, 1001]]), ('normal control', [[[999, 2714], [12345, 13345], [1, 2002]], '29.97', '30000/1001'], [[999, 2714], [12345, 13345], [1, 2002]]), ('normal control', [[[1001, 1003], [7, 4855], [12345, 13345]], '50', '50'], [[1001, 1003], [7, 4855], [12345, 13345]])], [('regression: scale direction', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('regression variant: scale direction', [[[999, 3000], [3, 1003], [999, 2960]], '23.976', '60'], [[399, 1199], [1, 401], [399, 1183]]), ('partial repair probe: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair variant: scale direction', [[[1, 3], [1, 4]], '12', '30'], [[0, 1], [0, 2]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('normal control', [[[7, 9], [3, 6], [0, 3], [1, 4]], '24', '23.976'], [[7, 9], [3, 6], [0, 3], [1, 4]]), ('normal control', [[[1001, 1004], [1001, 2001]], '12', '12'], [[1001, 1004], [1001, 2001]]), ('normal control', [[[999, 1999], [3, 2004]], '29.97', '30000/1001'], [[999, 1999], [3, 2004]])], [('regression: scale direction', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('regression variant: scale direction', [[[1, 4], [7, 9], [12345, 14346], [1001, 1002]], '24000/1001', '12'], [[2, 8], [14, 18], [24665, 28663], [2000, 2002]]), ('partial repair probe: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair variant: scale direction', [[[1001, 2001]], '15', '30'], [[501, 1001]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[0, 1]], '30000/1001', '30000/1001'], [[0, 1]]), ('normal control', [[[7, 9], [3, 4], [0, 1]], '30', '29.97'], [[7, 9], [3, 4], [0, 1]]), ('normal control', [[[7, 10], [3, 5]], '29.97', '29.97'], [[7, 10], [3, 5]])], [('regression: scale direction', [[[540231, 541231], [0, 3]], '50', '29.97'], [[901285, 902954], [0, 5]]), ('regression variant: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair probe: scale direction', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair variant: scale direction', [[[1, 4]], '24000/1001', '50'], [[0, 2]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('normal control', [[[1, 2002], [3, 6]], '50', '50'], [[1, 2002], [3, 6]]), ('normal control', [[[1, 2002], [7, 1007], [468417, 472572], [3, 4259]], '12', '12'], [[1, 2002], [7, 1007], [468417, 472572], [3, 4259]]), ('normal control', [[[1, 4], [1, 4]], '50', '50'], [[1, 4], [1, 4]])], [('regression: scale direction', [[[269050, 271051]], '30000/1001', '23.976'], [[336313, 338814]]), ('regression variant: scale direction', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair probe: scale direction', [[[999, 4970]], '30', '60'], [[500, 2485]]), ('partial repair variant: scale direction', [[[1, 4995]], '25', '50'], [[1, 2498]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[0, 2]], '30000/1001', '29.97'], [[0, 2]]), ('normal control', [[[12345, 14346], [885325, 885327]], '24000/1001', '24000/1001'], [[12345, 14346], [885325, 885327]]), ('normal control', [[[1001, 3002]], '30000/1001', '30000/1001'], [[1001, 3002]])]]\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":"ea4ed75986eb0a7ea4c3c3b3a2c3d67b17917181913e1ab969f7e84429990587","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(cues, src, dst):\n    def rate(r):\n        if '/' in r:\n            a,b=r.split('/')\n            return Fraction(int(a),int(b))\n        if '.' in r:\n            return Fraction(int(float(r)+0.5)*1000,1001)\n        return Fraction(int(r))\n    k=rate(dst)/rate(src)\n    out=[]\n    for start,end in cues:\n        rs=math.floor(start*k+Fraction(1,2))\n        re_=math.floor(end*k+Fraction(1,2))\n        if re_<=rs:\n            re_=rs+1\n        out.append([rs,re_])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: scale direction', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('regression variant: scale direction', [[[268354, 268356], [12345, 14346], [0, 42]], '60', '25'], [[644050, 644054], [29628, 34430], [0, 101]]), ('partial repair probe: scale direction', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('partial repair variant: scale direction', [[[7, 2849], [7, 10], [1, 1001], [7, 3995]], '15', '29.97'], [[4, 1426], [4, 5], [1, 501], [4, 1999]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[1, 1001]], '30000/1001', '29.97'], [[1, 1001]]), ('normal control', [[[999, 2714], [12345, 13345], [1, 2002]], '29.97', '30000/1001'], [[999, 2714], [12345, 13345], [1, 2002]]), ('normal control', [[[1001, 1003], [7, 4855], [12345, 13345]], '50', '50'], [[1001, 1003], [7, 4855], [12345, 13345]])], [('regression: scale direction', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('regression variant: scale direction', [[[999, 3000], [3, 1003], [999, 2960]], '23.976', '60'], [[399, 1199], [1, 401], [399, 1183]]), ('partial repair probe: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair variant: scale direction', [[[1, 3], [1, 4]], '12', '30'], [[0, 1], [0, 2]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('normal control', [[[7, 9], [3, 6], [0, 3], [1, 4]], '24', '23.976'], [[7, 9], [3, 6], [0, 3], [1, 4]]), ('normal control', [[[1001, 1004], [1001, 2001]], '12', '12'], [[1001, 1004], [1001, 2001]]), ('normal control', [[[999, 1999], [3, 2004]], '29.97', '30000/1001'], [[999, 1999], [3, 2004]])], [('regression: scale direction', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('regression variant: scale direction', [[[1, 4], [7, 9], [12345, 14346], [1001, 1002]], '24000/1001', '12'], [[2, 8], [14, 18], [24665, 28663], [2000, 2002]]), ('partial repair probe: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair variant: scale direction', [[[1001, 2001]], '15', '30'], [[501, 1001]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[0, 1]], '30000/1001', '30000/1001'], [[0, 1]]), ('normal control', [[[7, 9], [3, 4], [0, 1]], '30', '29.97'], [[7, 9], [3, 4], [0, 1]]), ('normal control', [[[7, 10], [3, 5]], '29.97', '29.97'], [[7, 10], [3, 5]])], [('regression: scale direction', [[[540231, 541231], [0, 3]], '50', '29.97'], [[901285, 902954], [0, 5]]), ('regression variant: scale direction', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair probe: scale direction', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair variant: scale direction', [[[1, 4]], '24000/1001', '50'], [[0, 2]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('normal control', [[[1, 2002], [3, 6]], '50', '50'], [[1, 2002], [3, 6]]), ('normal control', [[[1, 2002], [7, 1007], [468417, 472572], [3, 4259]], '12', '12'], [[1, 2002], [7, 1007], [468417, 472572], [3, 4259]]), ('normal control', [[[1, 4], [1, 4]], '50', '50'], [[1, 4], [1, 4]])], [('regression: scale direction', [[[269050, 271051]], '30000/1001', '23.976'], [[336313, 338814]]), ('regression variant: scale direction', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair probe: scale direction', [[[999, 4970]], '30', '60'], [[500, 2485]]), ('partial repair variant: scale direction', [[[1, 4995]], '25', '50'], [[1, 2498]]), ('boundary control', [[[5, 6]], '24', '25'], [[5, 6]]), ('boundary control', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('normal control', [[[0, 2]], '30000/1001', '29.97'], [[0, 2]]), ('normal control', [[[12345, 14346], [885325, 885327]], '24000/1001', '24000/1001'], [[12345, 14346], [885325, 885327]]), ('normal control', [[[1001, 3002]], '30000/1001', '30000/1001'], [[1001, 3002]])]]\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-frame-rate-retime-scale-direction","generated_at":"2026-09-29T14:49:30.387836+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":"The scale factor is inverted to dst/src, stretching the timeline instead of compressing it.","sha256":"0028c59cafcd1a3f0ffdd13f6f5076fe5f0c47538442355ac01b0e5b67a00195","title":"Subtitle frame-rate retiming: scale direction · 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":43.843,"exit_code":1,"observations":[{"actual":[[2000,4000]],"check":"regression: scale direction","expected":[[500,1000]],"passed":false},{"actual":[[644050,644054],[29628,34430],[0,101]],"check":"regression variant: scale direction","expected":[[644050,644054],[29628,34430],[0,101]],"passed":true},{"actual":[[8,12],[1200,5158],[14799,14803],[0,121]],"check":"partial repair probe: scale direction","expected":[[6,8],[835,3589],[10298,10300],[0,84]],"passed":false},{"actual":[[14,5692],[14,20],[2,2000],[14,7982]],"check":"partial repair variant: scale direction","expected":[[4,1426],[4,5],[1,501],[4,1999]],"passed":false},{"actual":[[5,6]],"check":"boundary control","expected":[[5,6]],"passed":true},{"actual":[[1,2],[3,4]],"check":"boundary control","expected":[[1,2],[3,4]],"passed":true},{"actual":[[1,1001]],"check":"normal control","expected":[[1,1001]],"passed":true},{"actual":[[999,2714],[12345,13345],[1,2002]],"check":"normal control","expected":[[999,2714],[12345,13345],[1,2002]],"passed":true},{"actual":[[1001,1003],[7,4855],[12345,13345]],"check":"normal control","expected":[[1001,1003],[7,4855],[12345,13345]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: scale direction\", \"actual\": [[2000, 4000]], \"expected\": [[500, 1000]], \"passed\": false}, {\"check\": \"regression variant: scale direction\", \"actual\": [[644050, 644054], [29628, 34430], [0, 101]], \"expected\": [[644050, 644054], [29628, 34430], [0, 101]], \"passed\": true}, {\"check\": \"partial repair probe: scale direction\", \"actual\": [[8, 12], [1200, 5158], [14799, 14803], [0, 121]], \"expected\": [[6, 8], [835, 3589], [10298, 10300], [0, 84]], \"passed\": false}, {\"check\": \"partial repair variant: scale direction\", \"actual\": [[14, 5692], [14, 20], [2, 2000], [14, 7982]], \"expected\": [[4, 1426], [4, 5], [1, 501], [4, 1999]], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [[5, 6]], \"expected\": [[5, 6]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1, 1001]], \"expected\": [[1, 1001]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[999, 2714], [12345, 13345], [1, 2002]], \"expected\": [[999, 2714], [12345, 13345], [1, 2002]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1001, 1003], [7, 4855], [12345, 13345]], \"expected\": [[1001, 1003], [7, 4855], [12345, 13345]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.98,"exit_code":1,"observations":[{"actual":[[2000,4000]],"check":"regression: scale direction","expected":[[500,1000]],"passed":false},{"actual":[[111814,111815],[5144,5978],[0,18]],"check":"regression variant: scale direction","expected":[[644050,644054],[29628,34430],[0,101]],"passed":false},{"actual":[[8,12],[1200,5158],[14799,14803],[0,121]],"check":"partial repair probe: scale direction","expected":[[6,8],[835,3589],[10298,10300],[0,84]],"passed":false},{"actual":[[14,5692],[14,20],[2,2000],[14,7982]],"check":"partial repair variant: scale direction","expected":[[4,1426],[4,5],[1,501],[4,1999]],"passed":false},{"actual":[[5,6]],"check":"boundary control","expected":[[5,6]],"passed":true},{"actual":[[1,2],[3,4]],"check":"boundary control","expected":[[1,2],[3,4]],"passed":true},{"actual":[[1,1001]],"check":"normal control","expected":[[1,1001]],"passed":true},{"actual":[[999,2714],[12345,13345],[1,2002]],"check":"normal control","expected":[[999,2714],[12345,13345],[1,2002]],"passed":true},{"actual":[[1001,1003],[7,4855],[12345,13345]],"check":"normal control","expected":[[1001,1003],[7,4855],[12345,13345]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: scale direction\", \"actual\": [[2000, 4000]], \"expected\": [[500, 1000]], \"passed\": false}, {\"check\": \"regression variant: scale direction\", \"actual\": [[111814, 111815], [5144, 5978], [0, 18]], \"expected\": [[644050, 644054], [29628, 34430], [0, 101]], \"passed\": false}, {\"check\": \"partial repair probe: scale direction\", \"actual\": [[8, 12], [1200, 5158], [14799, 14803], [0, 121]], \"expected\": [[6, 8], [835, 3589], [10298, 10300], [0, 84]], \"passed\": false}, {\"check\": \"partial repair variant: scale direction\", \"actual\": [[14, 5692], [14, 20], [2, 2000], [14, 7982]], \"expected\": [[4, 1426], [4, 5], [1, 501], [4, 1999]], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [[5, 6]], \"expected\": [[5, 6]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1, 1001]], \"expected\": [[1, 1001]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[999, 2714], [12345, 13345], [1, 2002]], \"expected\": [[999, 2714], [12345, 13345], [1, 2002]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1001, 1003], [7, 4855], [12345, 13345]], \"expected\": [[1001, 1003], [7, 4855], [12345, 13345]], \"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."}}