{"abstract":"Cue ends near a cut are snapped against the wrong reference point.","category":"Subtitle cue timing","checks":9,"contract":"For each cue, the start snaps to the nearest shot change within window ms (|shot - start| <= window; ties go to the earlier shot). The end snaps so that it sits gap ms before the nearest shot change within window of end+gap. If snapping leaves end <= start, the original cue is kept unchanged.","contract_signature":"cues, shots, window, gap","evaluation_group":"w2-subtitle-cue-timing-shot-change-snap","failed_approach":"Probing at end-gap moves the reference point the wrong way.","family":"w2-subtitle-cue-timing-shot-change-snap-end-snap-probe","id":"FA-78151","implementations":{"attempt":{"sha256":"e947ec01422dfe99e09d0b4f2effedb4e1e89f6e8bf1129124474c0c38c7a0c8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cues, shots, window, gap):\n    def near(t):\n        best=None\n        for sc in shots:\n            d=abs(sc-t)\n            if d<=window and (best is None or d<abs(best-t)):\n                best=sc\n        return best\n    out=[]\n    for s0,e0 in cues:\n        s,e=s0,e0\n        a=near(s)\n        if a is not None:\n            s=a\n        b=near(e-gap)\n        if b is not None:\n            e=b-gap\n        if e<=s:\n            s,e=s0,e0\n        out.append([s,e])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: end snap probe', [[[3900, 3910], [101, 1201], [4050, 4060]], [0, 2150, 3040, 4000], 100, 80], [[3900, 3910], [101, 1201], [4000, 4060]]), ('regression variant: end snap probe', [[[2100, 2600], [0, 801], [1250, 1260]], [0, 1200, 2000, 3040], 100, 42], [[2000, 2600], [0, 801], [1200, 1260]]), ('partial repair probe: end snap probe', [[[50, 950]], [0, 1200], 250, 42], [[0, 1158]]), ('partial repair variant: end snap probe', [[[0, 839], [0, 1050], [950, 960]], [0, 1000], 200, 42], [[0, 958], [0, 958], [950, 960]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[50, 80], [4050, 5050]], [0, 1100, 2150, 3000, 4000], 250, 0], [[50, 80], [4000, 5050]]), ('normal control', [[[1251, 1261], [0, 851]], [0, 1000, 3040], 250, 80], [[1251, 1261], [0, 920]])], [('regression: end snap probe', [[[1351, 2451], [1000, 1030], [1050, 1550]], [0, 1000, 1100], 250, 80], [[1351, 2451], [1000, 1020], [1000, 1550]]), ('regression variant: end snap probe', [[[2150, 3190], [1050, 2150], [1801, 2301]], [1100, 1200, 2000, 2150, 4000], 200, 80], [[2150, 3190], [1100, 2070], [2000, 2301]]), ('partial repair probe: end snap probe', [[[1450, 1460], [949, 1849]], [1200], 250, 80], [[1200, 1460], [949, 1849]]), ('partial repair variant: end snap probe', [[[1100, 1600], [3241, 4241]], [0, 1100, 2000, 3040, 4000], 200, 80], [[1100, 1600], [3241, 4241]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[1200, 1230], [801, 1301], [1050, 1550]], [1000, 2150], 200, 0], [[1000, 1230], [1000, 1301], [1000, 1550]]), ('normal control', [[[50, 1150]], [0, 1200, 2000, 2150], 250, 80], [[0, 1120]]), ('normal control', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]])], [('regression: end snap probe', [[[3250, 4250]], [1100, 2000, 3000, 3040, 4000], 250, 42], [[3040, 4250]]), ('regression variant: end snap probe', [[[1450, 2490], [950, 1450], [1451, 1481]], [1100, 1200], 250, 80], [[1200, 2490], [1100, 1450], [1451, 1481]]), ('partial repair probe: end snap probe', [[[1150, 2050], [849, 859], [1350, 2390]], [1100, 3000], 250, 80], [[1100, 2050], [849, 1020], [1100, 2390]]), ('partial repair variant: end snap probe', [[[2250, 2260], [1250, 1280], [1100, 1600]], [1000, 1200, 2150], 100, 80], [[2150, 2260], [1200, 1280], [1000, 1600]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[1801, 2841], [1000, 1010]], [1000, 1200, 2000, 2150], 200, 42], [[2000, 2841], [1000, 1010]]), ('normal control', [[[1751, 2651], [851, 1851]], [1100, 2000, 2150, 3040], 250, 80], [[2000, 2651], [1100, 1920]]), ('normal control', [[[1000, 2000], [3901, 4401]], [1100, 2000, 2150, 4000], 100, 42], [[1100, 1958], [4000, 4401]])], [('regression: end snap probe', [[[2250, 2260], [1250, 1280], [1100, 1600]], [1000, 1200, 2150], 100, 80], [[2150, 2260], [1200, 1280], [1000, 1600]]), ('regression variant: end snap probe', [[[2050, 2060], [2350, 3250], [3200, 3700]], [2000, 2150, 3000], 200, 42], [[2000, 2108], [2150, 3250], [3000, 3700]]), ('partial repair probe: end snap probe', [[[1300, 1310], [3901, 4941]], [1200, 4000], 100, 42], [[1200, 1310], [4000, 4941]]), ('partial repair variant: end snap probe', [[[3201, 3231], [4201, 5301]], [1100, 3000, 3040, 4000], 200, 42], [[3040, 3231], [4201, 5301]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[899, 1999]], [1000], 100, 80], [[899, 1999]]), ('normal control', [[[899, 1399], [3201, 3701], [1050, 2050]], [1100, 3000], 200, 80], [[899, 1399], [3201, 3701], [1100, 2050]]), ('normal control', [[[750, 1850], [951, 1851], [950, 1850]], [1000, 1200], 250, 80], [[1000, 1850], [1000, 1851], [1000, 1850]])], [('regression: end snap probe', [[[3201, 3231], [4201, 5301]], [1100, 3000, 3040, 4000], 200, 42], [[3040, 3231], [4201, 5301]]), ('regression variant: end snap probe', [[[2750, 3250]], [2000, 3000, 4000], 250, 80], [[3000, 3250]]), ('partial repair probe: end snap probe', [[[1150, 2250], [1200, 1230], [3900, 5000]], [0, 1100, 4000], 100, 42], [[1100, 2250], [1100, 1230], [4000, 5000]]), ('partial repair variant: end snap probe', [[[2100, 2600], [0, 801], [1250, 1260]], [0, 1200, 2000, 3040], 100, 42], [[2000, 2600], [0, 801], [1200, 1260]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[1050, 2150], [0, 1]], [0, 1000, 3000], 200, 0], [[1000, 2150], [0, 1]]), ('normal control', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('normal control', [[[2990, 3020], [3040, 4140], [3040, 4040]], [0, 2000, 3040], 100, 42], [[2990, 3020], [3040, 4140], [3040, 4040]])]]\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":"f849229570ef37dcc318fb019bccb68d5a428fd7b751ef16ecaf3ae3adf911bd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cues, shots, window, gap):\n    def near(t):\n        best=None\n        for sc in shots:\n            d=abs(sc-t)\n            if d<=window and (best is None or d<abs(best-t)):\n                best=sc\n        return best\n    out=[]\n    for s0,e0 in cues:\n        s,e=s0,e0\n        a=near(s)\n        if a is not None:\n            s=a\n        b=near(e)\n        if b is not None:\n            e=b-gap\n        if e<=s:\n            s,e=s0,e0\n        out.append([s,e])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: end snap probe', [[[3900, 3910], [101, 1201], [4050, 4060]], [0, 2150, 3040, 4000], 100, 80], [[3900, 3910], [101, 1201], [4000, 4060]]), ('regression variant: end snap probe', [[[2100, 2600], [0, 801], [1250, 1260]], [0, 1200, 2000, 3040], 100, 42], [[2000, 2600], [0, 801], [1200, 1260]]), ('partial repair probe: end snap probe', [[[50, 950]], [0, 1200], 250, 42], [[0, 1158]]), ('partial repair variant: end snap probe', [[[0, 839], [0, 1050], [950, 960]], [0, 1000], 200, 42], [[0, 958], [0, 958], [950, 960]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[50, 80], [4050, 5050]], [0, 1100, 2150, 3000, 4000], 250, 0], [[50, 80], [4000, 5050]]), ('normal control', [[[1251, 1261], [0, 851]], [0, 1000, 3040], 250, 80], [[1251, 1261], [0, 920]])], [('regression: end snap probe', [[[1351, 2451], [1000, 1030], [1050, 1550]], [0, 1000, 1100], 250, 80], [[1351, 2451], [1000, 1020], [1000, 1550]]), ('regression variant: end snap probe', [[[2150, 3190], [1050, 2150], [1801, 2301]], [1100, 1200, 2000, 2150, 4000], 200, 80], [[2150, 3190], [1100, 2070], [2000, 2301]]), ('partial repair probe: end snap probe', [[[1450, 1460], [949, 1849]], [1200], 250, 80], [[1200, 1460], [949, 1849]]), ('partial repair variant: end snap probe', [[[1100, 1600], [3241, 4241]], [0, 1100, 2000, 3040, 4000], 200, 80], [[1100, 1600], [3241, 4241]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[1200, 1230], [801, 1301], [1050, 1550]], [1000, 2150], 200, 0], [[1000, 1230], [1000, 1301], [1000, 1550]]), ('normal control', [[[50, 1150]], [0, 1200, 2000, 2150], 250, 80], [[0, 1120]]), ('normal control', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]])], [('regression: end snap probe', [[[3250, 4250]], [1100, 2000, 3000, 3040, 4000], 250, 42], [[3040, 4250]]), ('regression variant: end snap probe', [[[1450, 2490], [950, 1450], [1451, 1481]], [1100, 1200], 250, 80], [[1200, 2490], [1100, 1450], [1451, 1481]]), ('partial repair probe: end snap probe', [[[1150, 2050], [849, 859], [1350, 2390]], [1100, 3000], 250, 80], [[1100, 2050], [849, 1020], [1100, 2390]]), ('partial repair variant: end snap probe', [[[2250, 2260], [1250, 1280], [1100, 1600]], [1000, 1200, 2150], 100, 80], [[2150, 2260], [1200, 1280], [1000, 1600]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[1801, 2841], [1000, 1010]], [1000, 1200, 2000, 2150], 200, 42], [[2000, 2841], [1000, 1010]]), ('normal control', [[[1751, 2651], [851, 1851]], [1100, 2000, 2150, 3040], 250, 80], [[2000, 2651], [1100, 1920]]), ('normal control', [[[1000, 2000], [3901, 4401]], [1100, 2000, 2150, 4000], 100, 42], [[1100, 1958], [4000, 4401]])], [('regression: end snap probe', [[[2250, 2260], [1250, 1280], [1100, 1600]], [1000, 1200, 2150], 100, 80], [[2150, 2260], [1200, 1280], [1000, 1600]]), ('regression variant: end snap probe', [[[2050, 2060], [2350, 3250], [3200, 3700]], [2000, 2150, 3000], 200, 42], [[2000, 2108], [2150, 3250], [3000, 3700]]), ('partial repair probe: end snap probe', [[[1300, 1310], [3901, 4941]], [1200, 4000], 100, 42], [[1200, 1310], [4000, 4941]]), ('partial repair variant: end snap probe', [[[3201, 3231], [4201, 5301]], [1100, 3000, 3040, 4000], 200, 42], [[3040, 3231], [4201, 5301]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[899, 1999]], [1000], 100, 80], [[899, 1999]]), ('normal control', [[[899, 1399], [3201, 3701], [1050, 2050]], [1100, 3000], 200, 80], [[899, 1399], [3201, 3701], [1100, 2050]]), ('normal control', [[[750, 1850], [951, 1851], [950, 1850]], [1000, 1200], 250, 80], [[1000, 1850], [1000, 1851], [1000, 1850]])], [('regression: end snap probe', [[[3201, 3231], [4201, 5301]], [1100, 3000, 3040, 4000], 200, 42], [[3040, 3231], [4201, 5301]]), ('regression variant: end snap probe', [[[2750, 3250]], [2000, 3000, 4000], 250, 80], [[3000, 3250]]), ('partial repair probe: end snap probe', [[[1150, 2250], [1200, 1230], [3900, 5000]], [0, 1100, 4000], 100, 42], [[1100, 2250], [1100, 1230], [4000, 5000]]), ('partial repair variant: end snap probe', [[[2100, 2600], [0, 801], [1250, 1260]], [0, 1200, 2000, 3040], 100, 42], [[2000, 2600], [0, 801], [1200, 1260]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('normal control', [[[1050, 2150], [0, 1]], [0, 1000, 3000], 200, 0], [[1000, 2150], [0, 1]]), ('normal control', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('normal control', [[[2990, 3020], [3040, 4140], [3040, 4040]], [0, 2000, 3040], 100, 42], [[2990, 3020], [3040, 4140], [3040, 4040]])]]\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-shot-change-snap-end-snap-probe","generated_at":"2026-09-29T14:49:32.669211+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 end is probed at its own time instead of end+gap.","sha256":"4fda953d177bd102e37974d51fce44c849ba3c3e3e98cadfff146aa2c6bdd89a","title":"Shot-change snapping of cue boundaries: end snap probe · 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.168,"exit_code":1,"observations":[{"actual":[[3900,3910],[101,1201],[4050,4060]],"check":"regression: end snap probe","expected":[[3900,3910],[101,1201],[4000,4060]],"passed":false},{"actual":[[2000,2600],[0,801],[1250,1260]],"check":"regression variant: end snap probe","expected":[[2000,2600],[0,801],[1200,1260]],"passed":false},{"actual":[[0,950]],"check":"partial repair probe: end snap probe","expected":[[0,1158]],"passed":false},{"actual":[[0,839],[0,958],[950,960]],"check":"partial repair variant: end snap probe","expected":[[0,958],[0,958],[950,960]],"passed":false},{"actual":[[1000,1500]],"check":"boundary control","expected":[[1000,1500]],"passed":true},{"actual":[[1200,1800]],"check":"boundary control","expected":[[1200,1800]],"passed":true},{"actual":[[1000,1010]],"check":"normal control","expected":[[1000,1010]],"passed":true},{"actual":[[50,80],[4000,5050]],"check":"normal control","expected":[[50,80],[4000,5050]],"passed":true},{"actual":[[1251,1261],[0,920]],"check":"normal control","expected":[[1251,1261],[0,920]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: end snap probe\", \"actual\": [[3900, 3910], [101, 1201], [4050, 4060]], \"expected\": [[3900, 3910], [101, 1201], [4000, 4060]], \"passed\": false}, {\"check\": \"regression variant: end snap probe\", \"actual\": [[2000, 2600], [0, 801], [1250, 1260]], \"expected\": [[2000, 2600], [0, 801], [1200, 1260]], \"passed\": false}, {\"check\": \"partial repair probe: end snap probe\", \"actual\": [[0, 950]], \"expected\": [[0, 1158]], \"passed\": false}, {\"check\": \"partial repair variant: end snap probe\", \"actual\": [[0, 839], [0, 958], [950, 960]], \"expected\": [[0, 958], [0, 958], [950, 960]], \"passed\": false}, {\"check\": \"boundary control\", \"actual\": [[1000, 1500]], \"expected\": [[1000, 1500]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1200, 1800]], \"expected\": [[1200, 1800]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1000, 1010]], \"expected\": [[1000, 1010]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[50, 80], [4000, 5050]], \"expected\": [[50, 80], [4000, 5050]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1251, 1261], [0, 920]], \"expected\": [[1251, 1261], [0, 920]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.287,"exit_code":1,"observations":[{"actual":[[3900,3910],[101,1201],[4050,4060]],"check":"regression: end snap probe","expected":[[3900,3910],[101,1201],[4000,4060]],"passed":false},{"actual":[[2000,2600],[0,801],[1250,1260]],"check":"regression variant: end snap probe","expected":[[2000,2600],[0,801],[1200,1260]],"passed":false},{"actual":[[0,1158]],"check":"partial repair probe: end snap probe","expected":[[0,1158]],"passed":true},{"actual":[[0,958],[0,958],[950,960]],"check":"partial repair variant: end snap probe","expected":[[0,958],[0,958],[950,960]],"passed":true},{"actual":[[1000,1500]],"check":"boundary control","expected":[[1000,1500]],"passed":true},{"actual":[[1200,1800]],"check":"boundary control","expected":[[1200,1800]],"passed":true},{"actual":[[1000,1010]],"check":"normal control","expected":[[1000,1010]],"passed":true},{"actual":[[50,80],[4000,5050]],"check":"normal control","expected":[[50,80],[4000,5050]],"passed":true},{"actual":[[1251,1261],[0,920]],"check":"normal control","expected":[[1251,1261],[0,920]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: end snap probe\", \"actual\": [[3900, 3910], [101, 1201], [4050, 4060]], \"expected\": [[3900, 3910], [101, 1201], [4000, 4060]], \"passed\": false}, {\"check\": \"regression variant: end snap probe\", \"actual\": [[2000, 2600], [0, 801], [1250, 1260]], \"expected\": [[2000, 2600], [0, 801], [1200, 1260]], \"passed\": false}, {\"check\": \"partial repair probe: end snap probe\", \"actual\": [[0, 1158]], \"expected\": [[0, 1158]], \"passed\": true}, {\"check\": \"partial repair variant: end snap probe\", \"actual\": [[0, 958], [0, 958], [950, 960]], \"expected\": [[0, 958], [0, 958], [950, 960]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1000, 1500]], \"expected\": [[1000, 1500]], \"passed\": true}, {\"check\": \"boundary control\", \"actual\": [[1200, 1800]], \"expected\": [[1200, 1800]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1000, 1010]], \"expected\": [[1000, 1010]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[50, 80], [4000, 5050]], \"expected\": [[50, 80], [4000, 5050]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1251, 1261], [0, 920]], \"expected\": [[1251, 1261], [0, 920]], \"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."}}