{"abstract":"A box flush against the inside of another is not reported as contained.","category":"GIS polygon topology","checks":8,"contract":"Input [a, b], closed boxes [minx, miny, maxx, maxy] with positive width and height. Return \"equals\" if identical, else \"disjoint\" if separated with no shared point, else \"contains\" if a covers b (shared edges allowed), \"within\" if b covers a, else \"touches\" if the boxes share only boundary, else \"overlaps\".","evaluation_group":"w2-gis-polygon-topology-envelope-relation","failed_approach":"Only the minimum sides accept shared edges; flush maximum sides still fail.","family":"w2-gis-polygon-topology-envelope-relation-containment-with-shared-edges","id":"FA-70451","implementations":{"attempt":{"sha256":"39634b07988f15ca716ca9359df2de96d60270cd7aa8483340d8ead4f30b6d29","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    a, b = x\n    if a == b:\n        return 'equals'\n    if a[2] < b[0] or b[2] < a[0] or a[3] < b[1] or b[3] < a[1]:\n        return 'disjoint'\n    if a[0] <= b[0] and a[1] <= b[1] and a[2] > b[2] and a[3] > b[3]:\n        return 'contains'\n    if b[0] <= a[0] and b[1] <= a[1] and b[2] >= a[2] and b[3] >= a[3]:\n        return 'within'\n    if a[2] == b[0] or b[2] == a[0] or a[3] == b[1] or b[3] == a[1]:\n        return 'touches'\n    return 'overlaps'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[3, 0, 9, 4], [9, 3, 13, 11]], 'touches'), ('control #1', [[6, 3, 7, 5], [3, 1, 9, 6]], 'within'), ('control #2', [[5, 9, 6, 10], [3, 9, 10, 13]], 'within'), ('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('boundary #19', [[0, 0, 10, 10], [0, 0, 5, 5]], 'contains'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains')], [('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')], [('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('control #15', [[3, 5, 7, 12], [9, 2, 16, 3]], 'disjoint'), ('boundary #16', [[0, 0, 5, 5], [5, 0, 9, 5]], 'touches'), ('boundary #17', [[0, 0, 5, 5], [5, 5, 9, 9]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')]]\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":"4f7e428300b09db5a708ec42e091a7f2eb244355beef57682272faabfbe99734","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    a, b = x\n    if a == b:\n        return 'equals'\n    if a[2] < b[0] or b[2] < a[0] or a[3] < b[1] or b[3] < a[1]:\n        return 'disjoint'\n    if a[0] < b[0] and a[1] < b[1] and a[2] > b[2] and a[3] > b[3]:\n        return 'contains'\n    if b[0] <= a[0] and b[1] <= a[1] and b[2] >= a[2] and b[3] >= a[3]:\n        return 'within'\n    if a[2] == b[0] or b[2] == a[0] or a[3] == b[1] or b[3] == a[1]:\n        return 'touches'\n    return 'overlaps'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[3, 0, 9, 4], [9, 3, 13, 11]], 'touches'), ('control #1', [[6, 3, 7, 5], [3, 1, 9, 6]], 'within'), ('control #2', [[5, 9, 6, 10], [3, 9, 10, 13]], 'within'), ('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('boundary #19', [[0, 0, 10, 10], [0, 0, 5, 5]], 'contains'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains')], [('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')], [('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('control #15', [[3, 5, 7, 12], [9, 2, 16, 3]], 'disjoint'), ('boundary #16', [[0, 0, 5, 5], [5, 0, 9, 5]], 'touches'), ('boundary #17', [[0, 0, 5, 5], [5, 5, 9, 9]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')]]\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":"4b1e232a573a19f98cd961d60c55fd36505f701bcb415027c63e61d115d6d788","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    a, b = x\n    if a == b:\n        return 'equals'\n    if a[2] < b[0] or b[2] < a[0] or a[3] < b[1] or b[3] < a[1]:\n        return 'disjoint'\n    if a[0] <= b[0] and a[1] <= b[1] and a[2] >= b[2] and a[3] >= b[3]:\n        return 'contains'\n    if b[0] <= a[0] and b[1] <= a[1] and b[2] >= a[2] and b[3] >= a[3]:\n        return 'within'\n    if a[2] == b[0] or b[2] == a[0] or a[3] == b[1] or b[3] == a[1]:\n        return 'touches'\n    return 'overlaps'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [[3, 0, 9, 4], [9, 3, 13, 11]], 'touches'), ('control #1', [[6, 3, 7, 5], [3, 1, 9, 6]], 'within'), ('control #2', [[5, 9, 6, 10], [3, 9, 10, 13]], 'within'), ('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('boundary #19', [[0, 0, 10, 10], [0, 0, 5, 5]], 'contains'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains')], [('control #3', [[8, 2, 9, 4], [1, 10, 4, 15]], 'disjoint'), ('control #4', [[1, 1, 7, 5], [4, 5, 9, 8]], 'touches'), ('control #5', [[9, 7, 16, 13], [1, 10, 7, 13]], 'disjoint'), ('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #6', [[3, 1, 4, 5], [8, 8, 12, 15]], 'disjoint'), ('control #7', [[1, 7, 6, 11], [0, 6, 7, 7]], 'touches'), ('control #8', [[2, 1, 4, 2], [3, 1, 6, 4]], 'overlaps'), ('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')], [('control #9', [[7, 2, 15, 6], [8, 4, 14, 11]], 'overlaps'), ('control #10', [[7, 1, 10, 3], [7, 0, 14, 3]], 'within'), ('control #11', [[2, 7, 10, 9], [10, 8, 12, 13]], 'touches'), ('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('boundary #21', [[0, 0, 10, 10], [2, 2, 8, 10]], 'contains'), ('regression #24', [[0, 0, 4, 9], [0, 1, 4, 9]], 'contains')], [('control #12', [[8, 9, 9, 16], [4, 4, 11, 11]], 'overlaps'), ('control #13', [[5, 3, 9, 9], [7, 8, 8, 15]], 'overlaps'), ('control #14', [[3, 2, 10, 3], [8, 5, 14, 7]], 'disjoint'), ('control #15', [[3, 5, 7, 12], [9, 2, 16, 3]], 'disjoint'), ('boundary #16', [[0, 0, 5, 5], [5, 0, 9, 5]], 'touches'), ('boundary #17', [[0, 0, 5, 5], [5, 5, 9, 9]], 'touches'), ('regression #23', [[0, 0, 4, 9], [0, 0, 4, 3]], 'contains'), ('regression #31', [[0, 0, 3, 3], [1, 1, 3, 3]], 'contains')]]\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-envelope-relation-containment-with-shared-edges","generated_at":"2026-09-29T14:48:20.957591+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Spatial indexes and map tile filters prune candidates with envelope relations before exact geometry tests.","repair":"At the containment with shared edges step restore `if a[0] <= b[0] and a[1] <= b[1] and a[2] >= b[2] and a[3] >= b[3]:`, leaving the rest of the model unchanged.","root_cause":"Containment demands strict inequalities, excluding boxes that share an edge with the container.","sha256":"354b680c554f6ec7d1c9c0a3127edcbb9620e5bac9b442e373cb03fb9e8cbcf6","title":"Bounding box topological relation: containment with shared edges · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":36.409,"exit_code":1,"observations":[{"actual":"touches","check":"control #0","expected":"touches","passed":true},{"actual":"within","check":"control #1","expected":"within","passed":true},{"actual":"within","check":"control #2","expected":"within","passed":true},{"actual":"disjoint","check":"control #3","expected":"disjoint","passed":true},{"actual":"touches","check":"control #4","expected":"touches","passed":true},{"actual":"disjoint","check":"control #5","expected":"disjoint","passed":true},{"actual":"contains","check":"boundary #19","expected":"contains","passed":true},{"actual":"overlaps","check":"boundary #21","expected":"contains","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"boundary #19\", \"actual\": \"contains\", \"expected\": \"contains\", \"passed\": true}, {\"check\": \"boundary #21\", \"actual\": \"overlaps\", \"expected\": \"contains\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.385,"exit_code":1,"observations":[{"actual":"touches","check":"control #0","expected":"touches","passed":true},{"actual":"within","check":"control #1","expected":"within","passed":true},{"actual":"within","check":"control #2","expected":"within","passed":true},{"actual":"disjoint","check":"control #3","expected":"disjoint","passed":true},{"actual":"touches","check":"control #4","expected":"touches","passed":true},{"actual":"disjoint","check":"control #5","expected":"disjoint","passed":true},{"actual":"overlaps","check":"boundary #19","expected":"contains","passed":false},{"actual":"overlaps","check":"boundary #21","expected":"contains","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"boundary #19\", \"actual\": \"overlaps\", \"expected\": \"contains\", \"passed\": false}, {\"check\": \"boundary #21\", \"actual\": \"overlaps\", \"expected\": \"contains\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.165,"exit_code":0,"observations":[{"actual":"touches","check":"control #0","expected":"touches","passed":true},{"actual":"within","check":"control #1","expected":"within","passed":true},{"actual":"within","check":"control #2","expected":"within","passed":true},{"actual":"disjoint","check":"control #3","expected":"disjoint","passed":true},{"actual":"touches","check":"control #4","expected":"touches","passed":true},{"actual":"disjoint","check":"control #5","expected":"disjoint","passed":true},{"actual":"contains","check":"boundary #19","expected":"contains","passed":true},{"actual":"contains","check":"boundary #21","expected":"contains","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"within\", \"expected\": \"within\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"touches\", \"expected\": \"touches\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"disjoint\", \"expected\": \"disjoint\", \"passed\": true}, {\"check\": \"boundary #19\", \"actual\": \"contains\", \"expected\": \"contains\", \"passed\": true}, {\"check\": \"boundary #21\", \"actual\": \"contains\", \"expected\": \"contains\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}