{"abstract":"The world tile at zoom 0 gets a one-character key that collides with a zoom-1 tile.","category":"Map projection transforms","checks":8,"contract":"Input [z, col, row] with xyz rows. For zoom 0 return the empty string. If col or row is outside [0, 2**z - 1] return None. Otherwise emit z digits from the most significant bit down: digit = (1 if col bit set) + (2 if row bit set).","evaluation_group":"w2-map-projection-transforms-quadkey-encode","failed_approach":"Returning None for zoom 0 treats the valid root tile as out of range.","family":"w2-map-projection-transforms-quadkey-encode-zoom-zero-key","id":"FA-69956","implementations":{"attempt":{"sha256":"56067a7ad0327654bf9b7b1668f7acafc1533942fecacca569a02f325c43d3ea","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    z, col, row = x\n    if col < 0 or row < 0 or col >= 2 ** z or row >= 2 ** z:\n        return None\n    if z == 0:\n        return None\n    digits = []\n    for level in range(z, 0, -1):\n        mask = 1 << (level - 1)\n        d = 0\n        if col & mask:\n            d += 1\n        if row & mask:\n            d += 2\n        digits.append(str(d))\n    return ''.join(digits)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('control #2', [2, 3, 1], '13'), ('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('boundary #12', [0, 0, 0], '')], [('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('boundary #12', [0, 0, 0], '')], [('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None)], [('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None)], [('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None), ('boundary #17', [4, 15, 15], '3333')]]\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":"2f95ee704d12bcdb79465e19cb8b8e2f267a4d60532234cd177e311d469c9791","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    z, col, row = x\n    if col < 0 or row < 0 or col >= 2 ** z or row >= 2 ** z:\n        return None\n    if z == 0:\n        return \"0\"\n    digits = []\n    for level in range(z, 0, -1):\n        mask = 1 << (level - 1)\n        d = 0\n        if col & mask:\n            d += 1\n        if row & mask:\n            d += 2\n        digits.append(str(d))\n    return ''.join(digits)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('control #2', [2, 3, 1], '13'), ('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('boundary #12', [0, 0, 0], '')], [('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('boundary #12', [0, 0, 0], '')], [('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None)], [('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None)], [('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None), ('boundary #17', [4, 15, 15], '3333')]]\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":"ff32047745ffcc0b094e8809a88a31448feee9c0ca0166f1a31b0da32b282dfe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    z, col, row = x\n    if col < 0 or row < 0 or col >= 2 ** z or row >= 2 ** z:\n        return None\n    digits = []\n    for level in range(z, 0, -1):\n        mask = 1 << (level - 1)\n        d = 0\n        if col & mask:\n            d += 1\n        if row & mask:\n            d += 2\n        digits.append(str(d))\n    return ''.join(digits)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('control #2', [2, 3, 1], '13'), ('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('boundary #12', [0, 0, 0], '')], [('control #3', [3, 5, 2], '121'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('boundary #12', [0, 0, 0], '')], [('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None)], [('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('control #11', [2, 0, 3], '22'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None)], [('control #0', [1, 0, 0], '0'), ('control #1', [1, 1, 1], '3'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #14', [3, 7, 7], '333'), ('boundary #15', [2, 0, 4], None), ('boundary #16', [4, -1, 2], None), ('boundary #17', [4, 15, 15], '3333')]]\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-map-projection-transforms-quadkey-encode-zoom-zero-key","generated_at":"2026-09-29T14:48:16.195610+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Quadkeys are used as cache keys and spatial index prefixes; a wrong digit order breaks prefix containment.","repair":"At the zoom zero key step restore `return None digits`, leaving the rest of the model unchanged.","root_cause":"Zoom 0 is special-cased to \"0\" instead of producing the empty quadkey.","sha256":"2a94ebe7b43f9faa9dca6ec6e29db4886c64d097ff1455ff0213fd4cb225f0b5","title":"Bing-style quadkey encoding of a tile: zoom zero key · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.557,"exit_code":1,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"3","check":"control #1","expected":"3","passed":true},{"actual":"13","check":"control #2","expected":"13","passed":true},{"actual":"121","check":"control #3","expected":"121","passed":true},{"actual":"213","check":"control #4","expected":"213","passed":true},{"actual":"1221","check":"control #5","expected":"1221","passed":true},{"actual":"32221","check":"control #6","expected":"32221","passed":true},{"actual":null,"check":"boundary #12","expected":"","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"3\", \"expected\": \"3\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"13\", \"expected\": \"13\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"121\", \"expected\": \"121\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"213\", \"expected\": \"213\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"1221\", \"expected\": \"1221\", \"passed\": true}, {\"check\": \"control #6\", \"actual\": \"32221\", \"expected\": \"32221\", \"passed\": true}, {\"check\": \"boundary #12\", \"actual\": null, \"expected\": \"\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.559,"exit_code":1,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"3","check":"control #1","expected":"3","passed":true},{"actual":"13","check":"control #2","expected":"13","passed":true},{"actual":"121","check":"control #3","expected":"121","passed":true},{"actual":"213","check":"control #4","expected":"213","passed":true},{"actual":"1221","check":"control #5","expected":"1221","passed":true},{"actual":"32221","check":"control #6","expected":"32221","passed":true},{"actual":"0","check":"boundary #12","expected":"","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"3\", \"expected\": \"3\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"13\", \"expected\": \"13\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"121\", \"expected\": \"121\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"213\", \"expected\": \"213\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"1221\", \"expected\": \"1221\", \"passed\": true}, {\"check\": \"control #6\", \"actual\": \"32221\", \"expected\": \"32221\", \"passed\": true}, {\"check\": \"boundary #12\", \"actual\": \"0\", \"expected\": \"\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.81,"exit_code":0,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"3","check":"control #1","expected":"3","passed":true},{"actual":"13","check":"control #2","expected":"13","passed":true},{"actual":"121","check":"control #3","expected":"121","passed":true},{"actual":"213","check":"control #4","expected":"213","passed":true},{"actual":"1221","check":"control #5","expected":"1221","passed":true},{"actual":"32221","check":"control #6","expected":"32221","passed":true},{"actual":"","check":"boundary #12","expected":"","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"3\", \"expected\": \"3\", \"passed\": true}, {\"check\": \"control #2\", \"actual\": \"13\", \"expected\": \"13\", \"passed\": true}, {\"check\": \"control #3\", \"actual\": \"121\", \"expected\": \"121\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"213\", \"expected\": \"213\", \"passed\": true}, {\"check\": \"control #5\", \"actual\": \"1221\", \"expected\": \"1221\", \"passed\": true}, {\"check\": \"control #6\", \"actual\": \"32221\", \"expected\": \"32221\", \"passed\": true}, {\"check\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}