{"abstract":"Centroid x coordinates drift along the edge direction.","category":"GIS polygon topology","checks":8,"contract":"Input: a multipolygon as a list of polygons, each a list of closed rings (exterior first). Ring orientation is arbitrary: every ring contributes its absolute area and matching first moments, exteriors positively and holes negatively. Moments use the shoelace terms (xi + xi+1)*cross/6. If the total area is 0 return None, else the centroid [cx, cy] rounded to 6 decimals.","evaluation_group":"w2-gis-polygon-topology-area-weighted-centroid","failed_approach":"Using |cross| breaks the signed moment for edges on the far side of the origin.","family":"w2-gis-polygon-topology-area-weighted-centroid-edge-moment-terms","id":"FA-70651","implementations":{"attempt":{"sha256":"0705b2de6b9ecbd995d0d2cabcfac180d81d626522254c0fa065eec00496efcf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    polys = x\n    A = Cx = Cy = 0.0\n    for rings in polys:\n        for k, r in enumerate(rings):\n            a2 = mx = my = 0.0\n            for p, q in zip(r, r[1:]):\n                c = p[0] * q[1] - q[0] * p[1]\n                a2 += c\n                mx += (p[0] + q[0]) * abs(c)\n                my += (p[1] + q[1]) * c\n            sg = 1.0 if a2 >= 0 else -1.0\n            w = 1.0 if k == 0 else -1.0\n            A += w * sg * a2 / 2\n            Cx += w * sg * mx / 6\n            Cy += w * sg * my / 6\n    if A == 0:\n        return None\n    return [round(Cx / A, 6), round(Cy / A, 6)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], 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":"41a0a563ed7ee1d2a239e5e660a0ce3104b10bbbac6f895ac0bd2fcf3fc70ccc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    polys = x\n    A = Cx = Cy = 0.0\n    for rings in polys:\n        for k, r in enumerate(rings):\n            a2 = mx = my = 0.0\n            for p, q in zip(r, r[1:]):\n                c = p[0] * q[1] - q[0] * p[1]\n                a2 += c\n                mx += 2 * p[0] * c\n                my += (p[1] + q[1]) * c\n            sg = 1.0 if a2 >= 0 else -1.0\n            w = 1.0 if k == 0 else -1.0\n            A += w * sg * a2 / 2\n            Cx += w * sg * mx / 6\n            Cy += w * sg * my / 6\n    if A == 0:\n        return None\n    return [round(Cx / A, 6), round(Cy / A, 6)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], 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":"e975be97afc7707895d1ddff9e87a39a4474c8ee993b9e115d9bf17c89ac22c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    polys = x\n    A = Cx = Cy = 0.0\n    for rings in polys:\n        for k, r in enumerate(rings):\n            a2 = mx = my = 0.0\n            for p, q in zip(r, r[1:]):\n                c = p[0] * q[1] - q[0] * p[1]\n                a2 += c\n                mx += (p[0] + q[0]) * c\n                my += (p[1] + q[1]) * c\n            sg = 1.0 if a2 >= 0 else -1.0\n            w = 1.0 if k == 0 else -1.0\n            A += w * sg * a2 / 2\n            Cx += w * sg * mx / 6\n            Cy += w * sg * my / 6\n    if A == 0:\n        return None\n    return [round(Cx / A, 6), round(Cy / A, 6)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], 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-area-weighted-centroid-edge-moment-terms","generated_at":"2026-09-29T14:48:22.612300+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Label placement, zonal summaries and map joins use polygon centroids; courtyards and multi-part parcels must pull the centroid correctly.","repair":"At the edge moment terms step restore `mx += (p[0] + q[0]) * c`, leaving the rest of the model unchanged.","root_cause":"The x moment uses twice the start vertex instead of the sum of both edge endpoints.","sha256":"073c9c757a3e33776e9ddfd5ec53c18cac971656d0fb79cc8dec4659a3a24554","title":"Area-weighted centroid of a multipolygon with holes: edge moment terms · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.241,"exit_code":1,"observations":[{"actual":[5.0,5.0],"check":"control #0","expected":[5.0,5.0],"passed":true},{"actual":[7.5,5.833333],"check":"regression #1","expected":[5.833333,5.833333],"passed":false},{"actual":[-8.016484,4.752747],"check":"regression #2","expected":[4.752747,4.752747],"passed":false},{"actual":[-5.0,5.0],"check":"regression #3","expected":[5.0,5.0],"passed":false},{"actual":[20.871795,4.846154],"check":"regression #4","expected":[14.461538,4.846154],"passed":false},{"actual":[-14.6,3.8],"check":"regression #5","expected":[3.8,3.8],"passed":false},{"actual":null,"check":"boundary #6","expected":null,"passed":true},{"actual":null,"check":"boundary #10","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [5.0, 5.0], \"expected\": [5.0, 5.0], \"passed\": true}, {\"check\": \"regression #1\", \"actual\": [7.5, 5.833333], \"expected\": [5.833333, 5.833333], \"passed\": false}, {\"check\": \"regression #2\", \"actual\": [-8.016484, 4.752747], \"expected\": [4.752747, 4.752747], \"passed\": false}, {\"check\": \"regression #3\", \"actual\": [-5.0, 5.0], \"expected\": [5.0, 5.0], \"passed\": false}, {\"check\": \"regression #4\", \"actual\": [20.871795, 4.846154], \"expected\": [14.461538, 4.846154], \"passed\": false}, {\"check\": \"regression #5\", \"actual\": [-14.6, 3.8], \"expected\": [3.8, 3.8], \"passed\": false}, {\"check\": \"boundary #6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #10\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.249,"exit_code":1,"observations":[{"actual":[6.666667,5.0],"check":"control #0","expected":[5.0,5.0],"passed":false},{"actual":[8.333333,5.833333],"check":"regression #1","expected":[5.833333,5.833333],"passed":false},{"actual":[2.673993,4.752747],"check":"regression #2","expected":[4.752747,4.752747],"passed":false},{"actual":[3.333333,5.0],"check":"regression #3","expected":[5.0,5.0],"passed":false},{"actual":[16.076923,4.846154],"check":"regression #4","expected":[14.461538,4.846154],"passed":false},{"actual":[3.6,3.8],"check":"regression #5","expected":[3.8,3.8],"passed":false},{"actual":null,"check":"boundary #6","expected":null,"passed":true},{"actual":null,"check":"boundary #10","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [6.666667, 5.0], \"expected\": [5.0, 5.0], \"passed\": false}, {\"check\": \"regression #1\", \"actual\": [8.333333, 5.833333], \"expected\": [5.833333, 5.833333], \"passed\": false}, {\"check\": \"regression #2\", \"actual\": [2.673993, 4.752747], \"expected\": [4.752747, 4.752747], \"passed\": false}, {\"check\": \"regression #3\", \"actual\": [3.333333, 5.0], \"expected\": [5.0, 5.0], \"passed\": false}, {\"check\": \"regression #4\", \"actual\": [16.076923, 4.846154], \"expected\": [14.461538, 4.846154], \"passed\": false}, {\"check\": \"regression #5\", \"actual\": [3.6, 3.8], \"expected\": [3.8, 3.8], \"passed\": false}, {\"check\": \"boundary #6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #10\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.638,"exit_code":0,"observations":[{"actual":[5.0,5.0],"check":"control #0","expected":[5.0,5.0],"passed":true},{"actual":[5.833333,5.833333],"check":"regression #1","expected":[5.833333,5.833333],"passed":true},{"actual":[4.752747,4.752747],"check":"regression #2","expected":[4.752747,4.752747],"passed":true},{"actual":[5.0,5.0],"check":"regression #3","expected":[5.0,5.0],"passed":true},{"actual":[14.461538,4.846154],"check":"regression #4","expected":[14.461538,4.846154],"passed":true},{"actual":[3.8,3.8],"check":"regression #5","expected":[3.8,3.8],"passed":true},{"actual":null,"check":"boundary #6","expected":null,"passed":true},{"actual":null,"check":"boundary #10","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [5.0, 5.0], \"expected\": [5.0, 5.0], \"passed\": true}, {\"check\": \"regression #1\", \"actual\": [5.833333, 5.833333], \"expected\": [5.833333, 5.833333], \"passed\": true}, {\"check\": \"regression #2\", \"actual\": [4.752747, 4.752747], \"expected\": [4.752747, 4.752747], \"passed\": true}, {\"check\": \"regression #3\", \"actual\": [5.0, 5.0], \"expected\": [5.0, 5.0], \"passed\": true}, {\"check\": \"regression #4\", \"actual\": [14.461538, 4.846154], \"expected\": [14.461538, 4.846154], \"passed\": true}, {\"check\": \"regression #5\", \"actual\": [3.8, 3.8], \"expected\": [3.8, 3.8], \"passed\": true}, {\"check\": \"boundary #6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #10\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}