{"abstract":"Snapped rings contain zero-length edges and collapsed rings survive.","category":"GIS polygon topology","checks":8,"contract":"Input [rings, g]: polygon rings (exterior first), closed, numeric coordinates; grid size g > 0 anchored at 0. Each coordinate snaps to floor(v/g + 0.5)*g (halves round toward +infinity). Consecutive identical snapped positions are merged. A ring left with fewer than 4 positions has collapsed: if it is the exterior return None, otherwise drop that hole. Return the snapped rings.","evaluation_group":"w2-gis-polygon-topology-snap-rounding-collapse","failed_approach":"Looking back two positions also swallows legitimate back-and-forth vertices and the closing position of short rings.","family":"w2-gis-polygon-topology-snap-rounding-collapse-snapped-duplicate-merge","id":"FA-70571","implementations":{"attempt":{"sha256":"3cec90c8043644926e2c8289e19cd929b28c022c31e5059bfae4ff2a7573f6b0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    rings, g = x\n    def snap(v):\n        return math.floor(v / g + 0.5) * g\n    out = []\n    for k, ring in enumerate(rings):\n        pts = []\n        for p in ring:\n            q = [snap(p[0]), snap(p[1])]\n            if q not in pts[-2:]:\n                pts.append(q)\n        if len(pts) < 4:\n            if k == 0:\n                return None\n            continue\n        out.append(pts)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0.2, 0.1], [9.7, 0.4], [9.6, 9.8], [0.3, 9.9], [0.2, 0.1]]], 1], [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #1', [[[[0.5, 0.5], [10.5, 0.5], [10.5, 10.5], [0.5, 10.5], [0.5, 0.5]]], 1], [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]]), ('regression #2', [[[[-2.5, -2.5], [7.5, -2.5], [7.5, 3.5], [-2.5, 3.5], [-2.5, -2.5]]], 1], [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]]), ('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #16', [[[[15, 25], [45, 25], [45, 55], [15, 55], [15, 25]]], 10], [[[20, 30], [50, 30], [50, 60], [20, 60], [20, 30]]]), ('boundary #17', [[[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]], 5], None), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]]), ('boundary #19', [[[[0, 0], [2.2, 0], [2, 0.4], [0, 0]]], 1], None)]]\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":"1587c086dfb1b47a29832178c3df9fccf0fcf33064ae47830d456c2463998e02","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    rings, g = x\n    def snap(v):\n        return math.floor(v / g + 0.5) * g\n    out = []\n    for k, ring in enumerate(rings):\n        pts = []\n        for p in ring:\n            q = [snap(p[0]), snap(p[1])]\n            pts.append(q)\n        if len(pts) < 4:\n            if k == 0:\n                return None\n            continue\n        out.append(pts)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0.2, 0.1], [9.7, 0.4], [9.6, 9.8], [0.3, 9.9], [0.2, 0.1]]], 1], [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #1', [[[[0.5, 0.5], [10.5, 0.5], [10.5, 10.5], [0.5, 10.5], [0.5, 0.5]]], 1], [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]]), ('regression #2', [[[[-2.5, -2.5], [7.5, -2.5], [7.5, 3.5], [-2.5, 3.5], [-2.5, -2.5]]], 1], [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]]), ('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #16', [[[[15, 25], [45, 25], [45, 55], [15, 55], [15, 25]]], 10], [[[20, 30], [50, 30], [50, 60], [20, 60], [20, 30]]]), ('boundary #17', [[[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]], 5], None), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]]), ('boundary #19', [[[[0, 0], [2.2, 0], [2, 0.4], [0, 0]]], 1], None)]]\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":"15333d8dd249802e35a10c06e6a582ff758bcaa496a8faf130541c242c665598","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    rings, g = x\n    def snap(v):\n        return math.floor(v / g + 0.5) * g\n    out = []\n    for k, ring in enumerate(rings):\n        pts = []\n        for p in ring:\n            q = [snap(p[0]), snap(p[1])]\n            if not pts or pts[-1] != q:\n                pts.append(q)\n        if len(pts) < 4:\n            if k == 0:\n                return None\n            continue\n        out.append(pts)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0.2, 0.1], [9.7, 0.4], [9.6, 9.8], [0.3, 9.9], [0.2, 0.1]]], 1], [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #1', [[[[0.5, 0.5], [10.5, 0.5], [10.5, 10.5], [0.5, 10.5], [0.5, 0.5]]], 1], [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]]), ('regression #2', [[[[-2.5, -2.5], [7.5, -2.5], [7.5, 3.5], [-2.5, 3.5], [-2.5, -2.5]]], 1], [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]]), ('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #3', [[[[-1.4, -1.4], [6.2, -1.4], [6.2, 6.2], [-1.4, 6.2], [-1.4, -1.4]]], 2], [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]]), ('boundary #4', [[[[0, 0], [0.4, 0.2], [0.3, 0.4], [0, 0]]], 1], None), ('boundary #5', [[[[0, 0], [2.2, 0], [2, 1.6], [0, 0]]], 1], [[[0, 0], [2, 0], [2, 2], [0, 0]]]), ('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #6', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]]), ('regression #7', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5.1, 5.1], [5.2, 5.3], [5.4, 5.1], [5.1, 5.1]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]], 1], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[10, 10], [10, 14], [14, 14], [14, 10], [10, 10]]]), ('control #8', [[[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], 5], [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 10], [10, 10], [10, 5], [5, 5]]]), ('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #9', [[[[0, 0], [10.4, 0.3], [10.6, 0.2], [10.2, 10.2], [0, 10], [0, 0]]], 1], [[[0, 0], [10, 0], [11, 0], [10, 10], [0, 10], [0, 0]]]), ('regression #10', [[[[0, 0], [3, 0], [3.2, 0.2], [3, 3], [0, 3], [0, 0]]], 1], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]]), ('control #11', [[[[1.26, 2.74], [8.33, 2.51], [7.9, 9.49], [1.26, 2.74]]], 0.5], [[[1.5, 2.5], [8.5, 2.5], [8.0, 9.5], [1.5, 2.5]]]), ('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]])], [('regression #12', [[[[1.25, 2.75], [8.25, 2.25], [7.75, 9.75], [1.25, 2.75]]], 0.5], [[[1.5, 3.0], [8.5, 2.5], [8.0, 10.0], [1.5, 3.0]]]), ('regression #13', [[[[-0.5, 0], [4, 0], [4, 4], [-0.5, 0]]], 1], [[[0, 0], [4, 0], [4, 4], [0, 0]]]), ('boundary #14', [[[[0, 0], [4.4, 0], [4.6, 0.4], [0, 0]]], 1], [[[0, 0], [4, 0], [5, 0], [0, 0]]]), ('control #15', [[[[12, 13], [48, 11], [51, 47], [9, 52], [12, 13]]], 10], [[[10, 10], [50, 10], [50, 50], [10, 50], [10, 10]]]), ('regression #16', [[[[15, 25], [45, 25], [45, 55], [15, 55], [15, 25]]], 10], [[[20, 30], [50, 30], [50, 60], [20, 60], [20, 30]]]), ('boundary #17', [[[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]], 5], None), ('regression #18', [[[[0, 0], [5, 0], [5, 5], [5.2, 0.1], [8, 0], [8, 8], [0, 8], [0, 0]]], 1], [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]]), ('boundary #19', [[[[0, 0], [2.2, 0], [2, 0.4], [0, 0]]], 1], None)]]\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":"Stipulated deterministic toy contract on a bounded input domain; results are rounded as stated and no conformance with any published standard or library is claimed. 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-gis-polygon-topology-snap-rounding-collapse-snapped-duplicate-merge","generated_at":"2026-09-29T14:48:21.915801+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Precision reduction for storage, tiling and topology cleaning snaps vertices to a grid; collapse rules decide whether tiny holes vanish or the polygon is discarded.","repair":"At the snapped duplicate merge step restore `if not pts or pts[-1] != q:             pts.append(q)`, leaving the rest of the model unchanged.","root_cause":"Positions that snap onto the same grid node are all kept.","sha256":"c991ef7f6eb59f7a534c72d19cfb6622f614b76e0e0eb17cc20bbea0502ed658","title":"Grid snapping with ring collapse handling: snapped duplicate merge · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.078,"exit_code":1,"observations":[{"actual":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"check":"control #0","expected":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"passed":true},{"actual":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"check":"regression #1","expected":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"passed":true},{"actual":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"check":"regression #2","expected":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"passed":true},{"actual":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"check":"regression #3","expected":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"passed":true},{"actual":null,"check":"boundary #4","expected":null,"passed":true},{"actual":[[[0,0],[2,0],[2,2],[0,0]]],"check":"boundary #5","expected":[[[0,0],[2,0],[2,2],[0,0]]],"passed":true},{"actual":[[[0,0],[20,0],[20,20],[0,20],[0,0]]],"check":"regression #6","expected":[[[0,0],[20,0],[20,20],[0,20],[0,0]]],"passed":true},{"actual":[[[0,0],[5,0],[5,5],[8,0],[8,8],[0,8],[0,0]]],"check":"regression #18","expected":[[[0,0],[5,0],[5,5],[5,0],[8,0],[8,8],[0,8],[0,0]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"expected\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"passed\": true}, {\"check\": \"regression #1\", \"actual\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"expected\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"expected\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"expected\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"passed\": true}, {\"check\": \"boundary #4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #5\", \"actual\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"expected\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"passed\": true}, {\"check\": \"regression #6\", \"actual\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]], \"expected\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]], \"passed\": true}, {\"check\": \"regression #18\", \"actual\": [[[0, 0], [5, 0], [5, 5], [8, 0], [8, 8], [0, 8], [0, 0]]], \"expected\": [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.495,"exit_code":1,"observations":[{"actual":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"check":"control #0","expected":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"passed":true},{"actual":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"check":"regression #1","expected":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"passed":true},{"actual":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"check":"regression #2","expected":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"passed":true},{"actual":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"check":"regression #3","expected":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"passed":true},{"actual":[[[0,0],[0,0],[0,0],[0,0]]],"check":"boundary #4","expected":null,"passed":false},{"actual":[[[0,0],[2,0],[2,2],[0,0]]],"check":"boundary #5","expected":[[[0,0],[2,0],[2,2],[0,0]]],"passed":true},{"actual":[[[0,0],[20,0],[20,20],[0,20],[0,0]],[[5,5],[5,5],[5,5],[5,5]]],"check":"regression #6","expected":[[[0,0],[20,0],[20,20],[0,20],[0,0]]],"passed":false},{"actual":[[[0,0],[5,0],[5,5],[5,0],[8,0],[8,8],[0,8],[0,0]]],"check":"regression #18","expected":[[[0,0],[5,0],[5,5],[5,0],[8,0],[8,8],[0,8],[0,0]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"expected\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"passed\": true}, {\"check\": \"regression #1\", \"actual\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"expected\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"expected\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"expected\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"passed\": true}, {\"check\": \"boundary #4\", \"actual\": [[[0, 0], [0, 0], [0, 0], [0, 0]]], \"expected\": null, \"passed\": false}, {\"check\": \"boundary #5\", \"actual\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"expected\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"passed\": true}, {\"check\": \"regression #6\", \"actual\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]], [[5, 5], [5, 5], [5, 5], [5, 5]]], \"expected\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]], \"passed\": false}, {\"check\": \"regression #18\", \"actual\": [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]], \"expected\": [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.442,"exit_code":0,"observations":[{"actual":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"check":"control #0","expected":[[[0,0],[10,0],[10,10],[0,10],[0,0]]],"passed":true},{"actual":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"check":"regression #1","expected":[[[1,1],[11,1],[11,11],[1,11],[1,1]]],"passed":true},{"actual":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"check":"regression #2","expected":[[[-2,-2],[8,-2],[8,4],[-2,4],[-2,-2]]],"passed":true},{"actual":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"check":"regression #3","expected":[[[-2,-2],[6,-2],[6,6],[-2,6],[-2,-2]]],"passed":true},{"actual":null,"check":"boundary #4","expected":null,"passed":true},{"actual":[[[0,0],[2,0],[2,2],[0,0]]],"check":"boundary #5","expected":[[[0,0],[2,0],[2,2],[0,0]]],"passed":true},{"actual":[[[0,0],[20,0],[20,20],[0,20],[0,0]]],"check":"regression #6","expected":[[[0,0],[20,0],[20,20],[0,20],[0,0]]],"passed":true},{"actual":[[[0,0],[5,0],[5,5],[5,0],[8,0],[8,8],[0,8],[0,0]]],"check":"regression #18","expected":[[[0,0],[5,0],[5,5],[5,0],[8,0],[8,8],[0,8],[0,0]]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"expected\": [[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]], \"passed\": true}, {\"check\": \"regression #1\", \"actual\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"expected\": [[[1, 1], [11, 1], [11, 11], [1, 11], [1, 1]]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"expected\": [[[-2, -2], [8, -2], [8, 4], [-2, 4], [-2, -2]]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"expected\": [[[-2, -2], [6, -2], [6, 6], [-2, 6], [-2, -2]]], \"passed\": true}, {\"check\": \"boundary #4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #5\", \"actual\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"expected\": [[[0, 0], [2, 0], [2, 2], [0, 0]]], \"passed\": true}, {\"check\": \"regression #6\", \"actual\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]], \"expected\": [[[0, 0], [20, 0], [20, 20], [0, 20], [0, 0]]], \"passed\": true}, {\"check\": \"regression #18\", \"actual\": [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]], \"expected\": [[[0, 0], [5, 0], [5, 5], [5, 0], [8, 0], [8, 8], [0, 8], [0, 0]]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}