{"abstract":"Keys read the wrong bit and tiles in odd columns get even-column keys.","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).","contract_signature":"x","evaluation_group":"w2-map-projection-transforms-quadkey-encode","failed_approach":"Shifting by level-2 fixes nothing for the highest bit and duplicates bit 0 at the two finest levels.","family":"w2-map-projection-transforms-quadkey-encode-bit-mask-position","id":"FA-69946","implementations":{"attempt":{"sha256":"c1b2e991a2b246f391ed4452fb986be861a22b2b2b7790285d56c45f2905d6ae","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 << max(level - 2, 0)\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'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None)], [('control #2', [2, 3, 1], '13'), ('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 #3', [3, 5, 2], '121'), ('control #5', [4, 9, 6], '1221'), ('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 #4', [3, 3, 5], '213'), ('control #6', [5, 17, 30], '32221'), ('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'), ('control #5', [4, 9, 6], '1221'), ('control #7', [6, 40, 12], '103200'), ('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":"f67e0b65948a6eff30b8d0815f56a1fcbfca7b658e6a84c7a68e38d896d44daa","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\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'), ('boundary #12', [0, 0, 0], ''), ('boundary #13', [3, 8, 0], None)], [('control #2', [2, 3, 1], '13'), ('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 #3', [3, 5, 2], '121'), ('control #5', [4, 9, 6], '1221'), ('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 #4', [3, 3, 5], '213'), ('control #6', [5, 17, 30], '32221'), ('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'), ('control #5', [4, 9, 6], '1221'), ('control #7', [6, 40, 12], '103200'), ('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-bit-mask-position","generated_at":"2026-09-29T14:48:16.070785+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.","root_cause":"The mask for a level is 1 << level, one bit too high.","sha256":"8a2ed2d7a76b93106511a897defe0284dabeb518a2b0127ed555cdbbd551cd7d","title":"Bing-style quadkey encoding of a tile: bit mask position · 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":38.692,"exit_code":1,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"3","check":"control #1","expected":"3","passed":true},{"actual":"33","check":"control #2","expected":"13","passed":false},{"actual":"211","check":"control #3","expected":"121","passed":false},{"actual":"133","check":"control #4","expected":"213","passed":false},{"actual":"2211","check":"control #5","expected":"1221","passed":false},{"actual":"","check":"boundary #12","expected":"","passed":true},{"actual":null,"check":"boundary #13","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\": \"33\", \"expected\": \"13\", \"passed\": false}, {\"check\": \"control #3\", \"actual\": \"211\", \"expected\": \"121\", \"passed\": false}, {\"check\": \"control #4\", \"actual\": \"133\", \"expected\": \"213\", \"passed\": false}, {\"check\": \"control #5\", \"actual\": \"2211\", \"expected\": \"1221\", \"passed\": false}, {\"check\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary #13\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.226,"exit_code":1,"observations":[{"actual":"0","check":"control #0","expected":"0","passed":true},{"actual":"0","check":"control #1","expected":"3","passed":false},{"actual":"01","check":"control #2","expected":"13","passed":false},{"actual":"012","check":"control #3","expected":"121","passed":false},{"actual":"021","check":"control #4","expected":"213","passed":false},{"actual":"0122","check":"control #5","expected":"1221","passed":false},{"actual":"","check":"boundary #12","expected":"","passed":true},{"actual":null,"check":"boundary #13","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control #0\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"control #1\", \"actual\": \"0\", \"expected\": \"3\", \"passed\": false}, {\"check\": \"control #2\", \"actual\": \"01\", \"expected\": \"13\", \"passed\": false}, {\"check\": \"control #3\", \"actual\": \"012\", \"expected\": \"121\", \"passed\": false}, {\"check\": \"control #4\", \"actual\": \"021\", \"expected\": \"213\", \"passed\": false}, {\"check\": \"control #5\", \"actual\": \"0122\", \"expected\": \"1221\", \"passed\": false}, {\"check\": \"boundary #12\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary #13\", \"actual\": null, \"expected\": null, \"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."}}