{"abstract":"Neighbouring polygons with the same winding are never rook-adjacent.","category":"GIS polygon topology","checks":8,"contract":"Input [polygons, mode] where each polygon is a closed ring of integer vertices on a noded coverage (shared borders use identical vertices). Rook neighbours share at least one non-degenerate edge irrespective of direction; queen neighbours share at least one vertex. Return, for each polygon index, the ascending list of neighbour indexes (never itself).","contract_signature":"x","evaluation_group":"w2-gis-polygon-topology-shared-boundary-adjacency","failed_approach":"Sorting endpoints by x alone leaves vertical shared edges unnormalised.","family":"w2-gis-polygon-topology-shared-boundary-adjacency-edge-direction-normalisation","id":"FA-70496","implementations":{"attempt":{"sha256":"a4cec56fcf10a5c64eeffe4ad5c3cd6393e338acef113e72f8853d766a689ca1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    polys, mode = x\n    def edges(r):\n        return {tuple(sorted([tuple(a), tuple(b)], key=lambda p: p[0])) for a, b in zip(r, r[1:]) if a != b}\n    def verts(r):\n        return {tuple(p) for p in r}\n    E = [edges(p) for p in polys]\n    V = [verts(p) for p in polys]\n    out = []\n    for i in range(len(polys)):\n        nb = []\n        for j in range(len(polys)):\n            if i == j:\n                continue\n            if mode == 'rook':\n                ok = bool(E[i] & E[j])\n            else:\n                ok = bool(V[i] & V[j])\n            if ok:\n                nb.append(j)\n        out.append(nb)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'rook'], [[1, 3], [0], [], [0]]), ('control #1', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'queen'], [[1, 3], [0, 2, 3], [1], [0, 1]]), ('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #3', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []])], [('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []])], [('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]])], [('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []])], [('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []]), ('control #17', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #18', [[[[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #20', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]])]]\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":"a0910c4dcadf94d511d798aa74d83f6103cbff96957c09e5a253f0111f7c6e89","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    polys, mode = x\n    def edges(r):\n        return {(tuple(a), tuple(b)) for a, b in zip(r, r[1:]) if a != b}\n    def verts(r):\n        return {tuple(p) for p in r}\n    E = [edges(p) for p in polys]\n    V = [verts(p) for p in polys]\n    out = []\n    for i in range(len(polys)):\n        nb = []\n        for j in range(len(polys)):\n            if i == j:\n                continue\n            if mode == 'rook':\n                ok = bool(E[i] & E[j])\n            else:\n                ok = bool(V[i] & V[j])\n            if ok:\n                nb.append(j)\n        out.append(nb)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'rook'], [[1, 3], [0], [], [0]]), ('control #1', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'queen'], [[1, 3], [0, 2, 3], [1], [0, 1]]), ('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #3', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []])], [('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []])], [('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]])], [('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []])], [('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []]), ('control #17', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #18', [[[[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #20', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]])]]\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-shared-boundary-adjacency-edge-direction-normalisation","generated_at":"2026-09-29T14:48:21.242409+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Spatial weights for regional statistics, district contiguity checks and map colouring all start from adjacency.","root_cause":"Edges are compared as directed pairs, but adjacent polygons traverse their shared edge in opposite directions.","sha256":"10f114154a4c5e435ba4bd5ebf6224755045d8c2a4774486d0e592aa0baad6e0","title":"Rook and queen polygon adjacency: edge direction normalisation · 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":39.251,"exit_code":1,"observations":[{"actual":[[3],[],[],[0]],"check":"control #0","expected":[[1,3],[0],[],[0]],"passed":false},{"actual":[[1,3],[0,2,3],[1],[0,1]],"check":"control #1","expected":[[1,3],[0,2,3],[1],[0,1]],"passed":true},{"actual":[[2],[3],[0],[1]],"check":"control #2","expected":[[1,2],[0,3],[0,3],[1,2]],"passed":false},{"actual":[[1,2,3],[0,2,3],[0,1,3],[0,1,2]],"check":"control #3","expected":[[1,2,3],[0,2,3],[0,1,3],[0,1,2]],"passed":true},{"actual":[[3],[4],[],[0],[1]],"check":"control #4","expected":[[1,3],[0,4],[4],[0,4],[1,2,3]],"passed":false},{"actual":[[1,3,4],[0,2,3,4],[1,4],[0,1,4],[0,1,2,3]],"check":"control #5","expected":[[1,3,4],[0,2,3,4],[1,4],[0,1,4],[0,1,2,3]],"passed":true},{"actual":[[],[]],"check":"control #6","expected":[[],[]],"passed":true},{"actual":[[],[]],"check":"control #7","expected":[[],[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [[3], [], [], [0]], \"expected\": [[1, 3], [0], [], [0]], \"passed\": false}, {\"check\": \"control #1\", \"actual\": [[1, 3], [0, 2, 3], [1], [0, 1]], \"expected\": [[1, 3], [0, 2, 3], [1], [0, 1]], \"passed\": true}, {\"check\": \"control #2\", \"actual\": [[2], [3], [0], [1]], \"expected\": [[1, 2], [0, 3], [0, 3], [1, 2]], \"passed\": false}, {\"check\": \"control #3\", \"actual\": [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]], \"expected\": [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]], \"passed\": true}, {\"check\": \"control #4\", \"actual\": [[3], [4], [], [0], [1]], \"expected\": [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]], \"passed\": false}, {\"check\": \"control #5\", \"actual\": [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]], \"expected\": [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]], \"passed\": true}, {\"check\": \"control #6\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}, {\"check\": \"control #7\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.575,"exit_code":1,"observations":[{"actual":[[],[],[],[]],"check":"control #0","expected":[[1,3],[0],[],[0]],"passed":false},{"actual":[[1,3],[0,2,3],[1],[0,1]],"check":"control #1","expected":[[1,3],[0,2,3],[1],[0,1]],"passed":true},{"actual":[[],[],[],[]],"check":"control #2","expected":[[1,2],[0,3],[0,3],[1,2]],"passed":false},{"actual":[[1,2,3],[0,2,3],[0,1,3],[0,1,2]],"check":"control #3","expected":[[1,2,3],[0,2,3],[0,1,3],[0,1,2]],"passed":true},{"actual":[[],[],[],[],[]],"check":"control #4","expected":[[1,3],[0,4],[4],[0,4],[1,2,3]],"passed":false},{"actual":[[1,3,4],[0,2,3,4],[1,4],[0,1,4],[0,1,2,3]],"check":"control #5","expected":[[1,3,4],[0,2,3,4],[1,4],[0,1,4],[0,1,2,3]],"passed":true},{"actual":[[],[]],"check":"control #6","expected":[[],[]],"passed":true},{"actual":[[],[]],"check":"control #7","expected":[[],[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [[], [], [], []], \"expected\": [[1, 3], [0], [], [0]], \"passed\": false}, {\"check\": \"control #1\", \"actual\": [[1, 3], [0, 2, 3], [1], [0, 1]], \"expected\": [[1, 3], [0, 2, 3], [1], [0, 1]], \"passed\": true}, {\"check\": \"control #2\", \"actual\": [[], [], [], []], \"expected\": [[1, 2], [0, 3], [0, 3], [1, 2]], \"passed\": false}, {\"check\": \"control #3\", \"actual\": [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]], \"expected\": [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]], \"passed\": true}, {\"check\": \"control #4\", \"actual\": [[], [], [], [], []], \"expected\": [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]], \"passed\": false}, {\"check\": \"control #5\", \"actual\": [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]], \"expected\": [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]], \"passed\": true}, {\"check\": \"control #6\", \"actual\": [[], []], \"expected\": [[], []], \"passed\": true}, {\"check\": \"control #7\", \"actual\": [[], []], \"expected\": [[], []], \"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."}}