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

N = 1
observations = []
def solve(p):
    p = dict(p)
    tile_columns = p["w"]//4
    virtual_id = (p["y"]//4)*tile_columns+p["x"]//4
    slot = p["slots"][virtual_id]
    resident = slot is not None
    slot_pitch = 16*p["b"]+2
    local_index = (p["y"]%4)*4+p["x"]%4
    physical_start = p["base"]+(slot if slot is not None else 0)*slot_pitch
    candidate = physical_start+2+local_index*p["b"]
    address = candidate if resident else p["fallback"]
    directory_entry = p["base"]+virtual_id*4
    return {'tile_columns': tile_columns, 'virtual_id': virtual_id, 'slot': slot, 'resident': resident, 'slot_pitch': slot_pitch, 'local_index': local_index, 'physical_start': physical_start, 'candidate': candidate, 'address': address, 'directory_entry': directory_entry}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 10, 'h': 10, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 0, 'physical_start': 11, 'candidate': 13, 'address': 3, 'directory_entry': 11}), ({'w': 11, 'h': 10, 'x': 5, 'y': 1, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 113, 'candidate': 125, 'address': 125, 'directory_entry': 15}), ({'w': 10, 'h': 10, 'x': 8, 'y': 2, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 34, 'local_index': 8, 'physical_start': 11, 'candidate': 29, 'address': 29, 'directory_entry': 19}), ({'w': 11, 'h': 10, 'x': 1, 'y': 5, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 79, 'candidate': 91, 'address': 91, 'directory_entry': 23}), ({'w': 10, 'h': 10, 'x': 6, 'y': 4, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 2, 'physical_start': 11, 'candidate': 17, 'address': 3, 'directory_entry': 27}), ({'w': 11, 'h': 10, 'x': 9, 'y': 6, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 34, 'local_index': 9, 'physical_start': 45, 'candidate': 65, 'address': 65, 'directory_entry': 31})], 2: [({'w': 11, 'h': 11, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 0, 'physical_start': 22, 'candidate': 24, 'address': 6, 'directory_entry': 22}), ({'w': 12, 'h': 11, 'x': 5, 'y': 1, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 172, 'candidate': 189, 'address': 189, 'directory_entry': 26}), ({'w': 11, 'h': 11, 'x': 8, 'y': 2, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 50, 'local_index': 8, 'physical_start': 22, 'candidate': 48, 'address': 48, 'directory_entry': 30}), ({'w': 12, 'h': 11, 'x': 1, 'y': 5, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 122, 'candidate': 139, 'address': 139, 'directory_entry': 34}), ({'w': 11, 'h': 11, 'x': 6, 'y': 4, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 2, 'physical_start': 22, 'candidate': 30, 'address': 6, 'directory_entry': 38}), ({'w': 12, 'h': 11, 'x': 9, 'y': 6, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 50, 'local_index': 9, 'physical_start': 72, 'candidate': 101, 'address': 101, 'directory_entry': 42})], 3: [({'w': 12, 'h': 12, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 0, 'physical_start': 33, 'candidate': 35, 'address': 9, 'directory_entry': 33}), ({'w': 13, 'h': 12, 'x': 5, 'y': 1, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 231, 'candidate': 253, 'address': 253, 'directory_entry': 37}), ({'w': 12, 'h': 12, 'x': 8, 'y': 2, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 66, 'local_index': 8, 'physical_start': 33, 'candidate': 67, 'address': 67, 'directory_entry': 41}), ({'w': 13, 'h': 12, 'x': 1, 'y': 5, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 33, 'candidate': 55, 'address': 9, 'directory_entry': 49}), ({'w': 12, 'h': 12, 'x': 6, 'y': 4, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 2, 'physical_start': 33, 'candidate': 43, 'address': 9, 'directory_entry': 49}), ({'w': 13, 'h': 12, 'x': 9, 'y': 6, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 66, 'local_index': 9, 'physical_start': 363, 'candidate': 401, 'address': 401, 'directory_entry': 57})], 4: [({'w': 13, 'h': 13, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 0, 'physical_start': 44, 'candidate': 46, 'address': 12, 'directory_entry': 44}), ({'w': 14, 'h': 13, 'x': 5, 'y': 1, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 290, 'candidate': 317, 'address': 317, 'directory_entry': 48}), ({'w': 13, 'h': 13, 'x': 8, 'y': 2, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 82, 'local_index': 8, 'physical_start': 44, 'candidate': 86, 'address': 86, 'directory_entry': 52}), ({'w': 14, 'h': 13, 'x': 1, 'y': 5, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 44, 'candidate': 71, 'address': 12, 'directory_entry': 60}), ({'w': 13, 'h': 13, 'x': 6, 'y': 4, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 82, 'local_index': 2, 'physical_start': 126, 'candidate': 138, 'address': 138, 'directory_entry': 64}), ({'w': 14, 'h': 13, 'x': 9, 'y': 6, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 82, 'local_index': 9, 'physical_start': 454, 'candidate': 501, 'address': 501, 'directory_entry': 68})], 5: [({'w': 14, 'h': 14, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 0, 'physical_start': 55, 'candidate': 57, 'address': 15, 'directory_entry': 55}), ({'w': 15, 'h': 14, 'x': 5, 'y': 1, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 349, 'candidate': 381, 'address': 381, 'directory_entry': 59}), ({'w': 14, 'h': 14, 'x': 8, 'y': 2, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 98, 'local_index': 8, 'physical_start': 55, 'candidate': 105, 'address': 105, 'directory_entry': 63}), ({'w': 15, 'h': 14, 'x': 1, 'y': 5, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 55, 'candidate': 87, 'address': 15, 'directory_entry': 71}), ({'w': 14, 'h': 14, 'x': 6, 'y': 4, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 98, 'local_index': 2, 'physical_start': 153, 'candidate': 167, 'address': 167, 'directory_entry': 75}), ({'w': 15, 'h': 14, 'x': 9, 'y': 6, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 98, 'local_index': 9, 'physical_start': 545, 'candidate': 601, 'address': 601, 'directory_entry': 79})]}
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)
    tile_columns = p["w"]
    virtual_id = (p["y"]//4)*tile_columns+p["x"]//4
    slot = p["slots"][virtual_id]
    resident = slot is not None
    slot_pitch = 16*p["b"]+2
    local_index = (p["y"]%4)*4+p["x"]%4
    physical_start = p["base"]+(slot if slot is not None else 0)*slot_pitch
    candidate = physical_start+2+local_index*p["b"]
    address = candidate if resident else p["fallback"]
    directory_entry = p["base"]+virtual_id*4
    return {'tile_columns': tile_columns, 'virtual_id': virtual_id, 'slot': slot, 'resident': resident, 'slot_pitch': slot_pitch, 'local_index': local_index, 'physical_start': physical_start, 'candidate': candidate, 'address': address, 'directory_entry': directory_entry}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 10, 'h': 10, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 0, 'physical_start': 11, 'candidate': 13, 'address': 3, 'directory_entry': 11}), ({'w': 11, 'h': 10, 'x': 5, 'y': 1, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 113, 'candidate': 125, 'address': 125, 'directory_entry': 15}), ({'w': 10, 'h': 10, 'x': 8, 'y': 2, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 34, 'local_index': 8, 'physical_start': 11, 'candidate': 29, 'address': 29, 'directory_entry': 19}), ({'w': 11, 'h': 10, 'x': 1, 'y': 5, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 79, 'candidate': 91, 'address': 91, 'directory_entry': 23}), ({'w': 10, 'h': 10, 'x': 6, 'y': 4, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 2, 'physical_start': 11, 'candidate': 17, 'address': 3, 'directory_entry': 27}), ({'w': 11, 'h': 10, 'x': 9, 'y': 6, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 34, 'local_index': 9, 'physical_start': 45, 'candidate': 65, 'address': 65, 'directory_entry': 31})], 2: [({'w': 11, 'h': 11, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 0, 'physical_start': 22, 'candidate': 24, 'address': 6, 'directory_entry': 22}), ({'w': 12, 'h': 11, 'x': 5, 'y': 1, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 172, 'candidate': 189, 'address': 189, 'directory_entry': 26}), ({'w': 11, 'h': 11, 'x': 8, 'y': 2, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 50, 'local_index': 8, 'physical_start': 22, 'candidate': 48, 'address': 48, 'directory_entry': 30}), ({'w': 12, 'h': 11, 'x': 1, 'y': 5, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 122, 'candidate': 139, 'address': 139, 'directory_entry': 34}), ({'w': 11, 'h': 11, 'x': 6, 'y': 4, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 2, 'physical_start': 22, 'candidate': 30, 'address': 6, 'directory_entry': 38}), ({'w': 12, 'h': 11, 'x': 9, 'y': 6, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 50, 'local_index': 9, 'physical_start': 72, 'candidate': 101, 'address': 101, 'directory_entry': 42})], 3: [({'w': 12, 'h': 12, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 0, 'physical_start': 33, 'candidate': 35, 'address': 9, 'directory_entry': 33}), ({'w': 13, 'h': 12, 'x': 5, 'y': 1, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 231, 'candidate': 253, 'address': 253, 'directory_entry': 37}), ({'w': 12, 'h': 12, 'x': 8, 'y': 2, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 66, 'local_index': 8, 'physical_start': 33, 'candidate': 67, 'address': 67, 'directory_entry': 41}), ({'w': 13, 'h': 12, 'x': 1, 'y': 5, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 33, 'candidate': 55, 'address': 9, 'directory_entry': 49}), ({'w': 12, 'h': 12, 'x': 6, 'y': 4, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 2, 'physical_start': 33, 'candidate': 43, 'address': 9, 'directory_entry': 49}), ({'w': 13, 'h': 12, 'x': 9, 'y': 6, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 66, 'local_index': 9, 'physical_start': 363, 'candidate': 401, 'address': 401, 'directory_entry': 57})], 4: [({'w': 13, 'h': 13, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 0, 'physical_start': 44, 'candidate': 46, 'address': 12, 'directory_entry': 44}), ({'w': 14, 'h': 13, 'x': 5, 'y': 1, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 290, 'candidate': 317, 'address': 317, 'directory_entry': 48}), ({'w': 13, 'h': 13, 'x': 8, 'y': 2, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 82, 'local_index': 8, 'physical_start': 44, 'candidate': 86, 'address': 86, 'directory_entry': 52}), ({'w': 14, 'h': 13, 'x': 1, 'y': 5, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 44, 'candidate': 71, 'address': 12, 'directory_entry': 60}), ({'w': 13, 'h': 13, 'x': 6, 'y': 4, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 82, 'local_index': 2, 'physical_start': 126, 'candidate': 138, 'address': 138, 'directory_entry': 64}), ({'w': 14, 'h': 13, 'x': 9, 'y': 6, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 82, 'local_index': 9, 'physical_start': 454, 'candidate': 501, 'address': 501, 'directory_entry': 68})], 5: [({'w': 14, 'h': 14, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 0, 'physical_start': 55, 'candidate': 57, 'address': 15, 'directory_entry': 55}), ({'w': 15, 'h': 14, 'x': 5, 'y': 1, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 349, 'candidate': 381, 'address': 381, 'directory_entry': 59}), ({'w': 14, 'h': 14, 'x': 8, 'y': 2, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 98, 'local_index': 8, 'physical_start': 55, 'candidate': 105, 'address': 105, 'directory_entry': 63}), ({'w': 15, 'h': 14, 'x': 1, 'y': 5, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 55, 'candidate': 87, 'address': 15, 'directory_entry': 71}), ({'w': 14, 'h': 14, 'x': 6, 'y': 4, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 98, 'local_index': 2, 'physical_start': 153, 'candidate': 167, 'address': 167, 'directory_entry': 75}), ({'w': 15, 'h': 14, 'x': 9, 'y': 6, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 98, 'local_index': 9, 'physical_start': 545, 'candidate': 601, 'address': 601, 'directory_entry': 79})]}
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 tile_columns.

A 4x4 tiled texture has a virtual tile directory mapping tile IDs to optional physical slots. Physical slots have two-byte tags; absent slots use a supplied fallback byte address and must not be interpreted as slot zero. 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)
    tile_columns = (p["w"]+3)//4
    virtual_id = (p["x"]//4)*tile_columns+p["y"]//4
    slot = p["slots"][virtual_id]
    resident = slot is not None
    slot_pitch = 16*p["b"]+2
    local_index = (p["y"]%4)*4+p["x"]%4
    physical_start = p["base"]+(slot if slot is not None else 0)*slot_pitch
    candidate = physical_start+2+local_index*p["b"]
    address = candidate if resident else p["fallback"]
    directory_entry = p["base"]+virtual_id*4
    return {'tile_columns': tile_columns, 'virtual_id': virtual_id, 'slot': slot, 'resident': resident, 'slot_pitch': slot_pitch, 'local_index': local_index, 'physical_start': physical_start, 'candidate': candidate, 'address': address, 'directory_entry': directory_entry}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 10, 'h': 10, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 0, 'physical_start': 11, 'candidate': 13, 'address': 3, 'directory_entry': 11}), ({'w': 11, 'h': 10, 'x': 5, 'y': 1, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 113, 'candidate': 125, 'address': 125, 'directory_entry': 15}), ({'w': 10, 'h': 10, 'x': 8, 'y': 2, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 34, 'local_index': 8, 'physical_start': 11, 'candidate': 29, 'address': 29, 'directory_entry': 19}), ({'w': 11, 'h': 10, 'x': 1, 'y': 5, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 79, 'candidate': 91, 'address': 91, 'directory_entry': 23}), ({'w': 10, 'h': 10, 'x': 6, 'y': 4, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 2, 'physical_start': 11, 'candidate': 17, 'address': 3, 'directory_entry': 27}), ({'w': 11, 'h': 10, 'x': 9, 'y': 6, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 34, 'local_index': 9, 'physical_start': 45, 'candidate': 65, 'address': 65, 'directory_entry': 31})], 2: [({'w': 11, 'h': 11, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 0, 'physical_start': 22, 'candidate': 24, 'address': 6, 'directory_entry': 22}), ({'w': 12, 'h': 11, 'x': 5, 'y': 1, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 172, 'candidate': 189, 'address': 189, 'directory_entry': 26}), ({'w': 11, 'h': 11, 'x': 8, 'y': 2, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 50, 'local_index': 8, 'physical_start': 22, 'candidate': 48, 'address': 48, 'directory_entry': 30}), ({'w': 12, 'h': 11, 'x': 1, 'y': 5, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 122, 'candidate': 139, 'address': 139, 'directory_entry': 34}), ({'w': 11, 'h': 11, 'x': 6, 'y': 4, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 2, 'physical_start': 22, 'candidate': 30, 'address': 6, 'directory_entry': 38}), ({'w': 12, 'h': 11, 'x': 9, 'y': 6, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 50, 'local_index': 9, 'physical_start': 72, 'candidate': 101, 'address': 101, 'directory_entry': 42})], 3: [({'w': 12, 'h': 12, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 0, 'physical_start': 33, 'candidate': 35, 'address': 9, 'directory_entry': 33}), ({'w': 13, 'h': 12, 'x': 5, 'y': 1, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 231, 'candidate': 253, 'address': 253, 'directory_entry': 37}), ({'w': 12, 'h': 12, 'x': 8, 'y': 2, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 66, 'local_index': 8, 'physical_start': 33, 'candidate': 67, 'address': 67, 'directory_entry': 41}), ({'w': 13, 'h': 12, 'x': 1, 'y': 5, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 33, 'candidate': 55, 'address': 9, 'directory_entry': 49}), ({'w': 12, 'h': 12, 'x': 6, 'y': 4, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 2, 'physical_start': 33, 'candidate': 43, 'address': 9, 'directory_entry': 49}), ({'w': 13, 'h': 12, 'x': 9, 'y': 6, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 66, 'local_index': 9, 'physical_start': 363, 'candidate': 401, 'address': 401, 'directory_entry': 57})], 4: [({'w': 13, 'h': 13, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 0, 'physical_start': 44, 'candidate': 46, 'address': 12, 'directory_entry': 44}), ({'w': 14, 'h': 13, 'x': 5, 'y': 1, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 290, 'candidate': 317, 'address': 317, 'directory_entry': 48}), ({'w': 13, 'h': 13, 'x': 8, 'y': 2, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 82, 'local_index': 8, 'physical_start': 44, 'candidate': 86, 'address': 86, 'directory_entry': 52}), ({'w': 14, 'h': 13, 'x': 1, 'y': 5, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 44, 'candidate': 71, 'address': 12, 'directory_entry': 60}), ({'w': 13, 'h': 13, 'x': 6, 'y': 4, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 82, 'local_index': 2, 'physical_start': 126, 'candidate': 138, 'address': 138, 'directory_entry': 64}), ({'w': 14, 'h': 13, 'x': 9, 'y': 6, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 82, 'local_index': 9, 'physical_start': 454, 'candidate': 501, 'address': 501, 'directory_entry': 68})], 5: [({'w': 14, 'h': 14, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 0, 'physical_start': 55, 'candidate': 57, 'address': 15, 'directory_entry': 55}), ({'w': 15, 'h': 14, 'x': 5, 'y': 1, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 349, 'candidate': 381, 'address': 381, 'directory_entry': 59}), ({'w': 14, 'h': 14, 'x': 8, 'y': 2, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 98, 'local_index': 8, 'physical_start': 55, 'candidate': 105, 'address': 105, 'directory_entry': 63}), ({'w': 15, 'h': 14, 'x': 1, 'y': 5, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 55, 'candidate': 87, 'address': 15, 'directory_entry': 71}), ({'w': 14, 'h': 14, 'x': 6, 'y': 4, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 98, 'local_index': 2, 'physical_start': 153, 'candidate': 167, 'address': 167, 'directory_entry': 75}), ({'w': 15, 'h': 14, 'x': 9, 'y': 6, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 98, 'local_index': 9, 'physical_start': 545, 'candidate': 601, 'address': 601, 'directory_entry': 79})]}
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)
    tile_columns = (p["w"]+3)//4
    virtual_id = p["y"]//4+p["x"]//4
    slot = p["slots"][virtual_id]
    resident = slot is not None
    slot_pitch = 16*p["b"]+2
    local_index = (p["y"]%4)*4+p["x"]%4
    physical_start = p["base"]+(slot if slot is not None else 0)*slot_pitch
    candidate = physical_start+2+local_index*p["b"]
    address = candidate if resident else p["fallback"]
    directory_entry = p["base"]+virtual_id*4
    return {'tile_columns': tile_columns, 'virtual_id': virtual_id, 'slot': slot, 'resident': resident, 'slot_pitch': slot_pitch, 'local_index': local_index, 'physical_start': physical_start, 'candidate': candidate, 'address': address, 'directory_entry': directory_entry}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 10, 'h': 10, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 0, 'physical_start': 11, 'candidate': 13, 'address': 3, 'directory_entry': 11}), ({'w': 11, 'h': 10, 'x': 5, 'y': 1, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 113, 'candidate': 125, 'address': 125, 'directory_entry': 15}), ({'w': 10, 'h': 10, 'x': 8, 'y': 2, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 34, 'local_index': 8, 'physical_start': 11, 'candidate': 29, 'address': 29, 'directory_entry': 19}), ({'w': 11, 'h': 10, 'x': 1, 'y': 5, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 34, 'local_index': 5, 'physical_start': 79, 'candidate': 91, 'address': 91, 'directory_entry': 23}), ({'w': 10, 'h': 10, 'x': 6, 'y': 4, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 34, 'local_index': 2, 'physical_start': 11, 'candidate': 17, 'address': 3, 'directory_entry': 27}), ({'w': 11, 'h': 10, 'x': 9, 'y': 6, 'b': 2, 'base': 11, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 3}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 34, 'local_index': 9, 'physical_start': 45, 'candidate': 65, 'address': 65, 'directory_entry': 31})], 2: [({'w': 11, 'h': 11, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 0, 'physical_start': 22, 'candidate': 24, 'address': 6, 'directory_entry': 22}), ({'w': 12, 'h': 11, 'x': 5, 'y': 1, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 172, 'candidate': 189, 'address': 189, 'directory_entry': 26}), ({'w': 11, 'h': 11, 'x': 8, 'y': 2, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 50, 'local_index': 8, 'physical_start': 22, 'candidate': 48, 'address': 48, 'directory_entry': 30}), ({'w': 12, 'h': 11, 'x': 1, 'y': 5, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 3, 'slot': 2, 'resident': True, 'slot_pitch': 50, 'local_index': 5, 'physical_start': 122, 'candidate': 139, 'address': 139, 'directory_entry': 34}), ({'w': 11, 'h': 11, 'x': 6, 'y': 4, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 50, 'local_index': 2, 'physical_start': 22, 'candidate': 30, 'address': 6, 'directory_entry': 38}), ({'w': 12, 'h': 11, 'x': 9, 'y': 6, 'b': 3, 'base': 22, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 6}, {'tile_columns': 3, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 50, 'local_index': 9, 'physical_start': 72, 'candidate': 101, 'address': 101, 'directory_entry': 42})], 3: [({'w': 12, 'h': 12, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 0, 'physical_start': 33, 'candidate': 35, 'address': 9, 'directory_entry': 33}), ({'w': 13, 'h': 12, 'x': 5, 'y': 1, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 231, 'candidate': 253, 'address': 253, 'directory_entry': 37}), ({'w': 12, 'h': 12, 'x': 8, 'y': 2, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 66, 'local_index': 8, 'physical_start': 33, 'candidate': 67, 'address': 67, 'directory_entry': 41}), ({'w': 13, 'h': 12, 'x': 1, 'y': 5, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 5, 'physical_start': 33, 'candidate': 55, 'address': 9, 'directory_entry': 49}), ({'w': 12, 'h': 12, 'x': 6, 'y': 4, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 3, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 66, 'local_index': 2, 'physical_start': 33, 'candidate': 43, 'address': 9, 'directory_entry': 49}), ({'w': 13, 'h': 12, 'x': 9, 'y': 6, 'b': 4, 'base': 33, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 9}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 66, 'local_index': 9, 'physical_start': 363, 'candidate': 401, 'address': 401, 'directory_entry': 57})], 4: [({'w': 13, 'h': 13, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 0, 'physical_start': 44, 'candidate': 46, 'address': 12, 'directory_entry': 44}), ({'w': 14, 'h': 13, 'x': 5, 'y': 1, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 290, 'candidate': 317, 'address': 317, 'directory_entry': 48}), ({'w': 13, 'h': 13, 'x': 8, 'y': 2, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 82, 'local_index': 8, 'physical_start': 44, 'candidate': 86, 'address': 86, 'directory_entry': 52}), ({'w': 14, 'h': 13, 'x': 1, 'y': 5, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 82, 'local_index': 5, 'physical_start': 44, 'candidate': 71, 'address': 12, 'directory_entry': 60}), ({'w': 13, 'h': 13, 'x': 6, 'y': 4, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 82, 'local_index': 2, 'physical_start': 126, 'candidate': 138, 'address': 138, 'directory_entry': 64}), ({'w': 14, 'h': 13, 'x': 9, 'y': 6, 'b': 5, 'base': 44, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 12}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 82, 'local_index': 9, 'physical_start': 454, 'candidate': 501, 'address': 501, 'directory_entry': 68})], 5: [({'w': 14, 'h': 14, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 0, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 0, 'physical_start': 55, 'candidate': 57, 'address': 15, 'directory_entry': 55}), ({'w': 15, 'h': 14, 'x': 5, 'y': 1, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 1, 'slot': 3, 'resident': True, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 349, 'candidate': 381, 'address': 381, 'directory_entry': 59}), ({'w': 14, 'h': 14, 'x': 8, 'y': 2, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 2, 'slot': 0, 'resident': True, 'slot_pitch': 98, 'local_index': 8, 'physical_start': 55, 'candidate': 105, 'address': 105, 'directory_entry': 63}), ({'w': 15, 'h': 14, 'x': 1, 'y': 5, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 4, 'slot': None, 'resident': False, 'slot_pitch': 98, 'local_index': 5, 'physical_start': 55, 'candidate': 87, 'address': 15, 'directory_entry': 71}), ({'w': 14, 'h': 14, 'x': 6, 'y': 4, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 5, 'slot': 1, 'resident': True, 'slot_pitch': 98, 'local_index': 2, 'physical_start': 153, 'candidate': 167, 'address': 167, 'directory_entry': 75}), ({'w': 15, 'h': 14, 'x': 9, 'y': 6, 'b': 6, 'base': 55, 'slots': [None, 3, 0, 2, None, 1, 5, 4, None, 6, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], 'fallback': 15}, {'tile_columns': 4, 'virtual_id': 6, 'slot': 5, 'resident': True, 'slot_pitch': 98, 'local_index': 9, 'physical_start': 545, 'candidate': 601, 'address': 601, 'directory_entry': 79})]}
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 virtual_id.

A 4x4 tiled texture has a virtual tile directory mapping tile IDs to optional physical slots. Physical slots have two-byte tags; absent slots use a supplied fallback byte address and must not be interpreted as slot zero. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access