{"abstract":"Negative offsets are silently mirrored to positive frames.","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.","evaluation_group":"w2-broadcast-timecode-arithmetic-decimal-seconds-to-frame","failed_approach":"Clamping to zero hides the invalid input as frame zero.","family":"w2-broadcast-timecode-arithmetic-decimal-seconds-to-frame-negative-input","id":"FA-78756","implementations":{"attempt":{"sha256":"5f88214b42d6d5cf6df9086e6c4a681ee2e5c03633e5c106b4aa524765fabf3e","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        x=0\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%nominal)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative input', ['-1', [25, 1]], None), ('regression variant: negative input', ['-0.5', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [24, 1]], None), ('partial repair variant: negative input', ['-1', [30000, 1001]], None), ('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', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('normal control', ['0.02', [50, 1]], [1, '00:00:00:01'])], [('regression: negative input', ['-1', [24000, 1001]], None), ('regression variant: negative input', ['-1', [50, 1]], None), ('partial repair probe: negative input', ['-0.5', [25, 1]], None), ('partial repair variant: negative input', ['-1', [25, 1]], None), ('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.22', [24, 1]], [5, '00:00:00:05']), ('normal control', ['0', [24000, 1001]], [0, '00:00:00:00']), ('normal control', ['7.3', [24, 1]], [175, '00:00:07:07'])], [('regression: negative input', ['-1', [24, 1]], None), ('regression variant: negative input', ['-0.5', [24000, 1001]], None), ('partial repair probe: negative input', ['-0.5', [50, 1]], None), ('partial repair variant: negative input', ['-1', [24000, 1001]], None), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['0.04', [24, 1]], [1, '00:00:00:01']), ('normal control', ['0.18', [24, 1]], [4, '00:00:00:04']), ('normal control', ['0.02', [30000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [25, 1]], None), ('regression variant: negative input', ['-0.5', [24, 1]], None), ('partial repair probe: negative input', ['-0.5', [30000, 1001]], None), ('partial repair variant: negative input', ['-1', [24, 1]], None), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('normal control', ['0.1', [24000, 1001]], [2, '00:00:00:02']), ('normal control', ['3600', [30000, 1001]], [107892, '00:59:56:12']), ('normal control', ['0.04', [24000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [50, 1]], None), ('regression variant: negative input', ['-1', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [50, 1]], None), ('partial repair variant: negative input', ['-0.5', [25, 1]], None), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.14', [30000, 1001]], [4, '00:00:00:04']), ('normal control', ['0.0166', [50, 1]], [1, '00:00:00:01']), ('normal control', ['1.001', [50, 1]], [50, '00:00:01:00'])]]\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":"b7ce14ef2eb019086f0ed24b027f774a84d27eeafc7ed813b3b474b4002f26e8","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        x=-x\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%nominal)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative input', ['-1', [25, 1]], None), ('regression variant: negative input', ['-0.5', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [24, 1]], None), ('partial repair variant: negative input', ['-1', [30000, 1001]], None), ('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', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('normal control', ['0.02', [50, 1]], [1, '00:00:00:01'])], [('regression: negative input', ['-1', [24000, 1001]], None), ('regression variant: negative input', ['-1', [50, 1]], None), ('partial repair probe: negative input', ['-0.5', [25, 1]], None), ('partial repair variant: negative input', ['-1', [25, 1]], None), ('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.22', [24, 1]], [5, '00:00:00:05']), ('normal control', ['0', [24000, 1001]], [0, '00:00:00:00']), ('normal control', ['7.3', [24, 1]], [175, '00:00:07:07'])], [('regression: negative input', ['-1', [24, 1]], None), ('regression variant: negative input', ['-0.5', [24000, 1001]], None), ('partial repair probe: negative input', ['-0.5', [50, 1]], None), ('partial repair variant: negative input', ['-1', [24000, 1001]], None), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['0.04', [24, 1]], [1, '00:00:00:01']), ('normal control', ['0.18', [24, 1]], [4, '00:00:00:04']), ('normal control', ['0.02', [30000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [25, 1]], None), ('regression variant: negative input', ['-0.5', [24, 1]], None), ('partial repair probe: negative input', ['-0.5', [30000, 1001]], None), ('partial repair variant: negative input', ['-1', [24, 1]], None), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('normal control', ['0.1', [24000, 1001]], [2, '00:00:00:02']), ('normal control', ['3600', [30000, 1001]], [107892, '00:59:56:12']), ('normal control', ['0.04', [24000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [50, 1]], None), ('regression variant: negative input', ['-1', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [50, 1]], None), ('partial repair variant: negative input', ['-0.5', [25, 1]], None), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.14', [30000, 1001]], [4, '00:00:00:04']), ('normal control', ['0.0166', [50, 1]], [1, '00:00:00:01']), ('normal control', ['1.001', [50, 1]], [50, '00:00:01:00'])]]\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"},"fixed":{"sha256":"6f906ac1aded622f667cf8719819bbfd2d15a4dbdade4b47aeac0a6a790836f3","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%nominal)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: negative input', ['-1', [25, 1]], None), ('regression variant: negative input', ['-0.5', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [24, 1]], None), ('partial repair variant: negative input', ['-1', [30000, 1001]], None), ('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', ['12.345', [24000, 1001]], [296, '00:00:12:08']), ('normal control', ['0.02', [50, 1]], [1, '00:00:00:01'])], [('regression: negative input', ['-1', [24000, 1001]], None), ('regression variant: negative input', ['-1', [50, 1]], None), ('partial repair probe: negative input', ['-0.5', [25, 1]], None), ('partial repair variant: negative input', ['-1', [25, 1]], None), ('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.22', [24, 1]], [5, '00:00:00:05']), ('normal control', ['0', [24000, 1001]], [0, '00:00:00:00']), ('normal control', ['7.3', [24, 1]], [175, '00:00:07:07'])], [('regression: negative input', ['-1', [24, 1]], None), ('regression variant: negative input', ['-0.5', [24000, 1001]], None), ('partial repair probe: negative input', ['-0.5', [50, 1]], None), ('partial repair variant: negative input', ['-1', [24000, 1001]], None), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('boundary control', ['0.02', [25, 1]], [1, '00:00:00:01']), ('normal control', ['0.04', [24, 1]], [1, '00:00:00:01']), ('normal control', ['0.18', [24, 1]], [4, '00:00:00:04']), ('normal control', ['0.02', [30000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [25, 1]], None), ('regression variant: negative input', ['-0.5', [24, 1]], None), ('partial repair probe: negative input', ['-0.5', [30000, 1001]], None), ('partial repair variant: negative input', ['-1', [24, 1]], None), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('boundary control', ['1.001', [30000, 1001]], [30, '00:00:01:00']), ('normal control', ['0.1', [24000, 1001]], [2, '00:00:00:02']), ('normal control', ['3600', [30000, 1001]], [107892, '00:59:56:12']), ('normal control', ['0.04', [24000, 1001]], [1, '00:00:00:01'])], [('regression: negative input', ['-0.5', [50, 1]], None), ('regression variant: negative input', ['-1', [30000, 1001]], None), ('partial repair probe: negative input', ['-1', [50, 1]], None), ('partial repair variant: negative input', ['-0.5', [25, 1]], None), ('boundary control', ['0.06', [25, 1]], [2, '00:00:00:02']), ('boundary control', ['0', [24, 1]], [0, '00:00:00:00']), ('normal control', ['0.14', [30000, 1001]], [4, '00:00:00:04']), ('normal control', ['0.0166', [50, 1]], [1, '00:00:00:01']), ('normal control', ['1.001', [50, 1]], [50, '00:00:01:00'])]]\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-negative-input","generated_at":"2026-09-29T14:49:38.309956+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.","repair":"Return None for negative input.","root_cause":"Negative seconds are negated instead of rejected.","sha256":"2e5b1f4a7c9c88b349c16a8bd1b7281cd5bf1dcbf6acb5295416d32fe3951c57","title":"Decimal seconds to frame label: negative input · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.705,"exit_code":1,"observations":[{"actual":[0,"00:00:00:00"],"check":"regression: negative input","expected":null,"passed":false},{"actual":[0,"00:00:00:00"],"check":"regression variant: negative input","expected":null,"passed":false},{"actual":[0,"00:00:00:00"],"check":"partial repair probe: negative input","expected":null,"passed":false},{"actual":[0,"00:00:00:00"],"check":"partial repair variant: negative input","expected":null,"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":[296,"00:00:12:08"],"check":"normal control","expected":[296,"00:00:12:08"],"passed":true},{"actual":[1,"00:00:00:01"],"check":"normal control","expected":[1,"00:00:00:01"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative input\", \"actual\": [0, \"00:00:00:00\"], \"expected\": null, \"passed\": false}, {\"check\": \"regression variant: negative input\", \"actual\": [0, \"00:00:00:00\"], \"expected\": null, \"passed\": false}, {\"check\": \"partial repair probe: negative input\", \"actual\": [0, \"00:00:00:00\"], \"expected\": null, \"passed\": false}, {\"check\": \"partial repair variant: negative input\", \"actual\": [0, \"00:00:00:00\"], \"expected\": null, \"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\": [296, \"00:00:12:08\"], \"expected\": [296, \"00:00:12:08\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1, \"00:00:00:01\"], \"expected\": [1, \"00:00:00:01\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.632,"exit_code":1,"observations":[{"actual":[25,"00:00:01:00"],"check":"regression: negative input","expected":null,"passed":false},{"actual":[15,"00:00:00:15"],"check":"regression variant: negative input","expected":null,"passed":false},{"actual":[24,"00:00:01:00"],"check":"partial repair probe: negative input","expected":null,"passed":false},{"actual":[30,"00:00:01:00"],"check":"partial repair variant: negative input","expected":null,"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":[296,"00:00:12:08"],"check":"normal control","expected":[296,"00:00:12:08"],"passed":true},{"actual":[1,"00:00:00:01"],"check":"normal control","expected":[1,"00:00:00:01"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative input\", \"actual\": [25, \"00:00:01:00\"], \"expected\": null, \"passed\": false}, {\"check\": \"regression variant: negative input\", \"actual\": [15, \"00:00:00:15\"], \"expected\": null, \"passed\": false}, {\"check\": \"partial repair probe: negative input\", \"actual\": [24, \"00:00:01:00\"], \"expected\": null, \"passed\": false}, {\"check\": \"partial repair variant: negative input\", \"actual\": [30, \"00:00:01:00\"], \"expected\": null, \"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\": [296, \"00:00:12:08\"], \"expected\": [296, \"00:00:12:08\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1, \"00:00:00:01\"], \"expected\": [1, \"00:00:00:01\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.034,"exit_code":0,"observations":[{"actual":null,"check":"regression: negative input","expected":null,"passed":true},{"actual":null,"check":"regression variant: negative input","expected":null,"passed":true},{"actual":null,"check":"partial repair probe: negative input","expected":null,"passed":true},{"actual":null,"check":"partial repair variant: negative input","expected":null,"passed":true},{"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":[296,"00:00:12:08"],"check":"normal control","expected":[296,"00:00:12:08"],"passed":true},{"actual":[1,"00:00:00:01"],"check":"normal control","expected":[1,"00:00:00:01"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative input\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression variant: negative input\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"partial repair probe: negative input\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"partial repair variant: negative input\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"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\": [296, \"00:00:12:08\"], \"expected\": [296, \"00:00:12:08\"], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [1, \"00:00:00:01\"], \"expected\": [1, \"00:00:00:01\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}