{"abstract":"NTSC labels show frame fields in the thousands.","category":"Broadcast timecode arithmetic","checks":9,"contract":"Convert a decimal seconds string exactly (no binary floating point) at rate [N,D] to the nearest frame, halves rounding up, and a non-drop label using the nominal rate ceil(N/D). Negative input returns None.","contract_signature":"sec, fps","evaluation_group":"w2-broadcast-timecode-arithmetic-decimal-seconds-to-frame","failed_approach":"The truncated rate gives 29 labels per second at 29.97.","family":"w2-broadcast-timecode-arithmetic-decimal-seconds-to-frame-frame-field-modulus","id":"FA-78761","implementations":{"attempt":{"sha256":"4344a2629fd2d68df6207e519ee96f420a886a2d903e5e616321b8d85d75e052","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(sec, fps):\n    num,den=fps\n    x=Fraction(sec)\n    if x<0:\n        return None\n    n=x*num/den\n    fr=math.floor(n+Fraction(1,2))\n    nominal=-(-num//den)\n    return [fr,'%02d:%02d:%02d:%02d'%(fr//(3600*nominal)%24,fr//(60*nominal)%60,fr//nominal%60,fr%(num//den))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: frame field modulus', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('regression variant: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('partial repair probe: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('partial repair variant: frame field modulus', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['-1', [24000, 1001]], None), ('normal control', ['-1', [24, 1]], None)], [('regression: frame field modulus', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('regression variant: frame field modulus', ['7.3', [24000, 1001]], [175, '00:00:07:07']), ('partial repair probe: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('partial repair variant: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('normal control', ['0.14', [24000, 1001]], [3, '00:00:00:03']), ('normal control', ['0.18', [24000, 1001]], [4, '00:00:00:04']), ('normal control', ['0', [24000, 1001]], [0, '00:00:00:00'])], [('regression: frame field modulus', ['3600', [30000, 1001]], [107892, '00:59:56:12']), ('regression variant: frame field modulus', ['1.5', [30000, 1001]], [45, '00:00:01:15']), ('partial repair probe: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('partial repair variant: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('boundary control', ['-1', [25, 1]], None), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['7.3', [24, 1]], [175, '00:00:07:07']), ('normal control', ['1.001', [24, 1]], [24, '00:00:01:00']), ('normal control', ['0.5005', [50, 1]], [25, '00:00:00:25'])], [('regression: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('regression variant: frame field modulus', ['3600', [24000, 1001]], [86314, '00:59:56:10']), ('partial repair probe: frame field modulus', ['7.3', [24000, 1001]], [175, '00:00:07:07']), ('partial repair variant: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('boundary control', ['-1', [25, 1]], None), ('normal control', ['0.1', [25, 1]], [3, '00:00:00:03']), ('normal control', ['0.1', [24000, 1001]], [2, '00:00:00:02']), ('normal control', ['0.1', [50, 1]], [5, '00:00:00:05'])], [('regression: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('regression variant: frame field modulus', ['1.5', [24000, 1001]], [36, '00:00:01:12']), ('partial repair probe: frame field modulus', ['1.5', [30000, 1001]], [45, '00:00:01:15']), ('partial repair variant: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.04', [24000, 1001]], [1, '00:00:00:01']), ('normal control', ['0.14', [25, 1]], [4, '00:00:00:04']), ('normal control', ['0.0166', [50, 1]], [1, '00:00:00:01'])]]\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":"bb9285a519ef491c5fd274a092e66f7bb639b3ef77fd2fc64a4d8575708ab4df","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(sec, fps):\n    num,den=fps\n    x=Fraction(sec)\n    if x<0:\n        return None\n    n=x*num/den\n    fr=math.floor(n+Fraction(1,2))\n    nominal=-(-num//den)\n    return [fr,'%02d:%02d:%02d:%02d'%(fr//(3600*nominal)%24,fr//(60*nominal)%60,fr//nominal%60,fr%num)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: frame field modulus', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('regression variant: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('partial repair probe: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('partial repair variant: frame field modulus', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['-1', [24000, 1001]], None), ('normal control', ['-1', [24, 1]], None)], [('regression: frame field modulus', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('regression variant: frame field modulus', ['7.3', [24000, 1001]], [175, '00:00:07:07']), ('partial repair probe: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('partial repair variant: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('normal control', ['0.14', [24000, 1001]], [3, '00:00:00:03']), ('normal control', ['0.18', [24000, 1001]], [4, '00:00:00:04']), ('normal control', ['0', [24000, 1001]], [0, '00:00:00:00'])], [('regression: frame field modulus', ['3600', [30000, 1001]], [107892, '00:59:56:12']), ('regression variant: frame field modulus', ['1.5', [30000, 1001]], [45, '00:00:01:15']), ('partial repair probe: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('partial repair variant: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('boundary control', ['-1', [25, 1]], None), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['7.3', [24, 1]], [175, '00:00:07:07']), ('normal control', ['1.001', [24, 1]], [24, '00:00:01:00']), ('normal control', ['0.5005', [50, 1]], [25, '00:00:00:25'])], [('regression: frame field modulus', ['7.3', [30000, 1001]], [219, '00:00:07:09']), ('regression variant: frame field modulus', ['3600', [24000, 1001]], [86314, '00:59:56:10']), ('partial repair probe: frame field modulus', ['7.3', [24000, 1001]], [175, '00:00:07:07']), ('partial repair variant: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('boundary control', ['-1', [25, 1]], None), ('normal control', ['0.1', [25, 1]], [3, '00:00:00:03']), ('normal control', ['0.1', [24000, 1001]], [2, '00:00:00:02']), ('normal control', ['0.1', [50, 1]], [5, '00:00:00:05'])], [('regression: frame field modulus', ['1.001', [24000, 1001]], [24, '00:00:01:00']), ('regression variant: frame field modulus', ['1.5', [24000, 1001]], [36, '00:00:01:12']), ('partial repair probe: frame field modulus', ['1.5', [30000, 1001]], [45, '00:00:01:15']), ('partial repair variant: frame field modulus', ['12.345', [30000, 1001]], [370, '00:00:12:10']), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.04', [24000, 1001]], [1, '00:00:00:01']), ('normal control', ['0.14', [25, 1]], [4, '00:00:00:04']), ('normal control', ['0.0166', [50, 1]], [1, '00:00:00:01'])]]\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-decimal-seconds-to-frame-frame-field-modulus","generated_at":"2026-09-29T14:49:38.352888+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 frame field is reduced modulo the rate numerator.","sha256":"9a75738551d5d0312eea688d54f3343fd577cf7f651acf065a1e2876573c3297","title":"Decimal seconds to frame label: frame field modulus · 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":40.667,"exit_code":1,"observations":[{"actual":[30,"00:00:01:01"],"check":"regression: frame field modulus","expected":[30,"00:00:01:00"],"passed":false},{"actual":[370,"00:00:12:22"],"check":"regression variant: frame field modulus","expected":[370,"00:00:12:10"],"passed":false},{"actual":[219,"00:00:07:16"],"check":"partial repair probe: frame field modulus","expected":[219,"00:00:07:09"],"passed":false},{"actual":[296,"00:00:12:20"],"check":"partial repair variant: frame field modulus","expected":[296,"00:00:12:08"],"passed":false},{"actual":[2,"00:00:00:02"],"check":"boundary control","expected":[2,"00:00:00:02"],"passed":true},{"actual":[0,"00:00:00:00"],"check":"boundary control","expected":[0,"00:00:00:00"],"passed":true},{"actual":[1,"00:00:00:01"],"check":"normal control","expected":[1,"00:00:00:01"],"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: frame field modulus\", \"actual\": [30, \"00:00:01:01\"], \"expected\": [30, \"00:00:01:00\"], \"passed\": false}, {\"check\": \"regression variant: frame field modulus\", \"actual\": [370, \"00:00:12:22\"], \"expected\": [370, \"00:00:12:10\"], \"passed\": false}, {\"check\": \"partial repair probe: frame field modulus\", \"actual\": [219, \"00:00:07:16\"], \"expected\": [219, \"00:00:07:09\"], \"passed\": false}, {\"check\": \"partial repair variant: frame field modulus\", \"actual\": [296, \"00:00:12:20\"], \"expected\": [296, \"00:00:12:08\"], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [2, \"00:00:00:02\"], \"expected\": [2, \"00:00:00:02\"], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [0, \"00:00:00:00\"], \"expected\": [0, \"00:00:00:00\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1, \"00:00:00:01\"], \"expected\": [1, \"00:00:00:01\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"normal control\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.565,"exit_code":1,"observations":[{"actual":[30,"00:00:01:30"],"check":"regression: frame field modulus","expected":[30,"00:00:01:00"],"passed":false},{"actual":[370,"00:00:12:370"],"check":"regression variant: frame field modulus","expected":[370,"00:00:12:10"],"passed":false},{"actual":[219,"00:00:07:219"],"check":"partial repair probe: frame field modulus","expected":[219,"00:00:07:09"],"passed":false},{"actual":[296,"00:00:12:296"],"check":"partial repair variant: frame field modulus","expected":[296,"00:00:12:08"],"passed":false},{"actual":[2,"00:00:00:02"],"check":"boundary control","expected":[2,"00:00:00:02"],"passed":true},{"actual":[0,"00:00:00:00"],"check":"boundary control","expected":[0,"00:00:00:00"],"passed":true},{"actual":[1,"00:00:00:01"],"check":"normal control","expected":[1,"00:00:00:01"],"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true},{"actual":null,"check":"normal control","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: frame field modulus\", \"actual\": [30, \"00:00:01:30\"], \"expected\": [30, \"00:00:01:00\"], \"passed\": false}, {\"check\": \"regression variant: frame field modulus\", \"actual\": [370, \"00:00:12:370\"], \"expected\": [370, \"00:00:12:10\"], \"passed\": false}, {\"check\": \"partial repair probe: frame field modulus\", \"actual\": [219, \"00:00:07:219\"], \"expected\": [219, \"00:00:07:09\"], \"passed\": false}, {\"check\": \"partial repair variant: frame field modulus\", \"actual\": [296, \"00:00:12:296\"], \"expected\": [296, \"00:00:12:08\"], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [2, \"00:00:00:02\"], \"expected\": [2, \"00:00:00:02\"], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [0, \"00:00:00:00\"], \"expected\": [0, \"00:00:00:00\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1, \"00:00:00:01\"], \"expected\": [1, \"00:00:00:01\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": null, \"expected\": null, \"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."}}