broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell//5,cell%5]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%4,cell//4]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The returned physical layout descriptor disagrees with the declared buffer mapping at cell_xy.

A 4x4 virtual tile occupies a 6x6 atlas cell, including one replicated texel on every side. Physical cell IDs come from a remap; atlas width is five cells. Input requests an interior texel, and output includes four border-copy addresses. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*4*p["b"]
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*6
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The returned physical layout descriptor disagrees with the declared buffer mapping at row_pitch.

A 4x4 virtual tile occupies a 6x6 atlas cell, including one replicated texel on every side. Physical cell IDs come from a remap; atlas width is five cells. Input requests an interior texel, and output includes four border-copy addresses. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell*36*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell_xy[1]*4*row_pitch+cell_xy[0]*4*p["b"]
    interior_origin = cell_origin+row_pitch+p["b"]
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The returned physical layout descriptor disagrees with the declared buffer mapping at cell_origin.

A 4x4 virtual tile occupies a 6x6 atlas cell, including one replicated texel on every side. Physical cell IDs come from a remap; atlas width is five cells. Input requests an interior texel, and output includes four border-copy addresses. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(p):
    p = dict(p)
    cell = p["remap"][p["tile"]]
    cell_xy = [cell%5,cell//5]
    row_pitch = 5*6*p["b"]
    cell_origin = p["base"]+cell_xy[1]*6*row_pitch+cell_xy[0]*6*p["b"]
    interior_origin = cell_origin+row_pitch
    address = interior_origin+p["local_y"]*row_pitch+p["local_x"]*p["b"]
    left_border = cell_origin+(p["local_y"]+1)*row_pitch
    right_border = cell_origin+(p["local_y"]+1)*row_pitch+5*p["b"]
    top_border = cell_origin+(p["local_x"]+1)*p["b"]
    bottom_border = cell_origin+5*row_pitch+(p["local_x"]+1)*p["b"]
    return {'cell': cell, 'cell_xy': cell_xy, 'row_pitch': row_pitch, 'cell_origin': cell_origin, 'interior_origin': interior_origin, 'address': address, 'left_border': left_border, 'right_border': right_border, 'top_border': top_border, 'bottom_border': bottom_border}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 60, 'cell_origin': 395, 'interior_origin': 457, 'address': 519, 'left_border': 515, 'right_border': 525, 'top_border': 399, 'bottom_border': 699}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 60, 'cell_origin': 11, 'interior_origin': 73, 'address': 257, 'left_border': 251, 'right_border': 261, 'top_border': 17, 'bottom_border': 317}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 60, 'cell_origin': 419, 'interior_origin': 481, 'address': 547, 'left_border': 539, 'right_border': 549, 'top_border': 427, 'bottom_border': 727}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 60, 'cell_origin': 47, 'interior_origin': 109, 'address': 289, 'left_border': 287, 'right_border': 297, 'top_border': 49, 'bottom_border': 349}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 60, 'cell_origin': 743, 'interior_origin': 805, 'address': 867, 'left_border': 863, 'right_border': 873, 'top_border': 747, 'bottom_border': 1047}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 2, 'base': 11, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 60, 'cell_origin': 371, 'interior_origin': 433, 'address': 617, 'left_border': 611, 'right_border': 621, 'top_border': 377, 'bottom_border': 677})], 2: [({'tile': 0, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 90, 'cell_origin': 598, 'interior_origin': 691, 'address': 877, 'left_border': 868, 'right_border': 883, 'top_border': 607, 'bottom_border': 1057}), ({'tile': 1, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 90, 'cell_origin': 22, 'interior_origin': 115, 'address': 124, 'left_border': 112, 'right_border': 127, 'top_border': 34, 'bottom_border': 484}), ({'tile': 2, 'local_x': 0, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 90, 'cell_origin': 634, 'interior_origin': 727, 'address': 907, 'left_border': 904, 'right_border': 919, 'top_border': 637, 'bottom_border': 1087}), ({'tile': 3, 'local_x': 1, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 90, 'cell_origin': 76, 'interior_origin': 169, 'address': 172, 'left_border': 166, 'right_border': 181, 'top_border': 82, 'bottom_border': 532}), ({'tile': 4, 'local_x': 2, 'local_y': 2, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 90, 'cell_origin': 1120, 'interior_origin': 1213, 'address': 1399, 'left_border': 1390, 'right_border': 1405, 'top_border': 1129, 'bottom_border': 1579}), ({'tile': 5, 'local_x': 3, 'local_y': 0, 'b': 3, 'base': 22, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 90, 'cell_origin': 562, 'interior_origin': 655, 'address': 664, 'left_border': 652, 'right_border': 667, 'top_border': 574, 'bottom_border': 1024})], 3: [({'tile': 0, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 120, 'cell_origin': 801, 'interior_origin': 925, 'address': 1297, 'left_border': 1281, 'right_border': 1301, 'top_border': 817, 'bottom_border': 1417}), ({'tile': 1, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 120, 'cell_origin': 33, 'interior_origin': 157, 'address': 277, 'left_border': 273, 'right_border': 293, 'top_border': 37, 'bottom_border': 637}), ({'tile': 2, 'local_x': 1, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 120, 'cell_origin': 849, 'interior_origin': 973, 'address': 1337, 'left_border': 1329, 'right_border': 1349, 'top_border': 857, 'bottom_border': 1457}), ({'tile': 3, 'local_x': 2, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 120, 'cell_origin': 105, 'interior_origin': 229, 'address': 357, 'left_border': 345, 'right_border': 365, 'top_border': 117, 'bottom_border': 717}), ({'tile': 4, 'local_x': 3, 'local_y': 3, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 120, 'cell_origin': 1497, 'interior_origin': 1621, 'address': 1993, 'left_border': 1977, 'right_border': 1997, 'top_border': 1513, 'bottom_border': 2113}), ({'tile': 5, 'local_x': 0, 'local_y': 1, 'b': 4, 'base': 33, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 120, 'cell_origin': 753, 'interior_origin': 877, 'address': 997, 'left_border': 993, 'right_border': 1013, 'top_border': 757, 'bottom_border': 1357})], 4: [({'tile': 0, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 150, 'cell_origin': 1004, 'interior_origin': 1159, 'address': 1159, 'left_border': 1154, 'right_border': 1179, 'top_border': 1009, 'bottom_border': 1759}), ({'tile': 1, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 150, 'cell_origin': 44, 'interior_origin': 199, 'address': 504, 'left_border': 494, 'right_border': 519, 'top_border': 54, 'bottom_border': 804}), ({'tile': 2, 'local_x': 2, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 150, 'cell_origin': 1064, 'interior_origin': 1219, 'address': 1229, 'left_border': 1214, 'right_border': 1239, 'top_border': 1079, 'bottom_border': 1829}), ({'tile': 3, 'local_x': 3, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 150, 'cell_origin': 134, 'interior_origin': 289, 'address': 604, 'left_border': 584, 'right_border': 609, 'top_border': 154, 'bottom_border': 904}), ({'tile': 4, 'local_x': 0, 'local_y': 0, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 150, 'cell_origin': 1874, 'interior_origin': 2029, 'address': 2029, 'left_border': 2024, 'right_border': 2049, 'top_border': 1879, 'bottom_border': 2629}), ({'tile': 5, 'local_x': 1, 'local_y': 2, 'b': 5, 'base': 44, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 150, 'cell_origin': 944, 'interior_origin': 1099, 'address': 1404, 'left_border': 1394, 'right_border': 1419, 'top_border': 954, 'bottom_border': 1704})], 5: [({'tile': 0, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 7, 'cell_xy': [2, 1], 'row_pitch': 180, 'cell_origin': 1207, 'interior_origin': 1393, 'address': 1579, 'left_border': 1567, 'right_border': 1597, 'top_border': 1219, 'bottom_border': 2119}), ({'tile': 1, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 0, 'cell_xy': [0, 0], 'row_pitch': 180, 'cell_origin': 55, 'interior_origin': 241, 'address': 793, 'left_border': 775, 'right_border': 805, 'top_border': 73, 'bottom_border': 973}), ({'tile': 2, 'local_x': 3, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 9, 'cell_xy': [4, 1], 'row_pitch': 180, 'cell_origin': 1279, 'interior_origin': 1465, 'address': 1663, 'left_border': 1639, 'right_border': 1669, 'top_border': 1303, 'bottom_border': 2203}), ({'tile': 3, 'local_x': 0, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 3, 'cell_xy': [3, 0], 'row_pitch': 180, 'cell_origin': 163, 'interior_origin': 349, 'address': 889, 'left_border': 883, 'right_border': 913, 'top_border': 169, 'bottom_border': 1069}), ({'tile': 4, 'local_x': 1, 'local_y': 1, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 11, 'cell_xy': [1, 2], 'row_pitch': 180, 'cell_origin': 2251, 'interior_origin': 2437, 'address': 2623, 'left_border': 2611, 'right_border': 2641, 'top_border': 2263, 'bottom_border': 3163}), ({'tile': 5, 'local_x': 2, 'local_y': 3, 'b': 6, 'base': 55, 'remap': [7, 0, 9, 3, 11, 5]}, {'cell': 5, 'cell_xy': [0, 1], 'row_pitch': 180, 'cell_origin': 1135, 'interior_origin': 1321, 'address': 1873, 'left_border': 1855, 'right_border': 1885, 'top_border': 1153, 'bottom_border': 2053})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The returned physical layout descriptor disagrees with the declared buffer mapping at interior_origin.

A 4x4 virtual tile occupies a 6x6 atlas cell, including one replicated texel on every side. Physical cell IDs come from a remap; atlas width is five cells. Input requests an interior texel, and output includes four border-copy addresses. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access