{"abstract":"Quadkeys of neighbouring tiles no longer share their parent prefix.","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":"The loop now stops before level 1, dropping the finest digit.","family":"w2-map-projection-transforms-quadkey-encode-digit-significance-order","id":"FA-69941","implementations":{"attempt":{"sha256":"a7b75c2dfd94899594749d268b07afba2780277076dd7f153a281b1e95141097","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, 1, -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'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #1', [1, 1, 1], '3'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #2', [2, 3, 1], '13'), ('control #6', [5, 17, 30], '32221'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #3', [3, 5, 2], '121'), ('control #7', [6, 40, 12], '103200'), ('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 #4', [3, 3, 5], '213'), ('control #8', [7, 100, 3], '1100122'), ('boundary #12', [0, 0, 0], ''), ('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":"d786961043787eaad94c23aa97a40fc2293ac1c4a2e7ea880a1c6112c5b1cfa6","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(1, z + 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'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #1', [1, 1, 1], '3'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #2', [2, 3, 1], '13'), ('control #6', [5, 17, 30], '32221'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #3', [3, 5, 2], '121'), ('control #7', [6, 40, 12], '103200'), ('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 #4', [3, 3, 5], '213'), ('control #8', [7, 100, 3], '1100122'), ('boundary #12', [0, 0, 0], ''), ('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":"d0e65c0331ff298779309612a426cf9d2931515f6c16ac098c172c7dfcd995ea","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'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #1', [1, 1, 1], '3'), ('control #4', [3, 3, 5], '213'), ('control #5', [4, 9, 6], '1221'), ('control #6', [5, 17, 30], '32221'), ('control #7', [6, 40, 12], '103200'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #2', [2, 3, 1], '13'), ('control #6', [5, 17, 30], '32221'), ('control #8', [7, 100, 3], '1100122'), ('control #9', [8, 200, 150], '31021220'), ('control #10', [10, 550, 335], '1202102332'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None), ('boundary #15', [2, 0, 4], None)], [('control #3', [3, 5, 2], '121'), ('control #7', [6, 40, 12], '103200'), ('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 #4', [3, 3, 5], '213'), ('control #8', [7, 100, 3], '1100122'), ('boundary #12', [0, 0, 0], ''), ('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-digit-significance-order","generated_at":"2026-09-29T14:48:16.026673+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 digit significance order step restore `for level in range(z, 0, -1):`, leaving the rest of the model unchanged.","root_cause":"Digits are emitted from the least significant bit first, reversing the key.","sha256":"8df9d66a6cabe8b1d382349d8a7a6a9f0c8e0fcd1d090c6b9b711960b262a202","title":"Bing-style quadkey encoding of a tile: digit significance order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.875,"exit_code":1,"observations":[{"actual":"","check":"control #0","expected":"0","passed":false},{"actual":"","check":"control #1","expected":"3","passed":false},{"actual":"1","check":"control #2","expected":"13","passed":false},{"actual":"12","check":"control #3","expected":"121","passed":false},{"actual":"21","check":"control #4","expected":"213","passed":false},{"actual":"","check":"boundary #12","expected":"","passed":true},{"actual":null,"check":"boundary #13","expected":null,"passed":true},{"actual":null,"check":"boundary #15","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"\", \"expected\": \"0\", \"passed\": false}, {\"check\": \"control #1\", \"actual\": \"\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"control #2\", \"actual\": \"1\", \"expected\": \"13\", \"passed\": false}, {\"check\": \"control #3\", \"actual\": \"12\", \"expected\": \"121\", \"passed\": false}, {\"check\": \"control #4\", \"actual\": \"21\", \"expected\": \"213\", \"passed\": false}, {\"check\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary #13\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #15\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.316,"exit_code":1,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"3","check":"control #1","expected":"3","passed":true},{"actual":"31","check":"control #2","expected":"13","passed":false},{"actual":"121","check":"control #3","expected":"121","passed":true},{"actual":"312","check":"control #4","expected":"213","passed":false},{"actual":"","check":"boundary #12","expected":"","passed":true},{"actual":null,"check":"boundary #13","expected":null,"passed":true},{"actual":null,"check":"boundary #15","expected":null,"passed":true}],"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\": \"31\", \"expected\": \"13\", \"passed\": false}, {\"check\": \"control #3\", \"actual\": \"121\", \"expected\": \"121\", \"passed\": true}, {\"check\": \"control #4\", \"actual\": \"312\", \"expected\": \"213\", \"passed\": false}, {\"check\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary #13\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #15\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.274,"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":"","check":"boundary #12","expected":"","passed":true},{"actual":null,"check":"boundary #13","expected":null,"passed":true},{"actual":null,"check":"boundary #15","expected":null,"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\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary #13\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary #15\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}