{"abstract":"Northern cities are fetched from southern tile rows.","category":"Map projection transforms","checks":8,"contract":"Input [lon, lat, z] with lon in [-180, 180], any latitude, z >= 0. With n = 2**z tiles per axis, column = floor((lon+180)/360*n) and row = floor((1 - asinh(tan(lat))/pi)/2*n) (row 0 at the north edge); both are clamped to [0, n-1] so lon=180 falls in the last column and latitudes beyond the mercator limit fall in the edge rows. Return [z, column, row].","evaluation_group":"w2-map-projection-transforms-lonlat-to-xyz-tile","failed_approach":"The orientation was restored but the scale uses n-1 rows, shifting rows toward the north edge.","family":"w2-map-projection-transforms-lonlat-to-xyz-tile-row-axis-orientation","id":"FA-69896","implementations":{"attempt":{"sha256":"9f09907f263e1dae3bc24e3084ab3d03311be453ce34fe4a215ffd28225b068c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    lon, lat, z = x\n    n = 2 ** z\n    phi = math.radians(max(-89.9, min(89.9, lat)))\n    xf = (lon + 180.0) / 360.0 * n\n    yf = (1.0 - math.asinh(math.tan(phi)) / math.pi) / 2.0 * (n - 1)\n    xt = min(max(math.floor(xf), 0), n - 1)\n    yt = min(max(math.floor(yf), 0), n - 1)\n    return [z, xt, yt]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('boundary #0', [180.0, 0.0, 3], [3, 7, 4]), ('boundary #1', [-180.0, 10.0, 4], [4, 0, 7]), ('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('control #10', [100.5, 13.7, 6], [6, 49, 29]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #13', [37.6, 55.75, 8], [8, 154, 80]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0]), ('control #17', [139.7, 35.7, 14], [14, 14549, 6450]), ('boundary #18', [180.0, 45.0, 6], [6, 63, 23]), ('boundary #19', [180.0, -60.0, 10], [10, 1023, 726])]]\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":"ee28932f38d222acb86e4cdda4fde8ebac151e4e687fc7dbfc4479bb7dc80e62","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    lon, lat, z = x\n    n = 2 ** z\n    phi = math.radians(max(-89.9, min(89.9, lat)))\n    xf = (lon + 180.0) / 360.0 * n\n    yf = (1.0 + math.asinh(math.tan(phi)) / math.pi) / 2.0 * n\n    xt = min(max(math.floor(xf), 0), n - 1)\n    yt = min(max(math.floor(yf), 0), n - 1)\n    return [z, xt, yt]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('boundary #0', [180.0, 0.0, 3], [3, 7, 4]), ('boundary #1', [-180.0, 10.0, 4], [4, 0, 7]), ('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('control #10', [100.5, 13.7, 6], [6, 49, 29]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #13', [37.6, 55.75, 8], [8, 154, 80]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0]), ('control #17', [139.7, 35.7, 14], [14, 14549, 6450]), ('boundary #18', [180.0, 45.0, 6], [6, 63, 23]), ('boundary #19', [180.0, -60.0, 10], [10, 1023, 726])]]\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":"7b3aa132c2d32d08cbd09dbd7d74573fda505c17e6c944ea0a194b25f280e3bd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    lon, lat, z = x\n    n = 2 ** z\n    phi = math.radians(max(-89.9, min(89.9, lat)))\n    xf = (lon + 180.0) / 360.0 * n\n    yf = (1.0 - math.asinh(math.tan(phi)) / math.pi) / 2.0 * n\n    xt = min(max(math.floor(xf), 0), n - 1)\n    yt = min(max(math.floor(yf), 0), n - 1)\n    return [z, xt, yt]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('boundary #0', [180.0, 0.0, 3], [3, 7, 4]), ('boundary #1', [-180.0, 10.0, 4], [4, 0, 7]), ('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #2', [10.0, 89.0, 5], [5, 16, 0]), ('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('control #6', [151.2, -33.9, 7], [7, 117, 76]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('boundary #3', [10.0, -89.0, 5], [5, 16, 31]), ('control #7', [0.0, 0.0, 1], [1, 1, 1]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #9', [-122.4, 37.8, 9], [9, 81, 197]), ('control #10', [100.5, 13.7, 6], [6, 49, 29]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #4', [13.4, 52.5, 10], [10, 550, 335]), ('control #8', [2.35, 48.85, 15], [15, 16597, 11274]), ('control #11', [-58.4, -34.6, 11], [11, 691, 1234]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #13', [37.6, 55.75, 8], [8, 154, 80]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0])], [('control #5', [-74.0, 40.7, 12], [12, 1206, 1540]), ('boundary #12', [179.99, -85.0, 2], [2, 3, 3]), ('control #14', [-0.12, 51.5, 16], [16, 32746, 21794]), ('control #15', [18.4, -33.9, 13], [13, 4514, 4916]), ('boundary #16', [0.0, 0.0, 0], [0, 0, 0]), ('control #17', [139.7, 35.7, 14], [14, 14549, 6450]), ('boundary #18', [180.0, 45.0, 6], [6, 63, 23]), ('boundary #19', [180.0, -60.0, 10], [10, 1023, 726])]]\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-lonlat-to-xyz-tile-row-axis-orientation","generated_at":"2026-09-29T14:48:15.732396+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tile servers and caches key storage by these indices; an off-by-one or flipped axis fetches the wrong image.","repair":"At the row axis orientation step restore `(1.0 - math.asinh(math.tan(phi)) / math.pi) / 2.0 * n`, leaving the rest of the model unchanged.","root_cause":"The row formula adds the mercator northing, producing TMS-style rows counted from the south edge.","sha256":"23e4e166cd4a199a5b96ea1566c6d6508901bf67dc1b6dc5afbede674778e49a","title":"Slippy map tile index from coordinates: row axis orientation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.09,"exit_code":1,"observations":[{"actual":[3,7,3],"check":"boundary #0","expected":[3,7,4],"passed":false},{"actual":[4,0,7],"check":"boundary #1","expected":[4,0,7],"passed":true},{"actual":[5,16,0],"check":"boundary #2","expected":[5,16,0],"passed":true},{"actual":[5,16,31],"check":"boundary #3","expected":[5,16,31],"passed":true},{"actual":[10,550,335],"check":"control #4","expected":[10,550,335],"passed":true},{"actual":[12,1206,1539],"check":"control #5","expected":[12,1206,1540],"passed":false},{"actual":[7,117,76],"check":"control #6","expected":[7,117,76],"passed":true},{"actual":[0,0,0],"check":"boundary #16","expected":[0,0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary #0\", \"actual\": [3, 7, 3], \"expected\": [3, 7, 4], \"passed\": false}, {\"check\": \"boundary #1\", \"actual\": [4, 0, 7], \"expected\": [4, 0, 7], \"passed\": true}, {\"check\": \"boundary #2\", \"actual\": [5, 16, 0], \"expected\": [5, 16, 0], \"passed\": true}, {\"check\": \"boundary #3\", \"actual\": [5, 16, 31], \"expected\": [5, 16, 31], \"passed\": true}, {\"check\": \"control #4\", \"actual\": [10, 550, 335], \"expected\": [10, 550, 335], \"passed\": true}, {\"check\": \"control #5\", \"actual\": [12, 1206, 1539], \"expected\": [12, 1206, 1540], \"passed\": false}, {\"check\": \"control #6\", \"actual\": [7, 117, 76], \"expected\": [7, 117, 76], \"passed\": true}, {\"check\": \"boundary #16\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.729,"exit_code":1,"observations":[{"actual":[3,7,4],"check":"boundary #0","expected":[3,7,4],"passed":true},{"actual":[4,0,8],"check":"boundary #1","expected":[4,0,7],"passed":false},{"actual":[5,16,31],"check":"boundary #2","expected":[5,16,0],"passed":false},{"actual":[5,16,0],"check":"boundary #3","expected":[5,16,31],"passed":false},{"actual":[10,550,688],"check":"control #4","expected":[10,550,335],"passed":false},{"actual":[12,1206,2555],"check":"control #5","expected":[12,1206,1540],"passed":false},{"actual":[7,117,51],"check":"control #6","expected":[7,117,76],"passed":false},{"actual":[0,0,0],"check":"boundary #16","expected":[0,0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary #0\", \"actual\": [3, 7, 4], \"expected\": [3, 7, 4], \"passed\": true}, {\"check\": \"boundary #1\", \"actual\": [4, 0, 8], \"expected\": [4, 0, 7], \"passed\": false}, {\"check\": \"boundary #2\", \"actual\": [5, 16, 31], \"expected\": [5, 16, 0], \"passed\": false}, {\"check\": \"boundary #3\", \"actual\": [5, 16, 0], \"expected\": [5, 16, 31], \"passed\": false}, {\"check\": \"control #4\", \"actual\": [10, 550, 688], \"expected\": [10, 550, 335], \"passed\": false}, {\"check\": \"control #5\", \"actual\": [12, 1206, 2555], \"expected\": [12, 1206, 1540], \"passed\": false}, {\"check\": \"control #6\", \"actual\": [7, 117, 51], \"expected\": [7, 117, 76], \"passed\": false}, {\"check\": \"boundary #16\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.743,"exit_code":0,"observations":[{"actual":[3,7,4],"check":"boundary #0","expected":[3,7,4],"passed":true},{"actual":[4,0,7],"check":"boundary #1","expected":[4,0,7],"passed":true},{"actual":[5,16,0],"check":"boundary #2","expected":[5,16,0],"passed":true},{"actual":[5,16,31],"check":"boundary #3","expected":[5,16,31],"passed":true},{"actual":[10,550,335],"check":"control #4","expected":[10,550,335],"passed":true},{"actual":[12,1206,1540],"check":"control #5","expected":[12,1206,1540],"passed":true},{"actual":[7,117,76],"check":"control #6","expected":[7,117,76],"passed":true},{"actual":[0,0,0],"check":"boundary #16","expected":[0,0,0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary #0\", \"actual\": [3, 7, 4], \"expected\": [3, 7, 4], \"passed\": true}, {\"check\": \"boundary #1\", \"actual\": [4, 0, 7], \"expected\": [4, 0, 7], \"passed\": true}, {\"check\": \"boundary #2\", \"actual\": [5, 16, 0], \"expected\": [5, 16, 0], \"passed\": true}, {\"check\": \"boundary #3\", \"actual\": [5, 16, 31], \"expected\": [5, 16, 31], \"passed\": true}, {\"check\": \"control #4\", \"actual\": [10, 550, 335], \"expected\": [10, 550, 335], \"passed\": true}, {\"check\": \"control #5\", \"actual\": [12, 1206, 1540], \"expected\": [12, 1206, 1540], \"passed\": true}, {\"check\": \"control #6\", \"actual\": [7, 117, 76], \"expected\": [7, 117, 76], \"passed\": true}, {\"check\": \"boundary #16\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}