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

N = 1
observations = []
def solve(p):
    p = dict(p)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = p["x"]%2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 2 if p["x"]%2==0 else 0
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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 luma_lane.

A stipulated 4:2:2 image stores each pair as [Y0,U,Y1,V], with two bytes per component. Odd final pairs still reserve both luma slots. Three-byte row prefixes precede complete macropixels. 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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = [0,1,3][p["component"]]
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (3 if p["component"]==1 else 1)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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 component_lane.

A stipulated 4:2:2 image stores each pair as [Y0,U,Y1,V], with two bytes per component. Odd final pairs still reserve both luma slots. Three-byte row prefixes precede complete macropixels. 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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*4+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = p["w"]*4+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A stipulated 4:2:2 image stores each pair as [Y0,U,Y1,V], with two bytes per component. Odd final pairs still reserve both luma slots. Three-byte row prefixes precede complete macropixels. 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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+(p["y"]//2)*row_pitch+3
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch
    pair_origin = row_origin+pair_id*8
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
for i, (p, expected) in enumerate(cases[N]):
    check("layout fixture " + str(i + 1), solve(p), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A stipulated 4:2:2 image stores each pair as [Y0,U,Y1,V], with two bytes per component. Odd final pairs still reserve both luma slots. Three-byte row prefixes precede complete macropixels. 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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*4
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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)
    pairs = (p["w"]+1)//2
    pair_id = p["x"]//2
    luma_lane = 0 if p["x"]%2==0 else 2
    component_lane = luma_lane if p["component"]==0 else (1 if p["component"]==1 else 3)
    row_pitch = pairs*8+3
    row_origin = p["base"]+p["y"]*row_pitch+3
    pair_origin = row_origin+pair_id*6
    address = pair_origin+component_lane*2
    valid_luma_slots = min(2,p["w"]-pair_id*2)
    allocation_end = p["base"]+p["h"]*row_pitch
    return {'pairs': pairs, 'pair_id': pair_id, 'luma_lane': luma_lane, 'component_lane': component_lane, 'row_pitch': row_pitch, 'row_origin': row_origin, 'pair_origin': pair_origin, 'address': address, 'valid_luma_slots': valid_luma_slots, 'allocation_end': allocation_end}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 14, 'pair_origin': 14, 'address': 14, 'valid_luma_slots': 1, 'allocation_end': 22}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 3, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 27, 'row_origin': 68, 'pair_origin': 68, 'address': 70, 'valid_luma_slots': 2, 'allocation_end': 119}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 5, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 43, 'row_origin': 272, 'pair_origin': 304, 'address': 310, 'valid_luma_slots': 2, 'allocation_end': 355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 483, 'pair_origin': 539, 'address': 543, 'valid_luma_slots': 2, 'allocation_end': 547}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'component': 1}, {'pairs': 9, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 75, 'row_origin': 614, 'pair_origin': 678, 'address': 680, 'valid_luma_slots': 2, 'allocation_end': 761}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 434, 'pair_origin': 442, 'address': 448, 'valid_luma_slots': 2, 'allocation_end': 466})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 25, 'pair_origin': 25, 'address': 25, 'valid_luma_slots': 1, 'allocation_end': 33}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 95, 'pair_origin': 95, 'address': 97, 'valid_luma_slots': 2, 'allocation_end': 197}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 331, 'pair_origin': 363, 'address': 369, 'valid_luma_slots': 2, 'allocation_end': 481}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 494, 'pair_origin': 550, 'address': 554, 'valid_luma_slots': 2, 'allocation_end': 558}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 689, 'pair_origin': 753, 'address': 755, 'valid_luma_slots': 2, 'allocation_end': 935}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 445, 'pair_origin': 453, 'address': 459, 'valid_luma_slots': 2, 'allocation_end': 477})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 36, 'pair_origin': 36, 'address': 36, 'valid_luma_slots': 1, 'allocation_end': 44}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 4, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 35, 'row_origin': 106, 'pair_origin': 106, 'address': 108, 'valid_luma_slots': 2, 'allocation_end': 243}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 6, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 51, 'row_origin': 342, 'pair_origin': 374, 'address': 380, 'valid_luma_slots': 2, 'allocation_end': 543}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 505, 'pair_origin': 561, 'address': 565, 'valid_luma_slots': 2, 'allocation_end': 569}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'component': 1}, {'pairs': 10, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 83, 'row_origin': 700, 'pair_origin': 764, 'address': 766, 'valid_luma_slots': 2, 'allocation_end': 1029}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 456, 'pair_origin': 464, 'address': 470, 'valid_luma_slots': 2, 'allocation_end': 488})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 47, 'pair_origin': 47, 'address': 47, 'valid_luma_slots': 1, 'allocation_end': 55}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 133, 'pair_origin': 133, 'address': 135, 'valid_luma_slots': 2, 'allocation_end': 345}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 401, 'pair_origin': 433, 'address': 439, 'valid_luma_slots': 2, 'allocation_end': 693}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 516, 'pair_origin': 572, 'address': 576, 'valid_luma_slots': 2, 'allocation_end': 580}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 775, 'pair_origin': 839, 'address': 841, 'valid_luma_slots': 2, 'allocation_end': 1227}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 467, 'pair_origin': 475, 'address': 481, 'valid_luma_slots': 2, 'allocation_end': 499})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 1, 'pair_id': 0, 'luma_lane': 0, 'component_lane': 0, 'row_pitch': 11, 'row_origin': 58, 'pair_origin': 58, 'address': 58, 'valid_luma_slots': 1, 'allocation_end': 66}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 5, 'pair_id': 0, 'luma_lane': 2, 'component_lane': 1, 'row_pitch': 43, 'row_origin': 144, 'pair_origin': 144, 'address': 146, 'valid_luma_slots': 2, 'allocation_end': 399}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 7, 'pair_id': 4, 'luma_lane': 0, 'component_lane': 3, 'row_pitch': 59, 'row_origin': 412, 'pair_origin': 444, 'address': 450, 'valid_luma_slots': 2, 'allocation_end': 763}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'component': 0}, {'pairs': 8, 'pair_id': 7, 'luma_lane': 2, 'component_lane': 2, 'row_pitch': 67, 'row_origin': 527, 'pair_origin': 583, 'address': 587, 'valid_luma_slots': 2, 'allocation_end': 591}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'component': 1}, {'pairs': 11, 'pair_id': 8, 'luma_lane': 0, 'component_lane': 1, 'row_pitch': 91, 'row_origin': 786, 'pair_origin': 850, 'address': 852, 'valid_luma_slots': 2, 'allocation_end': 1329}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'component': 2}, {'pairs': 4, 'pair_id': 1, 'luma_lane': 2, 'component_lane': 3, 'row_pitch': 35, 'row_origin': 478, 'pair_origin': 486, 'address': 492, 'valid_luma_slots': 2, 'allocation_end': 510})]}
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 pair_origin.

A stipulated 4:2:2 image stores each pair as [Y0,U,Y1,V], with two bytes per component. Odd final pairs still reserve both luma slots. Three-byte row prefixes precede complete macropixels. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access