{"abstract":"Rectangles that merely share an edge are reported as overlapping.","category":"GIS polygon topology","checks":8,"contract":"Input [rects, extent]: axis-aligned integer rectangles [x0, y0, x1, y1] forming a coverage and an extent box. Split the plane on all rectangle and extent edges; for each cell inside the extent count the rectangles whose OPEN interior contains the cell centre. Gap area sums cells with count 0, overlap area sums (once) cells with count >= 2. Parts outside the extent are ignored. Return [gap, overlap].","contract_signature":"x","evaluation_group":"w2-gis-polygon-topology-coverage-gaps-overlaps","failed_approach":"The x bound is half-open but the y bound is still closed.","family":"w2-gis-polygon-topology-coverage-gaps-overlaps-interior-containment","id":"FA-70656","implementations":{"attempt":{"sha256":"a81d4dd3974fa4d989f5250906b56eff82cb308b53b1345592b44a1177fd0b2b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    rects, extent = x\n    xs = sorted({v for q in rects for v in (q[0], q[2])} | {extent[0], extent[2]})\n    ys = sorted({v for q in rects for v in (q[1], q[3])} | {extent[1], extent[3]})\n    gap = overlap = 0\n    for i in range(len(xs) - 1):\n        for j in range(len(ys) - 1):\n            x0, x1, y0, y1 = xs[i], xs[i + 1], ys[j], ys[j + 1]\n            if x0 < extent[0] or x1 > extent[2] or y0 < extent[1] or y1 > extent[3]:\n                continue\n            cx, cy = (x0 + x1) / 2, (y0 + y1) / 2\n            n = sum(1 for q in rects if q[0] <= x0 < q[2] and q[1] <= y0 <= q[3])\n            cell = (x1 - x0) * (y1 - y0)\n            if n == 0:\n                gap += cell\n            elif n > 1:\n                overlap += cell\n    return [gap, overlap]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[0, 4, 3, 8]], [0, 0, 10, 10]], [88, 0]), ('control #1', [[[5, 5, 6, 11], [5, 4, 8, 9]], [0, 0, 10, 10]], [84, 4]), ('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #4', [[[1, 7, 3, 12]], [0, 0, 10, 10]], [94, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #1', [[[5, 5, 6, 11], [5, 4, 8, 9]], [0, 0, 10, 10]], [84, 4]), ('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('control #6', [[[8, 8, 11, 10], [0, 0, 3, 2], [6, 5, 11, 9], [5, 1, 6, 5]], [0, 0, 10, 10]], [72, 2]), ('control #7', [[[4, 7, 9, 12], [8, 7, 11, 12], [2, 1, 8, 6]], [0, 0, 10, 10]], [52, 3]), ('control #8', [[[0, 8, 3, 10], [7, 4, 10, 8], [7, 3, 10, 8]], [0, 0, 10, 10]], [79, 12]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #8', [[[0, 8, 3, 10], [7, 4, 10, 8], [7, 3, 10, 8]], [0, 0, 10, 10]], [79, 12]), ('control #9', [[[7, 6, 11, 11], [8, 8, 9, 12], [5, 0, 10, 5], [8, 3, 13, 7]], [0, 0, 10, 10]], [61, 8]), ('control #10', [[[4, 6, 8, 12], [8, 5, 14, 8], [4, 5, 6, 9], [8, 2, 14, 6]], [0, 0, 10, 10]], [70, 8]), ('control #11', [[[4, 5, 8, 10], [3, 3, 5, 8], [7, 0, 8, 3]], [0, 0, 10, 10]], [70, 3]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('control #11', [[[4, 5, 8, 10], [3, 3, 5, 8], [7, 0, 8, 3]], [0, 0, 10, 10]], [70, 3]), ('regression #12', [[[0, 0, 5, 10], [5, 0, 10, 10]], [0, 0, 10, 10]], [0, 0]), ('regression #13', [[[0, 0, 5, 5], [5, 5, 10, 10]], [0, 0, 10, 10]], [50, 0]), ('regression #14', [[[0, 0, 6, 10], [4, 0, 10, 10], [3, 3, 7, 7]], [0, 0, 10, 10]], [0, 28]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #4', [[[1, 7, 3, 12]], [0, 0, 10, 10]], [94, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('regression #14', [[[0, 0, 6, 10], [4, 0, 10, 10], [3, 3, 7, 7]], [0, 0, 10, 10]], [0, 28]), ('regression #15', [[[-5, 0, 5, 10], [5, 0, 15, 10]], [0, 0, 10, 10]], [0, 0]), ('regression #16', [[[0, -3, 10, 4], [0, 4, 10, 13]], [0, 0, 10, 10]], [0, 0]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #18', [[[2, 2, 4, 4]], [0, 0, 10, 10]], [96, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])]]\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":"397c70181e01af871fb6b168ead52783ef5ad5dc5677d4d65f78defe171b7c13","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    rects, extent = x\n    xs = sorted({v for q in rects for v in (q[0], q[2])} | {extent[0], extent[2]})\n    ys = sorted({v for q in rects for v in (q[1], q[3])} | {extent[1], extent[3]})\n    gap = overlap = 0\n    for i in range(len(xs) - 1):\n        for j in range(len(ys) - 1):\n            x0, x1, y0, y1 = xs[i], xs[i + 1], ys[j], ys[j + 1]\n            if x0 < extent[0] or x1 > extent[2] or y0 < extent[1] or y1 > extent[3]:\n                continue\n            cx, cy = (x0 + x1) / 2, (y0 + y1) / 2\n            n = sum(1 for q in rects if q[0] <= x0 <= q[2] and q[1] <= y0 <= q[3])\n            cell = (x1 - x0) * (y1 - y0)\n            if n == 0:\n                gap += cell\n            elif n > 1:\n                overlap += cell\n    return [gap, overlap]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[[0, 4, 3, 8]], [0, 0, 10, 10]], [88, 0]), ('control #1', [[[5, 5, 6, 11], [5, 4, 8, 9]], [0, 0, 10, 10]], [84, 4]), ('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #4', [[[1, 7, 3, 12]], [0, 0, 10, 10]], [94, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #1', [[[5, 5, 6, 11], [5, 4, 8, 9]], [0, 0, 10, 10]], [84, 4]), ('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('control #6', [[[8, 8, 11, 10], [0, 0, 3, 2], [6, 5, 11, 9], [5, 1, 6, 5]], [0, 0, 10, 10]], [72, 2]), ('control #7', [[[4, 7, 9, 12], [8, 7, 11, 12], [2, 1, 8, 6]], [0, 0, 10, 10]], [52, 3]), ('control #8', [[[0, 8, 3, 10], [7, 4, 10, 8], [7, 3, 10, 8]], [0, 0, 10, 10]], [79, 12]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #2', [[[0, 6, 6, 8], [5, 2, 6, 6]], [0, 0, 10, 10]], [84, 0]), ('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #8', [[[0, 8, 3, 10], [7, 4, 10, 8], [7, 3, 10, 8]], [0, 0, 10, 10]], [79, 12]), ('control #9', [[[7, 6, 11, 11], [8, 8, 9, 12], [5, 0, 10, 5], [8, 3, 13, 7]], [0, 0, 10, 10]], [61, 8]), ('control #10', [[[4, 6, 8, 12], [8, 5, 14, 8], [4, 5, 6, 9], [8, 2, 14, 6]], [0, 0, 10, 10]], [70, 8]), ('control #11', [[[4, 5, 8, 10], [3, 3, 5, 8], [7, 0, 8, 3]], [0, 0, 10, 10]], [70, 3]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #3', [[[4, 7, 5, 9], [1, 8, 4, 14], [0, 8, 5, 9]], [0, 0, 10, 10]], [91, 4]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('control #11', [[[4, 5, 8, 10], [3, 3, 5, 8], [7, 0, 8, 3]], [0, 0, 10, 10]], [70, 3]), ('regression #12', [[[0, 0, 5, 10], [5, 0, 10, 10]], [0, 0, 10, 10]], [0, 0]), ('regression #13', [[[0, 0, 5, 5], [5, 5, 10, 10]], [0, 0, 10, 10]], [50, 0]), ('regression #14', [[[0, 0, 6, 10], [4, 0, 10, 10], [3, 3, 7, 7]], [0, 0, 10, 10]], [0, 28]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])], [('control #4', [[[1, 7, 3, 12]], [0, 0, 10, 10]], [94, 0]), ('control #5', [[[1, 2, 6, 6]], [0, 0, 10, 10]], [80, 0]), ('regression #14', [[[0, 0, 6, 10], [4, 0, 10, 10], [3, 3, 7, 7]], [0, 0, 10, 10]], [0, 28]), ('regression #15', [[[-5, 0, 5, 10], [5, 0, 15, 10]], [0, 0, 10, 10]], [0, 0]), ('regression #16', [[[0, -3, 10, 4], [0, 4, 10, 13]], [0, 0, 10, 10]], [0, 0]), ('boundary #17', [[], [0, 0, 4, 4]], [16, 0]), ('regression #18', [[[2, 2, 4, 4]], [0, 0, 10, 10]], [96, 0]), ('regression #19', [[[0, 0, 10, 10], [0, 0, 10, 10], [0, 0, 10, 10]], [0, 0, 10, 10]], [0, 100])]]\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-coverage-gaps-overlaps-interior-containment","generated_at":"2026-09-29T14:48:22.705615+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Cadastral and zoning coverages must tile the study area exactly; QA reports gaps and overlaps by area.","root_cause":"Cells are tested by their lower-left corner with closed bounds, so a cell starting on a neighbour edge counts for both.","sha256":"15db56c12226342286c256b330b2828344399e638b1301219eba6190a11b9028","title":"Coverage gap and overlap areas: interior containment · 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":40.301,"exit_code":1,"observations":[{"actual":[82,0],"check":"control #0","expected":[88,0],"passed":false},{"actual":[82,5],"check":"control #1","expected":[84,4],"passed":false},{"actual":[72,2],"check":"control #2","expected":[84,0],"passed":false},{"actual":[89,8],"check":"control #3","expected":[91,4],"passed":false},{"actual":[94,0],"check":"control #4","expected":[94,0],"passed":true},{"actual":[60,0],"check":"control #5","expected":[80,0],"passed":false},{"actual":[16,0],"check":"boundary #17","expected":[16,0],"passed":true},{"actual":[0,100],"check":"regression #19","expected":[0,100],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [82, 0], \"expected\": [88, 0], \"passed\": false}, {\"check\": \"control #1\", \"actual\": [82, 5], \"expected\": [84, 4], \"passed\": false}, {\"check\": \"control #2\", \"actual\": [72, 2], \"expected\": [84, 0], \"passed\": false}, {\"check\": \"control #3\", \"actual\": [89, 8], \"expected\": [91, 4], \"passed\": false}, {\"check\": \"control #4\", \"actual\": [94, 0], \"expected\": [94, 0], \"passed\": true}, {\"check\": \"control #5\", \"actual\": [60, 0], \"expected\": [80, 0], \"passed\": false}, {\"check\": \"boundary #17\", \"actual\": [16, 0], \"expected\": [16, 0], \"passed\": true}, {\"check\": \"regression #19\", \"actual\": [0, 100], \"expected\": [0, 100], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.633,"exit_code":1,"observations":[{"actual":[40,0],"check":"control #0","expected":[88,0],"passed":false},{"actual":[70,15],"check":"control #1","expected":[84,4],"passed":false},{"actual":[40,10],"check":"control #2","expected":[84,0],"passed":false},{"actual":[74,18],"check":"control #3","expected":[91,4],"passed":false},{"actual":[73,0],"check":"control #4","expected":[94,0],"passed":false},{"actual":[28,0],"check":"control #5","expected":[80,0],"passed":false},{"actual":[16,0],"check":"boundary #17","expected":[16,0],"passed":true},{"actual":[0,100],"check":"regression #19","expected":[0,100],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": [40, 0], \"expected\": [88, 0], \"passed\": false}, {\"check\": \"control #1\", \"actual\": [70, 15], \"expected\": [84, 4], \"passed\": false}, {\"check\": \"control #2\", \"actual\": [40, 10], \"expected\": [84, 0], \"passed\": false}, {\"check\": \"control #3\", \"actual\": [74, 18], \"expected\": [91, 4], \"passed\": false}, {\"check\": \"control #4\", \"actual\": [73, 0], \"expected\": [94, 0], \"passed\": false}, {\"check\": \"control #5\", \"actual\": [28, 0], \"expected\": [80, 0], \"passed\": false}, {\"check\": \"boundary #17\", \"actual\": [16, 0], \"expected\": [16, 0], \"passed\": true}, {\"check\": \"regression #19\", \"actual\": [0, 100], \"expected\": [0, 100], \"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."}}