{"abstract":"Snapped rings contain repeated consecutive vertices.","category":"GIS polygon topology","checks":8,"contract":"Input [ring, ref, tol]: a closed ring, reference vertices and a tolerance. Each ring vertex moves to the NEAREST reference vertex within Euclidean distance tol (inclusive; ties go to the lowest reference index), otherwise stays. Consecutive identical snapped vertices merge. If the result has fewer than 4 positions or is not closed return None, else return it.","evaluation_group":"w2-gis-polygon-topology-vertex-reference-snapping","failed_approach":"The merge compares the new snapped vertex with the raw input vertex, so real duplicates survive.","family":"w2-gis-polygon-topology-vertex-reference-snapping-post-snap-merge","id":"FA-70771","implementations":{"attempt":{"sha256":"acb3d0150997d60787803b3e2d9b5fcc895fb0f1c731c7e794427c0d9b587c75","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    ring, ref, tol = x\n    out = []\n    for p in ring:\n        best, bd = None, None\n        for q in ref:\n            d = (p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2\n            if d <= tol * tol and (bd is None or d < bd):\n                best, bd = q, d\n        np = list(best) if best is not None else list(p)\n        if not out or out[-1] != list(p):\n            out.append(np)\n    if len(out) < 4 or out[0] != out[-1]:\n        return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None)], [('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]])], [('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]]), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]]), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])]]\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":"ffc4a7f2c21f6d9bb88eca88fa402dc8786ee21c6628e4854bc38dc02d088693","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    ring, ref, tol = x\n    out = []\n    for p in ring:\n        best, bd = None, None\n        for q in ref:\n            d = (p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2\n            if d <= tol * tol and (bd is None or d < bd):\n                best, bd = q, d\n        np = list(best) if best is not None else list(p)\n        if True:\n            out.append(np)\n    if len(out) < 4 or out[0] != out[-1]:\n        return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None)], [('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]])], [('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]]), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]]), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])]]\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":"9a02242881c994eb08b0c413680108d2945489d525b9a700b1bbcb922fea7787","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    ring, ref, tol = x\n    out = []\n    for p in ring:\n        best, bd = None, None\n        for q in ref:\n            d = (p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2\n            if d <= tol * tol and (bd is None or d < bd):\n                best, bd = q, d\n        np = list(best) if best is not None else list(p)\n        if not out or out[-1] != np:\n            out.append(np)\n    if len(out) < 4 or out[0] != out[-1]:\n        return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None)], [('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('boundary #5', [[[0, 1], [8, 2], [9, 9], [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]])], [('regression #6', [[[0, 0.8], [8, 2], [9, 9], [0, 0.8]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [8, 2], [9, 9], [0, 0]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #10', [[[2, 2], [3, 2], [3, 3], [2, 2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 0.5], [[2, 2], [3, 2], [3, 3], [2, 2]]), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('boundary #9', [[[0.2, 0.2], [9.6, 0.2], [9.8, 0.4], [0.2, 0.2]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('regression #11', [[[3, 4], [8, 2], [9, 9], [3, 4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 3], [[5, 5], [10, 0], [10, 10], [5, 5]]), ('regression #12', [[[1, 1.5], [9, 1.2], [9, 9], [1, 1.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 2], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #13', [[[1.2, 0], [8, 3], [8.5, 8.5], [1.2, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[0, 0], [8, 3], [8.5, 8.5], [0, 0]]), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])], [('control #0', [[[0.4, 0.3], [9.8, 0.1], [10.2, 9.9], [0.1, 10.3], [0.4, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('control #1', [[[1, 1], [8, 1], [8, 8], [1, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[1, 1], [8, 1], [8, 8], [1, 1]]), ('regression #2', [[[5, 5.6], [8, 2], [9, 9], [5, 5.6]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 6], [8, 2], [9, 9], [5, 6]]), ('regression #3', [[[5, 5.4], [8, 2], [9, 9], [5, 5.4]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #4', [[[5, 5.5], [8, 2], [9, 9], [5, 5.5]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[5, 5], [8, 2], [9, 9], [5, 5]]), ('regression #7', [[[0.3, 0.3], [0.1, 0.2], [10, 0.4], [9.7, 9.6], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], [[0, 0], [10, 0], [10, 10], [0, 0]]), ('regression #8', [[[0.3, 0.3], [9.8, 0.2], [0.2, 0.1], [0.3, 0.3]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1], None), ('control #14', [[[19, 19], [30, 19], [30, 30], [19, 19]], [[0, 0], [10, 0], [10, 10], [0, 10], [5, 5], [5, 6], [20, 20]], 1.5], [[20, 20], [30, 19], [30, 30], [20, 20]])]]\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-vertex-reference-snapping-post-snap-merge","generated_at":"2026-09-29T14:48:23.750076+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Integrating new survey data with an authoritative layer snaps nearby vertices so shared boundaries become identical; snapping to the wrong vertex creates slivers.","repair":"At the post-snap merge step restore `if not out or out[-1] != np:`, leaving the rest of the model unchanged.","root_cause":"Vertices that snap onto the same reference vertex are all kept.","sha256":"a69affd987c0d02fe0fa18af8bbfb7e309ca972776c60d3c291ac1c9cc0fe5c3","title":"Snapping ring vertices to a reference layer: post-snap merge · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.884,"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],[8,1],[8,8],[1,1]],"check":"control #1","expected":[[1,1],[8,1],[8,8],[1,1]],"passed":true},{"actual":[[5,6],[8,2],[9,9],[5,6]],"check":"regression #2","expected":[[5,6],[8,2],[9,9],[5,6]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #3","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #4","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[0,0],[8,2],[9,9],[0,0]],"check":"boundary #5","expected":[[0,0],[8,2],[9,9],[0,0]],"passed":true},{"actual":[[0,0],[0,0],[10,0],[10,10],[0,0]],"check":"regression #7","expected":[[0,0],[10,0],[10,10],[0,0]],"passed":false},{"actual":[[0,0],[10,0],[0,0],[0,0]],"check":"regression #8","expected":null,"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\": \"control #1\", \"actual\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"expected\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"expected\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"regression #4\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"boundary #5\", \"actual\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"expected\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"passed\": true}, {\"check\": \"regression #7\", \"actual\": [[0, 0], [0, 0], [10, 0], [10, 10], [0, 0]], \"expected\": [[0, 0], [10, 0], [10, 10], [0, 0]], \"passed\": false}, {\"check\": \"regression #8\", \"actual\": [[0, 0], [10, 0], [0, 0], [0, 0]], \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.713,"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],[8,1],[8,8],[1,1]],"check":"control #1","expected":[[1,1],[8,1],[8,8],[1,1]],"passed":true},{"actual":[[5,6],[8,2],[9,9],[5,6]],"check":"regression #2","expected":[[5,6],[8,2],[9,9],[5,6]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #3","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #4","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[0,0],[8,2],[9,9],[0,0]],"check":"boundary #5","expected":[[0,0],[8,2],[9,9],[0,0]],"passed":true},{"actual":[[0,0],[0,0],[10,0],[10,10],[0,0]],"check":"regression #7","expected":[[0,0],[10,0],[10,10],[0,0]],"passed":false},{"actual":[[0,0],[10,0],[0,0],[0,0]],"check":"regression #8","expected":null,"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\": \"control #1\", \"actual\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"expected\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"expected\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"regression #4\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"boundary #5\", \"actual\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"expected\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"passed\": true}, {\"check\": \"regression #7\", \"actual\": [[0, 0], [0, 0], [10, 0], [10, 10], [0, 0]], \"expected\": [[0, 0], [10, 0], [10, 10], [0, 0]], \"passed\": false}, {\"check\": \"regression #8\", \"actual\": [[0, 0], [10, 0], [0, 0], [0, 0]], \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.861,"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],[8,1],[8,8],[1,1]],"check":"control #1","expected":[[1,1],[8,1],[8,8],[1,1]],"passed":true},{"actual":[[5,6],[8,2],[9,9],[5,6]],"check":"regression #2","expected":[[5,6],[8,2],[9,9],[5,6]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #3","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[5,5],[8,2],[9,9],[5,5]],"check":"regression #4","expected":[[5,5],[8,2],[9,9],[5,5]],"passed":true},{"actual":[[0,0],[8,2],[9,9],[0,0]],"check":"boundary #5","expected":[[0,0],[8,2],[9,9],[0,0]],"passed":true},{"actual":[[0,0],[10,0],[10,10],[0,0]],"check":"regression #7","expected":[[0,0],[10,0],[10,10],[0,0]],"passed":true},{"actual":null,"check":"regression #8","expected":null,"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\": \"control #1\", \"actual\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"expected\": [[1, 1], [8, 1], [8, 8], [1, 1]], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"expected\": [[5, 6], [8, 2], [9, 9], [5, 6]], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"regression #4\", \"actual\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"expected\": [[5, 5], [8, 2], [9, 9], [5, 5]], \"passed\": true}, {\"check\": \"boundary #5\", \"actual\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"expected\": [[0, 0], [8, 2], [9, 9], [0, 0]], \"passed\": true}, {\"check\": \"regression #7\", \"actual\": [[0, 0], [10, 0], [10, 10], [0, 0]], \"expected\": [[0, 0], [10, 0], [10, 10], [0, 0]], \"passed\": true}, {\"check\": \"regression #8\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}