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

N = 1
observations = []
def solve(p):
    p = dict(p)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*8
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*11
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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 shift.

A stipulated luma row stores three ten-bit samples in each 32-bit little-endian word. The top two bits are preserved metadata. Each scanline starts with a two-byte exposure tag; final unused lanes are padding. 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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 255<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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 mask.

A stipulated luma row stores three ten-bit samples in each 32-bit little-endian word. The top two bits are preserved metadata. Each scanline starts with a two-byte exposure tag; final unused lanes are padding. 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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*3
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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 word_address.

A stipulated luma row stores three ten-bit samples in each 32-bit little-endian word. The top two bits are preserved metadata. Each scanline starts with a two-byte exposure tag; final unused lanes are padding. 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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|(p["value"]&1023)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&0x3fffffff&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(4)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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 updated.

A stipulated luma row stores three ten-bit samples in each 32-bit little-endian word. The top two bits are preserved metadata. Each scanline starts with a two-byte exposure tag; final unused lanes are padding. 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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in reversed(range(4))]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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)
    words_per_row = (p["w"]+2)//3
    row_pitch = words_per_row*4+2
    word_column = p["x"]//3
    lane = p["x"]%3
    shift = lane*10
    mask = 1023<<shift
    word_address = p["base"]+p["y"]*row_pitch+2+word_column*4
    updated = (p["word"]&~mask)|((p["value"]&1023)<<shift)
    bytes = [(updated>>(8*i))&255 for i in range(3)]
    valid_tail_lanes = (p["w"]-1)%3+1
    return {'words_per_row': words_per_row, 'row_pitch': row_pitch, 'word_column': word_column, 'lane': lane, 'shift': shift, 'mask': mask, 'word_address': word_address, 'updated': updated, 'bytes': bytes, 'valid_tail_lanes': valid_tail_lanes}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 6, 'h': 2, 'x': 0, 'y': 0, 'base': 7, 'value': 31, 'word': 3240314215}, {'words_per_row': 2, 'row_pitch': 10, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 9, 'updated': 3240313887, 'bytes': [31, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 7, 'h': 3, 'x': 1, 'y': 1, 'base': 7, 'value': 32, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 23, 'updated': 3240132967, 'bytes': [103, 129, 32, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 4, 'x': 2, 'y': 2, 'base': 7, 'value': 33, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 37, 'updated': 3256042855, 'bytes': [103, 69, 19, 194], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 5, 'x': 3, 'y': 3, 'base': 7, 'value': 34, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 55, 'updated': 3240313890, 'bytes': [34, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 6, 'x': 4, 'y': 4, 'base': 7, 'value': 35, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 85, 'updated': 3240136039, 'bytes': [103, 141, 32, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 7, 'x': 5, 'y': 5, 'base': 7, 'value': 36, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 103, 'updated': 3259188583, 'bytes': [103, 69, 67, 194], 'valid_tail_lanes': 2})], 2: [({'w': 7, 'h': 2, 'x': 0, 'y': 0, 'base': 14, 'value': 62, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 16, 'updated': 3240313918, 'bytes': [62, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 8, 'h': 3, 'x': 1, 'y': 1, 'base': 14, 'value': 63, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 30, 'updated': 3240164711, 'bytes': [103, 253, 32, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 4, 'x': 2, 'y': 2, 'base': 14, 'value': 64, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 44, 'updated': 3288548711, 'bytes': [103, 69, 3, 196], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 5, 'x': 3, 'y': 3, 'base': 14, 'value': 65, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 74, 'updated': 3240313921, 'bytes': [65, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 6, 'x': 4, 'y': 4, 'base': 14, 'value': 66, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 92, 'updated': 3240167783, 'bytes': [103, 9, 33, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 7, 'x': 5, 'y': 5, 'base': 14, 'value': 67, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 110, 'updated': 3291694439, 'bytes': [103, 69, 51, 196], 'valid_tail_lanes': 3})], 3: [({'w': 8, 'h': 2, 'x': 0, 'y': 0, 'base': 21, 'value': 93, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 23, 'updated': 3240313949, 'bytes': [93, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 9, 'h': 3, 'x': 1, 'y': 1, 'base': 21, 'value': 94, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 37, 'updated': 3240196455, 'bytes': [103, 121, 33, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 4, 'x': 2, 'y': 2, 'base': 21, 'value': 95, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 59, 'updated': 3321054567, 'bytes': [103, 69, 243, 197], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 5, 'x': 3, 'y': 3, 'base': 21, 'value': 96, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 81, 'updated': 3240313952, 'bytes': [96, 68, 35, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 6, 'x': 4, 'y': 4, 'base': 21, 'value': 97, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 99, 'updated': 3240199527, 'bytes': [103, 133, 33, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 7, 'x': 5, 'y': 5, 'base': 21, 'value': 98, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 137, 'updated': 3324200295, 'bytes': [103, 69, 35, 198], 'valid_tail_lanes': 1})], 4: [({'w': 9, 'h': 2, 'x': 0, 'y': 0, 'base': 28, 'value': 124, 'word': 3240314215}, {'words_per_row': 3, 'row_pitch': 14, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 30, 'updated': 3240313980, 'bytes': [124, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 10, 'h': 3, 'x': 1, 'y': 1, 'base': 28, 'value': 125, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 48, 'updated': 3240228199, 'bytes': [103, 245, 33, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 4, 'x': 2, 'y': 2, 'base': 28, 'value': 126, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 66, 'updated': 3353560423, 'bytes': [103, 69, 227, 199], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 5, 'x': 3, 'y': 3, 'base': 28, 'value': 127, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 88, 'updated': 3240313983, 'bytes': [127, 68, 35, 193], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 6, 'x': 4, 'y': 4, 'base': 28, 'value': 128, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 122, 'updated': 3240231271, 'bytes': [103, 1, 34, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 7, 'x': 5, 'y': 5, 'base': 28, 'value': 129, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 144, 'updated': 3356706151, 'bytes': [103, 69, 19, 200], 'valid_tail_lanes': 2})], 5: [({'w': 10, 'h': 2, 'x': 0, 'y': 0, 'base': 35, 'value': 155, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 37, 'updated': 3240314011, 'bytes': [155, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 11, 'h': 3, 'x': 1, 'y': 1, 'base': 35, 'value': 156, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 55, 'updated': 3240259943, 'bytes': [103, 113, 34, 193], 'valid_tail_lanes': 2}), ({'w': 12, 'h': 4, 'x': 2, 'y': 2, 'base': 35, 'value': 157, 'word': 3240314215}, {'words_per_row': 4, 'row_pitch': 18, 'word_column': 0, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 73, 'updated': 3386066279, 'bytes': [103, 69, 211, 201], 'valid_tail_lanes': 3}), ({'w': 13, 'h': 5, 'x': 3, 'y': 3, 'base': 35, 'value': 158, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 0, 'shift': 0, 'mask': 1023, 'word_address': 107, 'updated': 3240314014, 'bytes': [158, 68, 35, 193], 'valid_tail_lanes': 1}), ({'w': 14, 'h': 6, 'x': 4, 'y': 4, 'base': 35, 'value': 159, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 1, 'shift': 10, 'mask': 1047552, 'word_address': 129, 'updated': 3240263015, 'bytes': [103, 125, 34, 193], 'valid_tail_lanes': 2}), ({'w': 15, 'h': 7, 'x': 5, 'y': 5, 'base': 35, 'value': 160, 'word': 3240314215}, {'words_per_row': 5, 'row_pitch': 22, 'word_column': 1, 'lane': 2, 'shift': 20, 'mask': 1072693248, 'word_address': 151, 'updated': 3389212007, 'bytes': [103, 69, 3, 202], 'valid_tail_lanes': 3})]}
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 bytes.

A stipulated luma row stores three ten-bit samples in each 32-bit little-endian word. The top two bits are preserved metadata. Each scanline starts with a two-byte exposure tag; final unused lanes are padding. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access