{"abstract":"Tick-based caption times collapse to near zero.","category":"Subtitle cue timing","checks":9,"contract":"Evaluate a timed-text time expression to integer ms, rounded half up. Offset form <number><metric> with metric h, m, s, ms, f (frames at frame_rate) or t (ticks at tick_rate). Clock form HH:MM:SS with optional .fraction (any digits) or :FF frames (FF < frame_rate). Minutes/seconds above 59 or malformed text give None.","contract_signature":"expr, frame_rate, tick_rate","evaluation_group":"w2-subtitle-cue-timing-ttml-time-expression","failed_approach":"Using the frame rate for ticks confuses the two independent clocks.","family":"w2-subtitle-cue-timing-ttml-time-expression-tick-metric-scale","id":"FA-78191","implementations":{"attempt":{"sha256":"f5f8b717d3555e239116a7e16192d20c4cd7b43bed19643c7150a91d93538dd7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport re\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(expr, frame_rate, tick_rate):\n    m=re.fullmatch(r'(\\d+(?:\\.\\d+)?)(h|ms|m|s|f|t)',expr)\n    if m:\n        v=Fraction(m.group(1))\n        unit=m.group(2)\n        scale={'h':3600000,'m':60000,'s':1000,'ms':1}\n        if unit in scale:\n            x=v*scale[unit]\n        elif unit=='f':\n            x=v*1000/frame_rate\n        else:\n            x=v*1000/frame_rate\n        return math.floor(x+Fraction(1,2))\n    m=re.fullmatch(r'(\\d{2,}):(\\d{2}):(\\d{2})(?:\\.(\\d+)|:(\\d{2,}))?',expr)\n    if not m:\n        return None\n    h,mi,se,frac,fr=m.groups()\n    if int(mi)>59 or int(se)>59:\n        return None\n    x=Fraction(int(h)*3600+int(mi)*60+int(se))*1000\n    if frac:\n        x+=Fraction('0.'+frac)*1000\n    if fr:\n        if int(fr)>=frame_rate:\n            return None\n        x+=Fraction(int(fr)*1000,frame_rate)\n    return (x*2+1)//2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: tick metric scale', ['10t', 25, 1000], 10), ('regression variant: tick metric scale', ['17t', 30, 3], 5667), ('partial repair probe: tick metric scale', ['15t', 30, 3], 5000), ('partial repair variant: tick metric scale', ['17t', 16, 90000], 0), ('boundary control', ['3f', 16, 1000], 188), ('boundary control', ['00:00:00:25', 25, 1000], None), ('normal control', ['00:00:01:15', 16, 1000], 1938), ('normal control', ['10:59:59:15', 40, 1000], 39599375), ('normal control', ['01:60:59:30', 50, 10000000], None)], [('regression: tick metric scale', ['2t', 30, 3], 667), ('regression variant: tick metric scale', ['90t', 24, 1000], 90), ('partial repair probe: tick metric scale', ['7t', 25, 10000000], 0), ('partial repair variant: tick metric scale', ['1.5t', 50, 1000], 2), ('boundary control', ['00:00:01:15', 16, 1000], 1938), ('boundary control', ['3f', 16, 1000], 188), ('normal control', ['0ms', 16, 90000], 0), ('normal control', ['10:59:00:15', 40, 90000], 39540375), ('normal control', ['00:00:59:12', 30, 10000000], 59400)], [('regression: tick metric scale', ['15t', 30, 3], 5000), ('regression variant: tick metric scale', ['1.5t', 50, 1000], 2), ('partial repair probe: tick metric scale', ['1.5t', 16, 3], 500), ('partial repair variant: tick metric scale', ['1t', 40, 1000], 1), ('boundary control', ['00:00:01.0005', 25, 1000], 1001), ('boundary control', ['00:00:01:15', 16, 1000], 1938), ('normal control', ['100:30:59:30', 25, 10000000], None), ('normal control', ['00:30:00:15', 16, 10000000], 1800938), ('normal control', ['01:60:05:12', 16, 10000000], None)], [('regression: tick metric scale', ['1.5t', 16, 3], 500), ('regression variant: tick metric scale', ['1t', 40, 1000], 1), ('partial repair probe: tick metric scale', ['90t', 40, 1000], 90), ('partial repair variant: tick metric scale', ['1.5t', 24, 90000], 0), ('boundary control', ['00:00:00:25', 25, 1000], None), ('boundary control', ['00:00:01.0005', 25, 1000], 1001), ('normal control', ['0t', 24, 3], 0), ('normal control', ['10:00:00.25', 16, 3], 36000250), ('normal control', ['10:30:59.5', 24, 1000], 37859500)], [('regression: tick metric scale', ['90t', 40, 1000], 90), ('regression variant: tick metric scale', ['2t', 24, 3], 667), ('partial repair probe: tick metric scale', ['17t', 30, 3], 5667), ('partial repair variant: tick metric scale', ['12.25t', 16, 90000], 0), ('boundary control', ['3f', 16, 1000], 188), ('boundary control', ['00:00:00:25', 25, 1000], None), ('normal control', ['100:59:05:12', 24, 3], 363545500), ('normal control', ['17h', 24, 10000000], 61200000), ('normal control', ['12.25f', 25, 3], 490)]]\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":"c4eca0647d6bf72820385fe88c495be2e3e7e9bcf2918613a64272a74bd0dc31","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport re\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(expr, frame_rate, tick_rate):\n    m=re.fullmatch(r'(\\d+(?:\\.\\d+)?)(h|ms|m|s|f|t)',expr)\n    if m:\n        v=Fraction(m.group(1))\n        unit=m.group(2)\n        scale={'h':3600000,'m':60000,'s':1000,'ms':1}\n        if unit in scale:\n            x=v*scale[unit]\n        elif unit=='f':\n            x=v*1000/frame_rate\n        else:\n            x=v/tick_rate\n        return math.floor(x+Fraction(1,2))\n    m=re.fullmatch(r'(\\d{2,}):(\\d{2}):(\\d{2})(?:\\.(\\d+)|:(\\d{2,}))?',expr)\n    if not m:\n        return None\n    h,mi,se,frac,fr=m.groups()\n    if int(mi)>59 or int(se)>59:\n        return None\n    x=Fraction(int(h)*3600+int(mi)*60+int(se))*1000\n    if frac:\n        x+=Fraction('0.'+frac)*1000\n    if fr:\n        if int(fr)>=frame_rate:\n            return None\n        x+=Fraction(int(fr)*1000,frame_rate)\n    return (x*2+1)//2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: tick metric scale', ['10t', 25, 1000], 10), ('regression variant: tick metric scale', ['17t', 30, 3], 5667), ('partial repair probe: tick metric scale', ['15t', 30, 3], 5000), ('partial repair variant: tick metric scale', ['17t', 16, 90000], 0), ('boundary control', ['3f', 16, 1000], 188), ('boundary control', ['00:00:00:25', 25, 1000], None), ('normal control', ['00:00:01:15', 16, 1000], 1938), ('normal control', ['10:59:59:15', 40, 1000], 39599375), ('normal control', ['01:60:59:30', 50, 10000000], None)], [('regression: tick metric scale', ['2t', 30, 3], 667), ('regression variant: tick metric scale', ['90t', 24, 1000], 90), ('partial repair probe: tick metric scale', ['7t', 25, 10000000], 0), ('partial repair variant: tick metric scale', ['1.5t', 50, 1000], 2), ('boundary control', ['00:00:01:15', 16, 1000], 1938), ('boundary control', ['3f', 16, 1000], 188), ('normal control', ['0ms', 16, 90000], 0), ('normal control', ['10:59:00:15', 40, 90000], 39540375), ('normal control', ['00:00:59:12', 30, 10000000], 59400)], [('regression: tick metric scale', ['15t', 30, 3], 5000), ('regression variant: tick metric scale', ['1.5t', 50, 1000], 2), ('partial repair probe: tick metric scale', ['1.5t', 16, 3], 500), ('partial repair variant: tick metric scale', ['1t', 40, 1000], 1), ('boundary control', ['00:00:01.0005', 25, 1000], 1001), ('boundary control', ['00:00:01:15', 16, 1000], 1938), ('normal control', ['100:30:59:30', 25, 10000000], None), ('normal control', ['00:30:00:15', 16, 10000000], 1800938), ('normal control', ['01:60:05:12', 16, 10000000], None)], [('regression: tick metric scale', ['1.5t', 16, 3], 500), ('regression variant: tick metric scale', ['1t', 40, 1000], 1), ('partial repair probe: tick metric scale', ['90t', 40, 1000], 90), ('partial repair variant: tick metric scale', ['1.5t', 24, 90000], 0), ('boundary control', ['00:00:00:25', 25, 1000], None), ('boundary control', ['00:00:01.0005', 25, 1000], 1001), ('normal control', ['0t', 24, 3], 0), ('normal control', ['10:00:00.25', 16, 3], 36000250), ('normal control', ['10:30:59.5', 24, 1000], 37859500)], [('regression: tick metric scale', ['90t', 40, 1000], 90), ('regression variant: tick metric scale', ['2t', 24, 3], 667), ('partial repair probe: tick metric scale', ['17t', 30, 3], 5667), ('partial repair variant: tick metric scale', ['12.25t', 16, 90000], 0), ('boundary control', ['3f', 16, 1000], 188), ('boundary control', ['00:00:00:25', 25, 1000], None), ('normal control', ['100:59:05:12', 24, 3], 363545500), ('normal control', ['17h', 24, 10000000], 61200000), ('normal control', ['12.25f', 25, 3], 490)]]\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-ttml-time-expression-tick-metric-scale","generated_at":"2026-09-29T14:49:32.770059+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":"Tick counts are divided by the tick rate without converting seconds to milliseconds.","sha256":"6ee765f56098fc4cc07730096e67a6d7efad807e44550ad2495ca549ab66915c","title":"Timed-text time expression evaluation: tick metric scale · 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":42.389,"exit_code":1,"observations":[{"actual":400,"check":"regression: tick metric scale","expected":10,"passed":false},{"actual":567,"check":"regression variant: tick metric scale","expected":5667,"passed":false},{"actual":500,"check":"partial repair probe: tick metric scale","expected":5000,"passed":false},{"actual":1063,"check":"partial repair variant: tick metric scale","expected":0,"passed":false},{"actual":188,"check":"boundary control","expected":188,"passed":true},{"actual":null,"check":"boundary control","expected":null,"passed":true},{"actual":1938,"check":"normal control","expected":1938,"passed":true},{"actual":39599375,"check":"normal control","expected":39599375,"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: tick metric scale\", \"actual\": 400, \"expected\": 10, \"passed\": false}, {\"check\": \"regression variant: tick metric scale\", \"actual\": 567, \"expected\": 5667, \"passed\": false}, {\"check\": \"partial repair probe: tick metric scale\", \"actual\": 500, \"expected\": 5000, \"passed\": false}, {\"check\": \"partial repair variant: tick metric scale\", \"actual\": 1063, \"expected\": 0, \"passed\": false}, {\"check\": \"boundary control\", \"actual\": 188, \"expected\": 188, \"passed\": true}, {\"check\": \"boundary control\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal control\", \"actual\": 1938, \"expected\": 1938, \"passed\": true}, {\"check\": \"normal control\", \"actual\": 39599375, \"expected\": 39599375, \"passed\": true}, {\"check\": \"normal control\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.902,"exit_code":1,"observations":[{"actual":0,"check":"regression: tick metric scale","expected":10,"passed":false},{"actual":6,"check":"regression variant: tick metric scale","expected":5667,"passed":false},{"actual":5,"check":"partial repair probe: tick metric scale","expected":5000,"passed":false},{"actual":0,"check":"partial repair variant: tick metric scale","expected":0,"passed":true},{"actual":188,"check":"boundary control","expected":188,"passed":true},{"actual":null,"check":"boundary control","expected":null,"passed":true},{"actual":1938,"check":"normal control","expected":1938,"passed":true},{"actual":39599375,"check":"normal control","expected":39599375,"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: tick metric scale\", \"actual\": 0, \"expected\": 10, \"passed\": false}, {\"check\": \"regression variant: tick metric scale\", \"actual\": 6, \"expected\": 5667, \"passed\": false}, {\"check\": \"partial repair probe: tick metric scale\", \"actual\": 5, \"expected\": 5000, \"passed\": false}, {\"check\": \"partial repair variant: tick metric scale\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"boundary control\", \"actual\": 188, \"expected\": 188, \"passed\": true}, {\"check\": \"boundary control\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal control\", \"actual\": 1938, \"expected\": 1938, \"passed\": true}, {\"check\": \"normal control\", \"actual\": 39599375, \"expected\": 39599375, \"passed\": true}, {\"check\": \"normal control\", \"actual\": null, \"expected\": null, \"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."}}