{"abstract":"Cue starts land one millisecond early whenever the scaled time has a fractional half or more.","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":"Python's round uses half-to-even, so exact .5 starts with an even floor still round down.","family":"w2-subtitle-cue-timing-frame-rate-retime-start-rounding","id":"FA-77931","implementations":{"attempt":{"sha256":"4bcd44c0488ce47402172ce3e46bf571b3cace9989939672f4ce88227484550e","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)\n    out=[]\n    for start,end in cues:\n        rs=round(start*k)\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: start rounding', [[[5, 6]], '24', '25'], [[5, 6]]), ('regression variant: start rounding', [[[1, 4], [7, 9], [12345, 14346], [1001, 1002]], '24000/1001', '12'], [[2, 8], [14, 18], [24665, 28663], [2000, 2002]]), ('partial repair probe: start rounding', [[[418354, 420355]], '60', '48'], [[522943, 525444]]), ('partial repair variant: start rounding', [[[1, 3], [7, 8], [1, 3]], '24', '48'], [[1, 2], [4, 5], [1, 2]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[1, 1001]], '30000/1001', '29.97'], [[1, 1001]]), ('normal control', [[[540231, 541231], [0, 3]], '50', '29.97'], [[901285, 902954], [0, 5]]), ('normal control', [[[999, 2714], [12345, 13345], [1, 2002]], '29.97', '30000/1001'], [[999, 2714], [12345, 13345], [1, 2002]])], [('regression: start rounding', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('regression variant: start rounding', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair probe: start rounding', [[[1001, 2001]], '15', '30'], [[501, 1001]]), ('partial repair variant: start rounding', [[[3, 4], [999, 1999], [7, 1584], [12345, 14346]], '25', '50'], [[2, 3], [500, 1000], [4, 792], [6173, 7173]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('normal control', [[[1001, 1003], [7, 4855], [12345, 13345]], '50', '50'], [[1001, 1003], [7, 4855], [12345, 13345]]), ('normal control', [[[7, 9], [3, 6], [0, 3], [1, 4]], '24', '23.976'], [[7, 9], [3, 6], [0, 3], [1, 4]]), ('normal control', [[[3, 1003], [999, 1000], [3, 5]], '50', '30'], [[5, 1672], [1665, 1667], [5, 8]])], [('regression: start rounding', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('regression variant: start rounding', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair probe: start rounding', [[[1, 4995]], '25', '50'], [[1, 2498]]), ('partial repair variant: start rounding', [[[348744, 348746], [282090, 282093]], '15', '12'], [[435930, 435933], [352613, 352616]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[594534, 596535], [7, 10]], '29.97', '29.97'], [[594534, 596535], [7, 10]]), ('normal control', [[[821125, 821127], [0, 1]], '30', '30'], [[821125, 821127], [0, 1]]), ('normal control', [[[7, 1007]], '48', '30'], [[11, 1611]])], [('regression: start rounding', [[[269050, 271051]], '30000/1001', '23.976'], [[336313, 338814]]), ('regression variant: start rounding', [[[999, 4970]], '30', '60'], [[500, 2485]]), ('partial repair probe: start rounding', [[[3, 2004], [7, 10], [566844, 568845]], '25', '30'], [[3, 1670], [6, 8], [472370, 474038]]), ('partial repair variant: start rounding', [[[1, 4], [12345, 12348], [7, 10], [3, 6]], '25', '30'], [[1, 3], [10288, 10290], [6, 8], [3, 5]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('normal control', [[[1, 4]], '24000/1001', '50'], [[0, 2]]), ('normal control', [[[0, 3], [1001, 3002]], '12', '48'], [[0, 1], [250, 751]]), ('normal control', [[[3, 2004]], '24000/1001', '30000/1001'], [[2, 1603]])], [('regression: start rounding', [[[268354, 268356], [12345, 14346], [0, 42]], '60', '25'], [[644050, 644054], [29628, 34430], [0, 101]]), ('regression variant: start rounding', [[[1, 4]], '23.976', '15'], [[2, 6]]), ('partial repair probe: start rounding', [[[999, 1999]], '50', '60'], [[833, 1666]]), ('partial repair variant: start rounding', [[[1001, 5110], [1001, 2001], [3, 6]], '50', '12'], [[4171, 21292], [4171, 8338], [13, 25]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[999, 1001], [1001, 1003]], '24000/1001', '25'], [[958, 960], [960, 962]]), ('normal control', [[[12345, 12851], [0, 1000], [7, 2008]], '48', '24'], [[24690, 25702], [0, 2000], [14, 4016]]), ('normal control', [[[12345, 13204], [1001, 3749]], '23.976', '30'], [[9866, 10553], [800, 2996]])]]\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":"d64d07ab20c0cec00c74a58e9c2f8273fc0b150a289003a33331b16e271fadd7","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)\n    out=[]\n    for start,end in cues:\n        rs=math.floor(start*k)\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: start rounding', [[[5, 6]], '24', '25'], [[5, 6]]), ('regression variant: start rounding', [[[1, 4], [7, 9], [12345, 14346], [1001, 1002]], '24000/1001', '12'], [[2, 8], [14, 18], [24665, 28663], [2000, 2002]]), ('partial repair probe: start rounding', [[[418354, 420355]], '60', '48'], [[522943, 525444]]), ('partial repair variant: start rounding', [[[1, 3], [7, 8], [1, 3]], '24', '48'], [[1, 2], [4, 5], [1, 2]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[1, 1001]], '30000/1001', '29.97'], [[1, 1001]]), ('normal control', [[[540231, 541231], [0, 3]], '50', '29.97'], [[901285, 902954], [0, 5]]), ('normal control', [[[999, 2714], [12345, 13345], [1, 2002]], '29.97', '30000/1001'], [[999, 2714], [12345, 13345], [1, 2002]])], [('regression: start rounding', [[[1, 2], [3, 4]], '23.976', '25'], [[1, 2], [3, 4]]), ('regression variant: start rounding', [[[3, 6]], '30', '48'], [[2, 4]]), ('partial repair probe: start rounding', [[[1001, 2001]], '15', '30'], [[501, 1001]]), ('partial repair variant: start rounding', [[[3, 4], [999, 1999], [7, 1584], [12345, 14346]], '25', '50'], [[2, 3], [500, 1000], [4, 792], [6173, 7173]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('normal control', [[[1001, 1003], [7, 4855], [12345, 13345]], '50', '50'], [[1001, 1003], [7, 4855], [12345, 13345]]), ('normal control', [[[7, 9], [3, 6], [0, 3], [1, 4]], '24', '23.976'], [[7, 9], [3, 6], [0, 3], [1, 4]]), ('normal control', [[[3, 1003], [999, 1000], [3, 5]], '50', '30'], [[5, 1672], [1665, 1667], [5, 8]])], [('regression: start rounding', [[[7, 10], [1001, 4303], [12345, 12348], [0, 101]], '25', '29.97'], [[6, 8], [835, 3589], [10298, 10300], [0, 84]]), ('regression variant: start rounding', [[[583859, 583862], [0, 1000], [3, 6], [881562, 881564]], '25', '30'], [[486549, 486552], [0, 833], [3, 5], [734635, 734637]]), ('partial repair probe: start rounding', [[[1, 4995]], '25', '50'], [[1, 2498]]), ('partial repair variant: start rounding', [[[348744, 348746], [282090, 282093]], '15', '12'], [[435930, 435933], [352613, 352616]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[594534, 596535], [7, 10]], '29.97', '29.97'], [[594534, 596535], [7, 10]]), ('normal control', [[[821125, 821127], [0, 1]], '30', '30'], [[821125, 821127], [0, 1]]), ('normal control', [[[7, 1007]], '48', '30'], [[11, 1611]])], [('regression: start rounding', [[[269050, 271051]], '30000/1001', '23.976'], [[336313, 338814]]), ('regression variant: start rounding', [[[999, 4970]], '30', '60'], [[500, 2485]]), ('partial repair probe: start rounding', [[[3, 2004], [7, 10], [566844, 568845]], '25', '30'], [[3, 1670], [6, 8], [472370, 474038]]), ('partial repair variant: start rounding', [[[1, 4], [12345, 12348], [7, 10], [3, 6]], '25', '30'], [[1, 3], [10288, 10290], [6, 8], [3, 5]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('normal control', [[[1, 4]], '24000/1001', '50'], [[0, 2]]), ('normal control', [[[0, 3], [1001, 3002]], '12', '48'], [[0, 1], [250, 751]]), ('normal control', [[[3, 2004]], '24000/1001', '30000/1001'], [[2, 1603]])], [('regression: start rounding', [[[268354, 268356], [12345, 14346], [0, 42]], '60', '25'], [[644050, 644054], [29628, 34430], [0, 101]]), ('regression variant: start rounding', [[[1, 4]], '23.976', '15'], [[2, 6]]), ('partial repair probe: start rounding', [[[999, 1999]], '50', '60'], [[833, 1666]]), ('partial repair variant: start rounding', [[[1001, 5110], [1001, 2001], [3, 6]], '50', '12'], [[4171, 21292], [4171, 8338], [13, 25]]), ('boundary control', [[[1000, 2000]], '25', '50'], [[500, 1000]]), ('boundary control', [[[1001, 3003]], '24000/1001', '24'], [[1000, 3000]]), ('normal control', [[[999, 1001], [1001, 1003]], '24000/1001', '25'], [[958, 960], [960, 962]]), ('normal control', [[[12345, 12851], [0, 1000], [7, 2008]], '48', '24'], [[24690, 25702], [0, 2000], [14, 4016]]), ('normal control', [[[12345, 13204], [1001, 3749]], '23.976', '30'], [[9866, 10553], [800, 2996]])]]\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-start-rounding","generated_at":"2026-09-29T14:49:30.602844+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 scaled start is truncated with floor instead of rounded half up.","sha256":"4a10592decaf8dfc2e748d4434b64186a43ddd875745904d59b7506d71ad8ede","title":"Subtitle frame-rate retiming: start rounding · 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":44.29,"exit_code":1,"observations":[{"actual":[[5,6]],"check":"regression: start rounding","expected":[[5,6]],"passed":true},{"actual":[[2,8],[14,18],[24665,28663],[2000,2002]],"check":"regression variant: start rounding","expected":[[2,8],[14,18],[24665,28663],[2000,2002]],"passed":true},{"actual":[[522942,525444]],"check":"partial repair probe: start rounding","expected":[[522943,525444]],"passed":false},{"actual":[[0,2],[4,5],[0,2]],"check":"partial repair variant: start rounding","expected":[[1,2],[4,5],[1,2]],"passed":false},{"actual":[[500,1000]],"check":"boundary control","expected":[[500,1000]],"passed":true},{"actual":[[1000,3000]],"check":"boundary control","expected":[[1000,3000]],"passed":true},{"actual":[[1,1001]],"check":"normal control","expected":[[1,1001]],"passed":true},{"actual":[[901285,902954],[0,5]],"check":"normal control","expected":[[901285,902954],[0,5]],"passed":true},{"actual":[[999,2714],[12345,13345],[1,2002]],"check":"normal control","expected":[[999,2714],[12345,13345],[1,2002]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: start rounding\", \"actual\": [[5, 6]], \"expected\": [[5, 6]], \"passed\": true}, {\"check\": \"regression variant: start rounding\", \"actual\": [[2, 8], [14, 18], [24665, 28663], [2000, 2002]], \"expected\": [[2, 8], [14, 18], [24665, 28663], [2000, 2002]], \"passed\": true}, {\"check\": \"partial repair probe: start rounding\", \"actual\": [[522942, 525444]], \"expected\": [[522943, 525444]], \"passed\": false}, {\"check\": \"partial repair variant: start rounding\", \"actual\": [[0, 2], [4, 5], [0, 2]], \"expected\": [[1, 2], [4, 5], [1, 2]], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [[500, 1000]], \"expected\": [[500, 1000]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1000, 3000]], \"expected\": [[1000, 3000]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1, 1001]], \"expected\": [[1, 1001]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[901285, 902954], [0, 5]], \"expected\": [[901285, 902954], [0, 5]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[999, 2714], [12345, 13345], [1, 2002]], \"expected\": [[999, 2714], [12345, 13345], [1, 2002]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.2,"exit_code":1,"observations":[{"actual":[[4,6]],"check":"regression: start rounding","expected":[[5,6]],"passed":false},{"actual":[[1,8],[13,18],[24665,28663],[2000,2002]],"check":"regression variant: start rounding","expected":[[2,8],[14,18],[24665,28663],[2000,2002]],"passed":false},{"actual":[[522942,525444]],"check":"partial repair probe: start rounding","expected":[[522943,525444]],"passed":false},{"actual":[[0,2],[3,4],[0,2]],"check":"partial repair variant: start rounding","expected":[[1,2],[4,5],[1,2]],"passed":false},{"actual":[[500,1000]],"check":"boundary control","expected":[[500,1000]],"passed":true},{"actual":[[1000,3000]],"check":"boundary control","expected":[[1000,3000]],"passed":true},{"actual":[[1,1001]],"check":"normal control","expected":[[1,1001]],"passed":true},{"actual":[[901285,902954],[0,5]],"check":"normal control","expected":[[901285,902954],[0,5]],"passed":true},{"actual":[[999,2714],[12345,13345],[1,2002]],"check":"normal control","expected":[[999,2714],[12345,13345],[1,2002]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: start rounding\", \"actual\": [[4, 6]], \"expected\": [[5, 6]], \"passed\": false}, {\"check\": \"regression variant: start rounding\", \"actual\": [[1, 8], [13, 18], [24665, 28663], [2000, 2002]], \"expected\": [[2, 8], [14, 18], [24665, 28663], [2000, 2002]], \"passed\": false}, {\"check\": \"partial repair probe: start rounding\", \"actual\": [[522942, 525444]], \"expected\": [[522943, 525444]], \"passed\": false}, {\"check\": \"partial repair variant: start rounding\", \"actual\": [[0, 2], [3, 4], [0, 2]], \"expected\": [[1, 2], [4, 5], [1, 2]], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [[500, 1000]], \"expected\": [[500, 1000]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1000, 3000]], \"expected\": [[1000, 3000]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1, 1001]], \"expected\": [[1, 1001]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[901285, 902954], [0, 5]], \"expected\": [[901285, 902954], [0, 5]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[999, 2714], [12345, 13345], [1, 2002]], \"expected\": [[999, 2714], [12345, 13345], [1, 2002]], \"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."}}