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

N = 1
observations = []
def solve(p):
    p = dict(p)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]//2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = 1-p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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 pixel_lane.

A toy 4-sample image stores samples in lane order [2,0,3,1]. Two adjacent pixels share a bank record with a three-byte bank tag; rows contain complete banks even for odd width. 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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*p["w"]+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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 bank_index.

A toy 4-sample image stores samples in lane order [2,0,3,1]. Two adjacent pixels share a bank record with a three-byte bank tag; rows contain complete banks even for odd width. 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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 4*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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 bank_pitch.

A toy 4-sample image stores samples in lane order [2,0,3,1]. Two adjacent pixels share a bank record with a three-byte bank tag; rows contain complete banks even for odd width. 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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*8*p["b"]
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*(bank_pitch+3)
    sample_slot = pixel_lane*4+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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 bank_start.

A toy 4-sample image stores samples in lane order [2,0,3,1]. Two adjacent pixels share a bank record with a three-byte bank tag; rows contain complete banks even for odd width. 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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = lane*2+pixel_lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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)
    bank_columns = (p["w"]+1)//2
    lane = [1,3,0,2][p["sample"]]
    pixel_lane = p["x"]%2
    bank_index = p["y"]*bank_columns+p["x"]//2
    bank_pitch = 8*p["b"]+3
    bank_start = p["base"]+bank_index*bank_pitch
    sample_slot = pixel_lane+lane
    address = bank_start+3+sample_slot*p["b"]
    valid_lanes = 4*min(2,p["w"]-2*(p["x"]//2))
    allocation_end = p["base"]+p["h"]*bank_columns*bank_pitch
    return {'bank_columns': bank_columns, 'lane': lane, 'pixel_lane': pixel_lane, 'bank_index': bank_index, 'bank_pitch': bank_pitch, 'bank_start': bank_start, 'sample_slot': sample_slot, 'address': address, 'valid_lanes': valid_lanes, '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, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 19, 'bank_start': 11, 'sample_slot': 1, 'address': 16, 'valid_lanes': 4, 'allocation_end': 30}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 3, 'lane': 3, 'pixel_lane': 1, 'bank_index': 6, 'bank_pitch': 19, 'bank_start': 125, 'sample_slot': 7, 'address': 142, 'valid_lanes': 8, 'allocation_end': 239}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'sample': 2}, {'bank_columns': 5, 'lane': 0, 'pixel_lane': 0, 'bank_index': 34, 'bank_pitch': 19, 'bank_start': 657, 'sample_slot': 0, 'address': 660, 'valid_lanes': 8, 'allocation_end': 771}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 19, 'bank_start': 1208, 'sample_slot': 6, 'address': 1223, 'valid_lanes': 8, 'allocation_end': 1227}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'sample': 0}, {'bank_columns': 9, 'lane': 1, 'pixel_lane': 0, 'bank_index': 80, 'bank_pitch': 19, 'bank_start': 1531, 'sample_slot': 1, 'address': 1536, 'valid_lanes': 8, 'allocation_end': 1721}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 19, 'bank_start': 942, 'sample_slot': 7, 'address': 959, 'valid_lanes': 8, 'allocation_end': 999})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 27, 'bank_start': 22, 'sample_slot': 1, 'address': 28, 'valid_lanes': 4, 'allocation_end': 49}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 27, 'bank_start': 238, 'sample_slot': 7, 'address': 262, 'valid_lanes': 8, 'allocation_end': 562}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 27, 'bank_start': 1102, 'sample_slot': 0, 'address': 1105, 'valid_lanes': 8, 'allocation_end': 1480}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 27, 'bank_start': 1723, 'sample_slot': 6, 'address': 1744, 'valid_lanes': 8, 'allocation_end': 1750}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 27, 'bank_start': 2398, 'sample_slot': 1, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 2992}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 27, 'bank_start': 1345, 'sample_slot': 7, 'address': 1369, 'valid_lanes': 8, 'allocation_end': 1426})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 35, 'bank_start': 33, 'sample_slot': 1, 'address': 40, 'valid_lanes': 4, 'allocation_end': 68}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 8, 'bank_pitch': 35, 'bank_start': 313, 'sample_slot': 7, 'address': 344, 'valid_lanes': 8, 'allocation_end': 873}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'sample': 2}, {'bank_columns': 6, 'lane': 0, 'pixel_lane': 0, 'bank_index': 40, 'bank_pitch': 35, 'bank_start': 1433, 'sample_slot': 0, 'address': 1436, 'valid_lanes': 8, 'allocation_end': 2133}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 35, 'bank_start': 2238, 'sample_slot': 6, 'address': 2265, 'valid_lanes': 8, 'allocation_end': 2273}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'sample': 0}, {'bank_columns': 10, 'lane': 1, 'pixel_lane': 0, 'bank_index': 88, 'bank_pitch': 35, 'bank_start': 3113, 'sample_slot': 1, 'address': 3120, 'valid_lanes': 8, 'allocation_end': 4233}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 35, 'bank_start': 1748, 'sample_slot': 7, 'address': 1779, 'valid_lanes': 8, 'allocation_end': 1853})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 43, 'bank_start': 44, 'sample_slot': 1, 'address': 52, 'valid_lanes': 4, 'allocation_end': 87}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 43, 'bank_start': 474, 'sample_slot': 7, 'address': 512, 'valid_lanes': 8, 'allocation_end': 1549}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 43, 'bank_start': 2022, 'sample_slot': 0, 'address': 2025, 'valid_lanes': 8, 'allocation_end': 3355}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 43, 'bank_start': 2753, 'sample_slot': 6, 'address': 2786, 'valid_lanes': 8, 'allocation_end': 2796}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 43, 'bank_start': 4172, 'sample_slot': 1, 'address': 4180, 'valid_lanes': 8, 'allocation_end': 6193}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 43, 'bank_start': 2151, 'sample_slot': 7, 'address': 2189, 'valid_lanes': 8, 'allocation_end': 2280})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 1, 'lane': 1, 'pixel_lane': 0, 'bank_index': 0, 'bank_pitch': 51, 'bank_start': 55, 'sample_slot': 1, 'address': 64, 'valid_lanes': 4, 'allocation_end': 106}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 5, 'lane': 3, 'pixel_lane': 1, 'bank_index': 10, 'bank_pitch': 51, 'bank_start': 565, 'sample_slot': 7, 'address': 610, 'valid_lanes': 8, 'allocation_end': 2095}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'sample': 2}, {'bank_columns': 7, 'lane': 0, 'pixel_lane': 0, 'bank_index': 46, 'bank_pitch': 51, 'bank_start': 2401, 'sample_slot': 0, 'address': 2404, 'valid_lanes': 8, 'allocation_end': 4339}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'sample': 3}, {'bank_columns': 8, 'lane': 2, 'pixel_lane': 1, 'bank_index': 63, 'bank_pitch': 51, 'bank_start': 3268, 'sample_slot': 6, 'address': 3307, 'valid_lanes': 8, 'allocation_end': 3319}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'sample': 0}, {'bank_columns': 11, 'lane': 1, 'pixel_lane': 0, 'bank_index': 96, 'bank_pitch': 51, 'bank_start': 4951, 'sample_slot': 1, 'address': 4960, 'valid_lanes': 8, 'allocation_end': 7909}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'sample': 1}, {'bank_columns': 4, 'lane': 3, 'pixel_lane': 1, 'bank_index': 49, 'bank_pitch': 51, 'bank_start': 2554, 'sample_slot': 7, 'address': 2599, 'valid_lanes': 8, 'allocation_end': 2707})]}
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 sample_slot.

A toy 4-sample image stores samples in lane order [2,0,3,1]. Two adjacent pixels share a bank record with a three-byte bank tag; rows contain complete banks even for odd width. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.

split: open-access