{"abstract":"Negative offsets carry a positive subframe part.","category":"Broadcast timecode arithmetic","checks":9,"contract":"Labels HH:MM:SS:FF.s where s is one or two digits of hundredths of a frame (\".5\" means 50). Return the offset from a to b as [frames, subframes] along the shorter way round 24 hours (exactly 12 hours is positive), with both components carrying the sign and 0 <= |subframes| < 100.","contract_signature":"a, b, fps","evaluation_group":"w2-broadcast-timecode-arithmetic-subframe-offset","failed_approach":"Signing the subframes only when there are no whole frames still mixes signs.","family":"w2-broadcast-timecode-arithmetic-subframe-offset-subframe-sign","id":"FA-78801","implementations":{"attempt":{"sha256":"2c439c3b352a698a58daeb457b13e774520b44f899c1dc127e04edde14a605d2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b, fps):\n    def parse(t):\n        main,sub=t.split('.')\n        h,m,s,f=map(int,main.split(':'))\n        return (((h*60+m)*60+s)*fps+f)*100+int(sub.ljust(2,'0'))\n    day=86400*fps*100\n    d=(parse(b)-parse(a))%day\n    if d>day//2:\n        d-=day\n    sign=-1 if d<0 else 1\n    q,r=divmod(abs(d),100)\n    return [sign*q,sign*r if q==0 else r]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: subframe sign', ['00:00:00:01.50', '00:00:00:00.00', 25], [-1, -50]), ('regression variant: subframe sign', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('partial repair probe: subframe sign', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('partial repair variant: subframe sign', ['00:59:30:00.99', '23:30:30:00.50', 30], [-160200, -49]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('normal control', ['00:30:59:00.0', '12:30:59:00.0', 30], [1296000, 0])], [('regression: subframe sign', ['01:00:59:29.50', '00:30:30:29.99', 30], [-54869, -51]), ('regression variant: subframe sign', ['00:59:00:29.00', '00:00:00:01.05', 30], [-106227, -95]), ('partial repair probe: subframe sign', ['01:59:30:29.50', '01:30:30:29.0', 30], [-52200, -50]), ('partial repair variant: subframe sign', ['23:59:30:01.50', '23:59:00:01.0', 30], [-900, -50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['01:30:59:29.05', '13:30:59:29.05', 30], [1296000, 0]), ('normal control', ['23:59:00:24.5', '00:30:59:01.0', 25], [47951, 50]), ('normal control', ['23:30:59:00.5', '23:59:30:01.00', 30], [51330, 50])], [('regression: subframe sign', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('regression variant: subframe sign', ['12:00:59:01.50', '01:00:00:01.05', 25], [-991475, -45]), ('partial repair probe: subframe sign', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('partial repair variant: subframe sign', ['01:30:59:00.50', '23:30:30:29.0', 30], [-216841, -50]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('normal control', ['00:00:00:01.05', '23:00:00:01.05', 25], [-90000, 0]), ('normal control', ['00:00:00:29.05', '12:00:00:29.05', 30], [1296000, 0]), ('normal control', ['00:59:30:01.5', '23:00:00:29.50', 30], [-215072, 0])], [('regression: subframe sign', ['01:59:30:29.50', '01:30:30:29.0', 30], [-52200, -50]), ('regression variant: subframe sign', ['01:30:00:00.0', '01:00:59:24.99', 25], [-43500, -1]), ('partial repair probe: subframe sign', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('partial repair variant: subframe sign', ['00:59:30:01.50', '00:59:00:01.00', 30], [-900, -50]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['23:00:00:00.05', '23:30:00:01.0', 30], [54000, 95]), ('normal control', ['00:30:00:01.0', '01:00:00:01.0', 30], [54000, 0]), ('normal control', ['00:00:59:00.00', '23:00:00:01.0', 30], [-109769, 0])], [('regression: subframe sign', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('regression variant: subframe sign', ['00:59:30:00.99', '23:30:30:00.50', 30], [-160200, -49]), ('partial repair probe: subframe sign', ['00:59:00:29.00', '00:00:00:01.05', 30], [-106227, -95]), ('partial repair variant: subframe sign', ['12:30:59:00.5', '12:00:59:01.99', 25], [-44998, -51]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['01:30:00:24.50', '12:59:00:01.5', 25], [1033477, 0]), ('normal control', ['23:00:59:01.5', '01:30:00:00.0', 30], [268228, 50]), ('normal control', ['00:59:30:01.0', '12:59:30:01.0', 30], [1296000, 0])]]\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":"be06220384be1117d9615863014bd594261b6e18a9762ade8fa744783ecb88b0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b, fps):\n    def parse(t):\n        main,sub=t.split('.')\n        h,m,s,f=map(int,main.split(':'))\n        return (((h*60+m)*60+s)*fps+f)*100+int(sub.ljust(2,'0'))\n    day=86400*fps*100\n    d=(parse(b)-parse(a))%day\n    if d>day//2:\n        d-=day\n    sign=-1 if d<0 else 1\n    q,r=divmod(abs(d),100)\n    return [sign*q,r]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: subframe sign', ['00:00:00:01.50', '00:00:00:00.00', 25], [-1, -50]), ('regression variant: subframe sign', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('partial repair probe: subframe sign', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('partial repair variant: subframe sign', ['00:59:30:00.99', '23:30:30:00.50', 30], [-160200, -49]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['00:59:59:00.5', '01:59:00:29.50', 30], [106259, 0]), ('normal control', ['00:30:59:00.0', '12:30:59:00.0', 30], [1296000, 0])], [('regression: subframe sign', ['01:00:59:29.50', '00:30:30:29.99', 30], [-54869, -51]), ('regression variant: subframe sign', ['00:59:00:29.00', '00:00:00:01.05', 30], [-106227, -95]), ('partial repair probe: subframe sign', ['01:59:30:29.50', '01:30:30:29.0', 30], [-52200, -50]), ('partial repair variant: subframe sign', ['23:59:30:01.50', '23:59:00:01.0', 30], [-900, -50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['01:30:59:29.05', '13:30:59:29.05', 30], [1296000, 0]), ('normal control', ['23:59:00:24.5', '00:30:59:01.0', 25], [47951, 50]), ('normal control', ['23:30:59:00.5', '23:59:30:01.00', 30], [51330, 50])], [('regression: subframe sign', ['01:00:30:00.99', '23:30:00:29.50', 30], [-162871, -49]), ('regression variant: subframe sign', ['12:00:59:01.50', '01:00:00:01.05', 25], [-991475, -45]), ('partial repair probe: subframe sign', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('partial repair variant: subframe sign', ['01:30:59:00.50', '23:30:30:29.0', 30], [-216841, -50]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('normal control', ['00:00:00:01.05', '23:00:00:01.05', 25], [-90000, 0]), ('normal control', ['00:00:00:29.05', '12:00:00:29.05', 30], [1296000, 0]), ('normal control', ['00:59:30:01.5', '23:00:00:29.50', 30], [-215072, 0])], [('regression: subframe sign', ['01:59:30:29.50', '01:30:30:29.0', 30], [-52200, -50]), ('regression variant: subframe sign', ['01:30:00:00.0', '01:00:59:24.99', 25], [-43500, -1]), ('partial repair probe: subframe sign', ['01:30:00:00.5', '01:00:59:00.05', 30], [-52230, -45]), ('partial repair variant: subframe sign', ['00:59:30:01.50', '00:59:00:01.00', 30], [-900, -50]), ('boundary control', ['00:00:00:00.00', '00:00:00:01.50', 25], [1, 50]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('normal control', ['23:00:00:00.05', '23:30:00:01.0', 30], [54000, 95]), ('normal control', ['00:30:00:01.0', '01:00:00:01.0', 30], [54000, 0]), ('normal control', ['00:00:59:00.00', '23:00:00:01.0', 30], [-109769, 0])], [('regression: subframe sign', ['12:59:30:01.50', '00:59:59:00.05', 30], [-1295131, -45]), ('regression variant: subframe sign', ['00:59:30:00.99', '23:30:30:00.50', 30], [-160200, -49]), ('partial repair probe: subframe sign', ['00:59:00:29.00', '00:00:00:01.05', 30], [-106227, -95]), ('partial repair variant: subframe sign', ['12:30:59:00.5', '12:00:59:01.99', 25], [-44998, -51]), ('boundary control', ['00:00:00:00.0', '12:00:00:00.0', 25], [1080000, 0]), ('boundary control', ['23:59:59:24.5', '00:00:00:00.0', 25], [0, 50]), ('normal control', ['01:30:00:24.50', '12:59:00:01.5', 25], [1033477, 0]), ('normal control', ['23:00:59:01.5', '01:30:00:00.0', 30], [268228, 50]), ('normal control', ['00:59:30:01.0', '12:59:30:01.0', 30], [1296000, 0])]]\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 SMPTE or any broadcast 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-broadcast-timecode-arithmetic-subframe-offset-subframe-sign","generated_at":"2026-09-29T14:49:38.607026+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Timecode arithmetic errors misplace edits, commercial breaks and captions against the broadcast clock.","root_cause":"The sign is not applied to the subframe component.","sha256":"ce47e50618ccb6e039b447f9b6fd7561a092694ebae6b3392863f35df3f6fdb0","title":"Chase-lock offset with subframes: subframe sign · 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.795,"exit_code":1,"observations":[{"actual":[-1,50],"check":"regression: subframe sign","expected":[-1,-50],"passed":false},{"actual":[-52230,45],"check":"regression variant: subframe sign","expected":[-52230,-45],"passed":false},{"actual":[-162871,49],"check":"partial repair probe: subframe sign","expected":[-162871,-49],"passed":false},{"actual":[-160200,49],"check":"partial repair variant: subframe sign","expected":[-160200,-49],"passed":false},{"actual":[1,50],"check":"boundary control","expected":[1,50],"passed":true},{"actual":[1080000,0],"check":"boundary control","expected":[1080000,0],"passed":true},{"actual":[0,50],"check":"normal control","expected":[0,50],"passed":true},{"actual":[106259,0],"check":"normal control","expected":[106259,0],"passed":true},{"actual":[1296000,0],"check":"normal control","expected":[1296000,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: subframe sign\", \"actual\": [-1, 50], \"expected\": [-1, -50], \"passed\": false}, {\"check\": \"regression variant: subframe sign\", \"actual\": [-52230, 45], \"expected\": [-52230, -45], \"passed\": false}, {\"check\": \"partial repair probe: subframe sign\", \"actual\": [-162871, 49], \"expected\": [-162871, -49], \"passed\": false}, {\"check\": \"partial repair variant: subframe sign\", \"actual\": [-160200, 49], \"expected\": [-160200, -49], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [1, 50], \"expected\": [1, 50], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [1080000, 0], \"expected\": [1080000, 0], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [0, 50], \"expected\": [0, 50], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [106259, 0], \"expected\": [106259, 0], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1296000, 0], \"expected\": [1296000, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.368,"exit_code":1,"observations":[{"actual":[-1,50],"check":"regression: subframe sign","expected":[-1,-50],"passed":false},{"actual":[-52230,45],"check":"regression variant: subframe sign","expected":[-52230,-45],"passed":false},{"actual":[-162871,49],"check":"partial repair probe: subframe sign","expected":[-162871,-49],"passed":false},{"actual":[-160200,49],"check":"partial repair variant: subframe sign","expected":[-160200,-49],"passed":false},{"actual":[1,50],"check":"boundary control","expected":[1,50],"passed":true},{"actual":[1080000,0],"check":"boundary control","expected":[1080000,0],"passed":true},{"actual":[0,50],"check":"normal control","expected":[0,50],"passed":true},{"actual":[106259,0],"check":"normal control","expected":[106259,0],"passed":true},{"actual":[1296000,0],"check":"normal control","expected":[1296000,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: subframe sign\", \"actual\": [-1, 50], \"expected\": [-1, -50], \"passed\": false}, {\"check\": \"regression variant: subframe sign\", \"actual\": [-52230, 45], \"expected\": [-52230, -45], \"passed\": false}, {\"check\": \"partial repair probe: subframe sign\", \"actual\": [-162871, 49], \"expected\": [-162871, -49], \"passed\": false}, {\"check\": \"partial repair variant: subframe sign\", \"actual\": [-160200, 49], \"expected\": [-160200, -49], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [1, 50], \"expected\": [1, 50], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [1080000, 0], \"expected\": [1080000, 0], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [0, 50], \"expected\": [0, 50], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [106259, 0], \"expected\": [106259, 0], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1296000, 0], \"expected\": [1296000, 0], \"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."}}