{"abstract":"Short cues between two nearby cuts collapse to zero length.","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":"Comparing with the original start misses collapses caused by a start snapped later.","family":"w2-subtitle-cue-timing-shot-change-snap-collapse-revert","id":"FA-78161","implementations":{"attempt":{"sha256":"98d9855b8147b6dd34fd9d1d181d4bf63504161c69993f76d0339800943cf43b","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<=s0:\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: collapse revert', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('regression variant: collapse revert', [[[1101, 1111], [950, 960], [950, 1850]], [1000, 4000], 100, 0], [[1101, 1111], [950, 960], [1000, 1850]]), ('partial repair probe: collapse revert', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]]), ('partial repair variant: collapse revert', [[[2750, 3250], [3751, 3761], [2950, 2980]], [3000, 4000], 250, 0], [[2750, 3250], [3751, 3761], [2950, 2980]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[850, 1890], [3000, 4000]], [1100, 3000], 250, 80], [[1100, 1890], [3000, 4000]]), ('normal control', [[[1251, 1261], [0, 851]], [0, 1000, 3040], 250, 80], [[1251, 1261], [0, 920]]), ('normal control', [[[1200, 1230], [801, 1301], [1050, 1550]], [1000, 2150], 200, 0], [[1000, 1230], [1000, 1301], [1000, 1550]])], [('regression: collapse revert', [[[50, 80], [4050, 5050]], [0, 1100, 2150, 3000, 4000], 250, 0], [[50, 80], [4000, 5050]]), ('regression variant: collapse revert', [[[1050, 2150], [0, 1]], [0, 1000, 3000], 200, 0], [[1000, 2150], [0, 1]]), ('partial repair probe: collapse revert', [[[2950, 2980]], [1200, 2150, 3000], 250, 0], [[2950, 2980]]), ('partial repair variant: collapse revert', [[[950, 1450], [1250, 2150], [1750, 2250]], [1000, 1200, 2000], 250, 0], [[1000, 1200], [1200, 2000], [1750, 2250]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[50, 1150]], [0, 1200, 2000, 2150], 250, 80], [[0, 1120]]), ('normal control', [[[1801, 2841], [1000, 1010]], [1000, 1200, 2000, 2150], 200, 42], [[2000, 2841], [1000, 1010]]), ('normal control', [[[4201, 5101], [4201, 5201], [4201, 4701]], [4000], 200, 0], [[4201, 5101], [4201, 5201], [4201, 4701]])], [('regression: collapse revert', [[[2950, 2980], [4050, 5150]], [2150, 3000, 4000], 250, 0], [[2950, 2980], [4000, 5150]]), ('regression variant: collapse revert', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('partial repair probe: collapse revert', [[[3000, 3900], [900, 930], [3000, 3030]], [0, 1100, 1200, 3000], 200, 80], [[3000, 3900], [900, 930], [3000, 3030]]), ('partial repair variant: collapse revert', [[[3200, 4200], [3801, 3811], [2950, 3950]], [1000, 3000, 4000], 200, 0], [[3000, 4000], [3801, 3811], [3000, 4000]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[1000, 2000], [3901, 4401]], [1100, 2000, 2150, 4000], 100, 42], [[1100, 1958], [4000, 4401]]), ('normal control', [[[3040, 3070], [2790, 3890], [849, 859]], [1100, 3040], 250, 80], [[3040, 3070], [3040, 3890], [849, 1020]]), ('normal control', [[[899, 1399], [3201, 3701], [1050, 2050]], [1100, 3000], 200, 80], [[899, 1399], [3201, 3701], [1100, 2050]])], [('regression: collapse revert', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]]), ('regression variant: collapse revert', [[[851, 1951], [4050, 4060], [1350, 2250]], [1100, 4000], 250, 0], [[1100, 1951], [4050, 4060], [1100, 2250]]), ('partial repair probe: collapse revert', [[[1101, 1111], [950, 960], [950, 1850]], [1000, 4000], 100, 0], [[1101, 1111], [950, 960], [1000, 1850]]), ('partial repair variant: collapse revert', [[[851, 1891], [1100, 2100], [850, 880]], [1100], 250, 0], [[1100, 1891], [1100, 2100], [850, 880]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[50, 950]], [0, 1200], 250, 42], [[0, 1158]]), ('normal control', [[[4201, 5101], [1150, 1650], [2200, 3240]], [1100, 2000, 4000], 200, 0], [[4201, 5101], [1100, 1650], [2000, 3240]]), ('normal control', [[[2050, 3050]], [0, 2000, 2150], 100, 42], [[2000, 3050]])], [('regression: collapse revert', [[[2950, 2980]], [1200, 2150, 3000], 250, 0], [[2950, 2980]]), ('regression variant: collapse revert', [[[0, 249], [0, 500]], [0, 1000], 250, 0], [[0, 249], [0, 500]]), ('partial repair probe: collapse revert', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('partial repair variant: collapse revert', [[[850, 1350], [849, 1349], [4000, 4030]], [1100, 2000, 3000, 4000], 250, 0], [[850, 1350], [849, 1100], [4000, 4030]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[951, 1851], [1150, 2250], [1350, 2250]], [1100, 1200], 250, 42], [[1100, 1851], [1100, 2250], [1200, 2250]]), ('normal control', [[[1150, 2050], [849, 859], [1350, 2390]], [1100, 3000], 250, 80], [[1100, 2050], [849, 1020], [1100, 2390]]), ('normal control', [[[3000, 3010], [2800, 3700], [2799, 3799]], [1200, 3000], 200, 42], [[3000, 3010], [3000, 3700], [2799, 3799]])]]\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":"fc1d7b1f1d88ae82bd8757f619ca490dfd3a07ed5d265de177c20e2b41064c71","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: collapse revert', [[[1000, 1010]], [1000, 1100], 100, 0], [[1000, 1010]]), ('regression variant: collapse revert', [[[1101, 1111], [950, 960], [950, 1850]], [1000, 4000], 100, 0], [[1101, 1111], [950, 960], [1000, 1850]]), ('partial repair probe: collapse revert', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]]), ('partial repair variant: collapse revert', [[[2750, 3250], [3751, 3761], [2950, 2980]], [3000, 4000], 250, 0], [[2750, 3250], [3751, 3761], [2950, 2980]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[850, 1890], [3000, 4000]], [1100, 3000], 250, 80], [[1100, 1890], [3000, 4000]]), ('normal control', [[[1251, 1261], [0, 851]], [0, 1000, 3040], 250, 80], [[1251, 1261], [0, 920]]), ('normal control', [[[1200, 1230], [801, 1301], [1050, 1550]], [1000, 2150], 200, 0], [[1000, 1230], [1000, 1301], [1000, 1550]])], [('regression: collapse revert', [[[50, 80], [4050, 5050]], [0, 1100, 2150, 3000, 4000], 250, 0], [[50, 80], [4000, 5050]]), ('regression variant: collapse revert', [[[1050, 2150], [0, 1]], [0, 1000, 3000], 200, 0], [[1000, 2150], [0, 1]]), ('partial repair probe: collapse revert', [[[2950, 2980]], [1200, 2150, 3000], 250, 0], [[2950, 2980]]), ('partial repair variant: collapse revert', [[[950, 1450], [1250, 2150], [1750, 2250]], [1000, 1200, 2000], 250, 0], [[1000, 1200], [1200, 2000], [1750, 2250]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[50, 1150]], [0, 1200, 2000, 2150], 250, 80], [[0, 1120]]), ('normal control', [[[1801, 2841], [1000, 1010]], [1000, 1200, 2000, 2150], 200, 42], [[2000, 2841], [1000, 1010]]), ('normal control', [[[4201, 5101], [4201, 5201], [4201, 4701]], [4000], 200, 0], [[4201, 5101], [4201, 5201], [4201, 4701]])], [('regression: collapse revert', [[[2950, 2980], [4050, 5150]], [2150, 3000, 4000], 250, 0], [[2950, 2980], [4000, 5150]]), ('regression variant: collapse revert', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('partial repair probe: collapse revert', [[[3000, 3900], [900, 930], [3000, 3030]], [0, 1100, 1200, 3000], 200, 80], [[3000, 3900], [900, 930], [3000, 3030]]), ('partial repair variant: collapse revert', [[[3200, 4200], [3801, 3811], [2950, 3950]], [1000, 3000, 4000], 200, 0], [[3000, 4000], [3801, 3811], [3000, 4000]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[1000, 2000], [3901, 4401]], [1100, 2000, 2150, 4000], 100, 42], [[1100, 1958], [4000, 4401]]), ('normal control', [[[3040, 3070], [2790, 3890], [849, 859]], [1100, 3040], 250, 80], [[3040, 3070], [3040, 3890], [849, 1020]]), ('normal control', [[[899, 1399], [3201, 3701], [1050, 2050]], [1100, 3000], 200, 80], [[899, 1399], [3201, 3701], [1100, 2050]])], [('regression: collapse revert', [[[1100, 2100], [2990, 3000], [900, 1800]], [1100, 3040], 200, 0], [[1100, 2100], [2990, 3000], [1100, 1800]]), ('regression variant: collapse revert', [[[851, 1951], [4050, 4060], [1350, 2250]], [1100, 4000], 250, 0], [[1100, 1951], [4050, 4060], [1100, 2250]]), ('partial repair probe: collapse revert', [[[1101, 1111], [950, 960], [950, 1850]], [1000, 4000], 100, 0], [[1101, 1111], [950, 960], [1000, 1850]]), ('partial repair variant: collapse revert', [[[851, 1891], [1100, 2100], [850, 880]], [1100], 250, 0], [[1100, 1891], [1100, 2100], [850, 880]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('normal control', [[[50, 950]], [0, 1200], 250, 42], [[0, 1158]]), ('normal control', [[[4201, 5101], [1150, 1650], [2200, 3240]], [1100, 2000, 4000], 200, 0], [[4201, 5101], [1100, 1650], [2000, 3240]]), ('normal control', [[[2050, 3050]], [0, 2000, 2150], 100, 42], [[2000, 3050]])], [('regression: collapse revert', [[[2950, 2980]], [1200, 2150, 3000], 250, 0], [[2950, 2980]]), ('regression variant: collapse revert', [[[0, 249], [0, 500]], [0, 1000], 250, 0], [[0, 249], [0, 500]]), ('partial repair probe: collapse revert', [[[1050, 1080], [1200, 2200], [2049, 2549]], [1100, 2150, 4000], 100, 0], [[1050, 1080], [1100, 2150], [2049, 2549]]), ('partial repair variant: collapse revert', [[[850, 1350], [849, 1349], [4000, 4030]], [1100, 2000, 3000, 4000], 250, 0], [[850, 1350], [849, 1100], [4000, 4030]]), ('boundary control', [[[900, 1500]], [1000], 100, 0], [[1000, 1500]]), ('boundary control', [[[1150, 1800]], [1000, 1200, 2000], 100, 80], [[1200, 1800]]), ('normal control', [[[951, 1851], [1150, 2250], [1350, 2250]], [1100, 1200], 250, 42], [[1100, 1851], [1100, 2250], [1200, 2250]]), ('normal control', [[[1150, 2050], [849, 859], [1350, 2390]], [1100, 3000], 250, 80], [[1100, 2050], [849, 1020], [1100, 2390]]), ('normal control', [[[3000, 3010], [2800, 3700], [2799, 3799]], [1200, 3000], 200, 42], [[3000, 3010], [3000, 3700], [2799, 3799]])]]\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-collapse-revert","generated_at":"2026-09-29T14:49:32.723286+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 revert condition does not catch zero-length results.","sha256":"534633151758f793177c54a8977a1f9ba435819e2b9c92fcab529d3216c77e56","title":"Shot-change snapping of cue boundaries: collapse revert · 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.851,"exit_code":1,"observations":[{"actual":[[1000,1010]],"check":"regression: collapse revert","expected":[[1000,1010]],"passed":true},{"actual":[[1101,1111],[1000,1000],[1000,1850]],"check":"regression variant: collapse revert","expected":[[1101,1111],[950,960],[1000,1850]],"passed":false},{"actual":[[1100,2100],[3040,3040],[1100,1800]],"check":"partial repair probe: collapse revert","expected":[[1100,2100],[2990,3000],[1100,1800]],"passed":false},{"actual":[[3000,3000],[4000,4000],[3000,3000]],"check":"partial repair variant: collapse revert","expected":[[2750,3250],[3751,3761],[2950,2980]],"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":[[1100,1890],[3000,4000]],"check":"normal control","expected":[[1100,1890],[3000,4000]],"passed":true},{"actual":[[1251,1261],[0,920]],"check":"normal control","expected":[[1251,1261],[0,920]],"passed":true},{"actual":[[1000,1230],[1000,1301],[1000,1550]],"check":"normal control","expected":[[1000,1230],[1000,1301],[1000,1550]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: collapse revert\", \"actual\": [[1000, 1010]], \"expected\": [[1000, 1010]], \"passed\": true}, {\"check\": \"regression variant: collapse revert\", \"actual\": [[1101, 1111], [1000, 1000], [1000, 1850]], \"expected\": [[1101, 1111], [950, 960], [1000, 1850]], \"passed\": false}, {\"check\": \"partial repair probe: collapse revert\", \"actual\": [[1100, 2100], [3040, 3040], [1100, 1800]], \"expected\": [[1100, 2100], [2990, 3000], [1100, 1800]], \"passed\": false}, {\"check\": \"partial repair variant: collapse revert\", \"actual\": [[3000, 3000], [4000, 4000], [3000, 3000]], \"expected\": [[2750, 3250], [3751, 3761], [2950, 2980]], \"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\": [[1100, 1890], [3000, 4000]], \"expected\": [[1100, 1890], [3000, 4000]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1251, 1261], [0, 920]], \"expected\": [[1251, 1261], [0, 920]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1000, 1230], [1000, 1301], [1000, 1550]], \"expected\": [[1000, 1230], [1000, 1301], [1000, 1550]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.643,"exit_code":1,"observations":[{"actual":[[1000,1000]],"check":"regression: collapse revert","expected":[[1000,1010]],"passed":false},{"actual":[[1101,1111],[1000,1000],[1000,1850]],"check":"regression variant: collapse revert","expected":[[1101,1111],[950,960],[1000,1850]],"passed":false},{"actual":[[1100,2100],[3040,3040],[1100,1800]],"check":"partial repair probe: collapse revert","expected":[[1100,2100],[2990,3000],[1100,1800]],"passed":false},{"actual":[[3000,3000],[4000,4000],[3000,3000]],"check":"partial repair variant: collapse revert","expected":[[2750,3250],[3751,3761],[2950,2980]],"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":[[1100,1890],[3000,4000]],"check":"normal control","expected":[[1100,1890],[3000,4000]],"passed":true},{"actual":[[1251,1261],[0,920]],"check":"normal control","expected":[[1251,1261],[0,920]],"passed":true},{"actual":[[1000,1230],[1000,1301],[1000,1550]],"check":"normal control","expected":[[1000,1230],[1000,1301],[1000,1550]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: collapse revert\", \"actual\": [[1000, 1000]], \"expected\": [[1000, 1010]], \"passed\": false}, {\"check\": \"regression variant: collapse revert\", \"actual\": [[1101, 1111], [1000, 1000], [1000, 1850]], \"expected\": [[1101, 1111], [950, 960], [1000, 1850]], \"passed\": false}, {\"check\": \"partial repair probe: collapse revert\", \"actual\": [[1100, 2100], [3040, 3040], [1100, 1800]], \"expected\": [[1100, 2100], [2990, 3000], [1100, 1800]], \"passed\": false}, {\"check\": \"partial repair variant: collapse revert\", \"actual\": [[3000, 3000], [4000, 4000], [3000, 3000]], \"expected\": [[2750, 3250], [3751, 3761], [2950, 2980]], \"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\": [[1100, 1890], [3000, 4000]], \"expected\": [[1100, 1890], [3000, 4000]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1251, 1261], [0, 920]], \"expected\": [[1251, 1261], [0, 920]], \"passed\": true}, {\"check\": \"normal control\", \"actual\": [[1000, 1230], [1000, 1301], [1000, 1550]], \"expected\": [[1000, 1230], [1000, 1301], [1000, 1550]], \"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."}}