FA-52821 / Raster memory layout / Open access
Chunked Row Groups: Group start omits intervening headers or directory prefix · case 01
The returned physical layout descriptor disagrees with the declared buffer mapping at group_origin.
ROOT CAUSE
Group start omits intervening headers or directory prefix The faulty expression is p["base"]+directory_bytes+group_id*(3*row_span).
VERIFIED REPAIR
Apply the stipulated layout rule at group_origin: p["base"]+directory_bytes+group_id*(5+3*row_span).
Unsuccessful approach: The attempted repair uses p["base"]+group_id*(5+3*row_span) and still violates the layout contract.
Case contract
Rows are grouped in packets of three scanlines. Each group has a five-byte header and every full allocated row has a two-byte checksum. Last group stores only actual rows, with a seven-byte directory record per group. Return the named intermediate layout descriptor and final address fields; all quantities are integer byte offsets unless explicitly stated.
Why this case matters
Offline raster resource, upload, readback, and storage-layout regression model.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(p):
p = dict(p)
group_count = (p["h"]+2)//3
group_id = p["y"]//3
group_row = p["y"]%3
row_span = p["w"]*p["b"]+2
directory_bytes = group_count*7
group_sizes = [5+min(3,p["h"]-i*3)*row_span for i in range(group_count)]
group_origin = p["base"]+directory_bytes+group_id*(3*row_span)
address = group_origin+5+group_row*row_span+p["x"]*p["b"]
checksum = group_origin+5+group_row*row_span+p["w"]*p["b"]
allocation_end = p["base"]+directory_bytes+sum(group_sizes)
return {'group_count': group_count, 'group_id': group_id, 'group_row': group_row, 'row_span': row_span, 'directory_bytes': directory_bytes, 'group_sizes': group_sizes, 'group_origin': group_origin, 'address': address, 'checksum': checksum, '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}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 4, 'directory_bytes': 7, 'group_sizes': [9], 'group_origin': 18, 'address': 23, 'checksum': 25, 'allocation_end': 27}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 14, 'directory_bytes': 14, 'group_sizes': [47, 19], 'group_origin': 25, 'address': 60, 'checksum': 70, 'allocation_end': 91}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 22, 'directory_bytes': 21, 'group_sizes': [71, 71, 49], 'group_origin': 174, 'address': 195, 'checksum': 199, 'allocation_end': 223}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 34, 'directory_bytes': 21, 'group_sizes': [107, 107, 73], 'group_origin': 246, 'address': 315, 'checksum': 317, 'allocation_end': 319}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 38, 'directory_bytes': 28, 'group_sizes': [119, 119, 119, 43], 'group_origin': 277, 'address': 390, 'checksum': 394, 'allocation_end': 439}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 16, 'directory_bytes': 35, 'group_sizes': [53, 53, 53, 53, 21], 'group_origin': 258, 'address': 269, 'checksum': 277, 'allocation_end': 279})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 5, 'directory_bytes': 7, 'group_sizes': [10], 'group_origin': 29, 'address': 34, 'checksum': 37, 'allocation_end': 39}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 23, 'directory_bytes': 14, 'group_sizes': [74, 51], 'group_origin': 36, 'address': 90, 'checksum': 108, 'allocation_end': 161}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 35, 'directory_bytes': 21, 'group_sizes': [110, 110, 110], 'group_origin': 263, 'address': 292, 'checksum': 301, 'allocation_end': 373}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 50, 'directory_bytes': 21, 'group_sizes': [155, 155, 105], 'group_origin': 353, 'address': 453, 'checksum': 456, 'allocation_end': 458}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 59, 'directory_bytes': 28, 'group_sizes': [182, 182, 182, 123], 'group_origin': 414, 'address': 585, 'checksum': 594, 'allocation_end': 719}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 23, 'directory_bytes': 35, 'group_sizes': [74, 74, 74, 74, 28], 'group_origin': 353, 'address': 367, 'checksum': 379, 'allocation_end': 381})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 6, 'directory_bytes': 7, 'group_sizes': [11], 'group_origin': 40, 'address': 45, 'checksum': 49, 'allocation_end': 51}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 34, 'directory_bytes': 14, 'group_sizes': [107, 107], 'group_origin': 47, 'address': 124, 'checksum': 152, 'allocation_end': 261}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 50, 'directory_bytes': 28, 'group_sizes': [155, 155, 155, 55], 'group_origin': 371, 'address': 408, 'checksum': 424, 'allocation_end': 581}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 66, 'directory_bytes': 21, 'group_sizes': [203, 203, 137], 'group_origin': 460, 'address': 591, 'checksum': 595, 'allocation_end': 597}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 82, 'directory_bytes': 28, 'group_sizes': [251, 251, 251, 251], 'group_origin': 563, 'address': 796, 'checksum': 812, 'allocation_end': 1065}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 30, 'directory_bytes': 35, 'group_sizes': [95, 95, 95, 95, 35], 'group_origin': 448, 'address': 465, 'checksum': 481, 'allocation_end': 483})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 7, 'directory_bytes': 7, 'group_sizes': [12], 'group_origin': 51, 'address': 56, 'checksum': 61, 'allocation_end': 63}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 47, 'directory_bytes': 21, 'group_sizes': [146, 146, 52], 'group_origin': 65, 'address': 169, 'checksum': 209, 'allocation_end': 409}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 67, 'directory_bytes': 28, 'group_sizes': [206, 206, 206, 139], 'group_origin': 484, 'address': 529, 'checksum': 554, 'allocation_end': 829}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 82, 'directory_bytes': 21, 'group_sizes': [251, 251, 169], 'group_origin': 567, 'address': 729, 'checksum': 734, 'allocation_end': 736}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 107, 'directory_bytes': 35, 'group_sizes': [326, 326, 326, 326, 112], 'group_origin': 731, 'address': 1030, 'checksum': 1055, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 37, 'directory_bytes': 35, 'group_sizes': [116, 116, 116, 116, 42], 'group_origin': 543, 'address': 563, 'checksum': 583, 'allocation_end': 585})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 8, 'directory_bytes': 7, 'group_sizes': [13], 'group_origin': 62, 'address': 67, 'checksum': 73, 'allocation_end': 75}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 62, 'directory_bytes': 21, 'group_sizes': [191, 191, 129], 'group_origin': 76, 'address': 211, 'checksum': 265, 'allocation_end': 587}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 86, 'directory_bytes': 28, 'group_sizes': [263, 263, 263, 263], 'group_origin': 609, 'address': 662, 'checksum': 698, 'allocation_end': 1135}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 98, 'directory_bytes': 21, 'group_sizes': [299, 299, 201], 'group_origin': 674, 'address': 867, 'checksum': 873, 'allocation_end': 875}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 134, 'directory_bytes': 35, 'group_sizes': [407, 407, 407, 407, 273], 'group_origin': 904, 'address': 1273, 'checksum': 1309, 'allocation_end': 1991}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 44, 'directory_bytes': 35, 'group_sizes': [137, 137, 137, 137, 49], 'group_origin': 638, 'address': 661, 'checksum': 685, 'allocation_end': 687})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| layout fixture 1 | {'address': 23, 'allocation_end': 27, 'checksum': 25, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 18, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | {'address': 23, 'allocation_end': 27, 'checksum': 25, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 18, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | Passed |
| layout fixture 2 | {'address': 60, 'allocation_end': 91, 'checksum': 70, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 25, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | {'address': 60, 'allocation_end': 91, 'checksum': 70, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 25, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | Passed |
| layout fixture 3 | {'address': 185, 'allocation_end': 223, 'checksum': 189, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 164, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | {'address': 195, 'allocation_end': 223, 'checksum': 199, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 174, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | Failed |
| layout fixture 4 | {'address': 305, 'allocation_end': 319, 'checksum': 307, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 236, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | {'address': 315, 'allocation_end': 319, 'checksum': 317, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 246, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | Failed |
| layout fixture 5 | {'address': 380, 'allocation_end': 439, 'checksum': 384, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 267, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | {'address': 390, 'allocation_end': 439, 'checksum': 394, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 277, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | Failed |
| layout fixture 6 | {'address': 249, 'allocation_end': 279, 'checksum': 257, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 238, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | {'address': 269, 'allocation_end': 279, 'checksum': 277, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 258, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | Failed |
SHA-256 / 26743a27c245c351e8ddc79183ede0eeadf83701f8886bdc5da0e787149e0629
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(p):
p = dict(p)
group_count = (p["h"]+2)//3
group_id = p["y"]//3
group_row = p["y"]%3
row_span = p["w"]*p["b"]+2
directory_bytes = group_count*7
group_sizes = [5+min(3,p["h"]-i*3)*row_span for i in range(group_count)]
group_origin = p["base"]+group_id*(5+3*row_span)
address = group_origin+5+group_row*row_span+p["x"]*p["b"]
checksum = group_origin+5+group_row*row_span+p["w"]*p["b"]
allocation_end = p["base"]+directory_bytes+sum(group_sizes)
return {'group_count': group_count, 'group_id': group_id, 'group_row': group_row, 'row_span': row_span, 'directory_bytes': directory_bytes, 'group_sizes': group_sizes, 'group_origin': group_origin, 'address': address, 'checksum': checksum, '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}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 4, 'directory_bytes': 7, 'group_sizes': [9], 'group_origin': 18, 'address': 23, 'checksum': 25, 'allocation_end': 27}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 14, 'directory_bytes': 14, 'group_sizes': [47, 19], 'group_origin': 25, 'address': 60, 'checksum': 70, 'allocation_end': 91}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 22, 'directory_bytes': 21, 'group_sizes': [71, 71, 49], 'group_origin': 174, 'address': 195, 'checksum': 199, 'allocation_end': 223}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 34, 'directory_bytes': 21, 'group_sizes': [107, 107, 73], 'group_origin': 246, 'address': 315, 'checksum': 317, 'allocation_end': 319}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 38, 'directory_bytes': 28, 'group_sizes': [119, 119, 119, 43], 'group_origin': 277, 'address': 390, 'checksum': 394, 'allocation_end': 439}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 16, 'directory_bytes': 35, 'group_sizes': [53, 53, 53, 53, 21], 'group_origin': 258, 'address': 269, 'checksum': 277, 'allocation_end': 279})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 5, 'directory_bytes': 7, 'group_sizes': [10], 'group_origin': 29, 'address': 34, 'checksum': 37, 'allocation_end': 39}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 23, 'directory_bytes': 14, 'group_sizes': [74, 51], 'group_origin': 36, 'address': 90, 'checksum': 108, 'allocation_end': 161}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 35, 'directory_bytes': 21, 'group_sizes': [110, 110, 110], 'group_origin': 263, 'address': 292, 'checksum': 301, 'allocation_end': 373}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 50, 'directory_bytes': 21, 'group_sizes': [155, 155, 105], 'group_origin': 353, 'address': 453, 'checksum': 456, 'allocation_end': 458}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 59, 'directory_bytes': 28, 'group_sizes': [182, 182, 182, 123], 'group_origin': 414, 'address': 585, 'checksum': 594, 'allocation_end': 719}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 23, 'directory_bytes': 35, 'group_sizes': [74, 74, 74, 74, 28], 'group_origin': 353, 'address': 367, 'checksum': 379, 'allocation_end': 381})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 6, 'directory_bytes': 7, 'group_sizes': [11], 'group_origin': 40, 'address': 45, 'checksum': 49, 'allocation_end': 51}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 34, 'directory_bytes': 14, 'group_sizes': [107, 107], 'group_origin': 47, 'address': 124, 'checksum': 152, 'allocation_end': 261}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 50, 'directory_bytes': 28, 'group_sizes': [155, 155, 155, 55], 'group_origin': 371, 'address': 408, 'checksum': 424, 'allocation_end': 581}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 66, 'directory_bytes': 21, 'group_sizes': [203, 203, 137], 'group_origin': 460, 'address': 591, 'checksum': 595, 'allocation_end': 597}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 82, 'directory_bytes': 28, 'group_sizes': [251, 251, 251, 251], 'group_origin': 563, 'address': 796, 'checksum': 812, 'allocation_end': 1065}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 30, 'directory_bytes': 35, 'group_sizes': [95, 95, 95, 95, 35], 'group_origin': 448, 'address': 465, 'checksum': 481, 'allocation_end': 483})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 7, 'directory_bytes': 7, 'group_sizes': [12], 'group_origin': 51, 'address': 56, 'checksum': 61, 'allocation_end': 63}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 47, 'directory_bytes': 21, 'group_sizes': [146, 146, 52], 'group_origin': 65, 'address': 169, 'checksum': 209, 'allocation_end': 409}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 67, 'directory_bytes': 28, 'group_sizes': [206, 206, 206, 139], 'group_origin': 484, 'address': 529, 'checksum': 554, 'allocation_end': 829}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 82, 'directory_bytes': 21, 'group_sizes': [251, 251, 169], 'group_origin': 567, 'address': 729, 'checksum': 734, 'allocation_end': 736}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 107, 'directory_bytes': 35, 'group_sizes': [326, 326, 326, 326, 112], 'group_origin': 731, 'address': 1030, 'checksum': 1055, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 37, 'directory_bytes': 35, 'group_sizes': [116, 116, 116, 116, 42], 'group_origin': 543, 'address': 563, 'checksum': 583, 'allocation_end': 585})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 8, 'directory_bytes': 7, 'group_sizes': [13], 'group_origin': 62, 'address': 67, 'checksum': 73, 'allocation_end': 75}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 62, 'directory_bytes': 21, 'group_sizes': [191, 191, 129], 'group_origin': 76, 'address': 211, 'checksum': 265, 'allocation_end': 587}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 86, 'directory_bytes': 28, 'group_sizes': [263, 263, 263, 263], 'group_origin': 609, 'address': 662, 'checksum': 698, 'allocation_end': 1135}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 98, 'directory_bytes': 21, 'group_sizes': [299, 299, 201], 'group_origin': 674, 'address': 867, 'checksum': 873, 'allocation_end': 875}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 134, 'directory_bytes': 35, 'group_sizes': [407, 407, 407, 407, 273], 'group_origin': 904, 'address': 1273, 'checksum': 1309, 'allocation_end': 1991}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 44, 'directory_bytes': 35, 'group_sizes': [137, 137, 137, 137, 49], 'group_origin': 638, 'address': 661, 'checksum': 685, 'allocation_end': 687})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| layout fixture 1 | {'address': 16, 'allocation_end': 27, 'checksum': 18, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 11, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | {'address': 23, 'allocation_end': 27, 'checksum': 25, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 18, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | Failed |
| layout fixture 2 | {'address': 46, 'allocation_end': 91, 'checksum': 56, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 11, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | {'address': 60, 'allocation_end': 91, 'checksum': 70, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 25, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | Failed |
| layout fixture 3 | {'address': 174, 'allocation_end': 223, 'checksum': 178, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 153, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | {'address': 195, 'allocation_end': 223, 'checksum': 199, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 174, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | Failed |
| layout fixture 4 | {'address': 294, 'allocation_end': 319, 'checksum': 296, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 225, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | {'address': 315, 'allocation_end': 319, 'checksum': 317, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 246, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | Failed |
| layout fixture 5 | {'address': 362, 'allocation_end': 439, 'checksum': 366, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 249, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | {'address': 390, 'allocation_end': 439, 'checksum': 394, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 277, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | Failed |
| layout fixture 6 | {'address': 234, 'allocation_end': 279, 'checksum': 242, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 223, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | {'address': 269, 'allocation_end': 279, 'checksum': 277, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 258, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | Failed |
SHA-256 / 238ff5fda3a610065aa192b6e1686f4002e71d105567ba0165712d30dda5ef65
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(p):
p = dict(p)
group_count = (p["h"]+2)//3
group_id = p["y"]//3
group_row = p["y"]%3
row_span = p["w"]*p["b"]+2
directory_bytes = group_count*7
group_sizes = [5+min(3,p["h"]-i*3)*row_span for i in range(group_count)]
group_origin = p["base"]+directory_bytes+group_id*(5+3*row_span)
address = group_origin+5+group_row*row_span+p["x"]*p["b"]
checksum = group_origin+5+group_row*row_span+p["w"]*p["b"]
allocation_end = p["base"]+directory_bytes+sum(group_sizes)
return {'group_count': group_count, 'group_id': group_id, 'group_row': group_row, 'row_span': row_span, 'directory_bytes': directory_bytes, 'group_sizes': group_sizes, 'group_origin': group_origin, 'address': address, 'checksum': checksum, '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}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 4, 'directory_bytes': 7, 'group_sizes': [9], 'group_origin': 18, 'address': 23, 'checksum': 25, 'allocation_end': 27}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 14, 'directory_bytes': 14, 'group_sizes': [47, 19], 'group_origin': 25, 'address': 60, 'checksum': 70, 'allocation_end': 91}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 22, 'directory_bytes': 21, 'group_sizes': [71, 71, 49], 'group_origin': 174, 'address': 195, 'checksum': 199, 'allocation_end': 223}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 34, 'directory_bytes': 21, 'group_sizes': [107, 107, 73], 'group_origin': 246, 'address': 315, 'checksum': 317, 'allocation_end': 319}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 38, 'directory_bytes': 28, 'group_sizes': [119, 119, 119, 43], 'group_origin': 277, 'address': 390, 'checksum': 394, 'allocation_end': 439}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 16, 'directory_bytes': 35, 'group_sizes': [53, 53, 53, 53, 21], 'group_origin': 258, 'address': 269, 'checksum': 277, 'allocation_end': 279})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 5, 'directory_bytes': 7, 'group_sizes': [10], 'group_origin': 29, 'address': 34, 'checksum': 37, 'allocation_end': 39}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 23, 'directory_bytes': 14, 'group_sizes': [74, 51], 'group_origin': 36, 'address': 90, 'checksum': 108, 'allocation_end': 161}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 0, 'row_span': 35, 'directory_bytes': 21, 'group_sizes': [110, 110, 110], 'group_origin': 263, 'address': 292, 'checksum': 301, 'allocation_end': 373}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 50, 'directory_bytes': 21, 'group_sizes': [155, 155, 105], 'group_origin': 353, 'address': 453, 'checksum': 456, 'allocation_end': 458}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 59, 'directory_bytes': 28, 'group_sizes': [182, 182, 182, 123], 'group_origin': 414, 'address': 585, 'checksum': 594, 'allocation_end': 719}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 23, 'directory_bytes': 35, 'group_sizes': [74, 74, 74, 74, 28], 'group_origin': 353, 'address': 367, 'checksum': 379, 'allocation_end': 381})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 6, 'directory_bytes': 7, 'group_sizes': [11], 'group_origin': 40, 'address': 45, 'checksum': 49, 'allocation_end': 51}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'group_count': 2, 'group_id': 0, 'group_row': 2, 'row_span': 34, 'directory_bytes': 14, 'group_sizes': [107, 107], 'group_origin': 47, 'address': 124, 'checksum': 152, 'allocation_end': 261}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 50, 'directory_bytes': 28, 'group_sizes': [155, 155, 155, 55], 'group_origin': 371, 'address': 408, 'checksum': 424, 'allocation_end': 581}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 66, 'directory_bytes': 21, 'group_sizes': [203, 203, 137], 'group_origin': 460, 'address': 591, 'checksum': 595, 'allocation_end': 597}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'group_count': 4, 'group_id': 2, 'group_row': 2, 'row_span': 82, 'directory_bytes': 28, 'group_sizes': [251, 251, 251, 251], 'group_origin': 563, 'address': 796, 'checksum': 812, 'allocation_end': 1065}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 30, 'directory_bytes': 35, 'group_sizes': [95, 95, 95, 95, 35], 'group_origin': 448, 'address': 465, 'checksum': 481, 'allocation_end': 483})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 7, 'directory_bytes': 7, 'group_sizes': [12], 'group_origin': 51, 'address': 56, 'checksum': 61, 'allocation_end': 63}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 47, 'directory_bytes': 21, 'group_sizes': [146, 146, 52], 'group_origin': 65, 'address': 169, 'checksum': 209, 'allocation_end': 409}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 67, 'directory_bytes': 28, 'group_sizes': [206, 206, 206, 139], 'group_origin': 484, 'address': 529, 'checksum': 554, 'allocation_end': 829}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 82, 'directory_bytes': 21, 'group_sizes': [251, 251, 169], 'group_origin': 567, 'address': 729, 'checksum': 734, 'allocation_end': 736}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 107, 'directory_bytes': 35, 'group_sizes': [326, 326, 326, 326, 112], 'group_origin': 731, 'address': 1030, 'checksum': 1055, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 37, 'directory_bytes': 35, 'group_sizes': [116, 116, 116, 116, 42], 'group_origin': 543, 'address': 563, 'checksum': 583, 'allocation_end': 585})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'group_count': 1, 'group_id': 0, 'group_row': 0, 'row_span': 8, 'directory_bytes': 7, 'group_sizes': [13], 'group_origin': 62, 'address': 67, 'checksum': 73, 'allocation_end': 75}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 0, 'group_row': 2, 'row_span': 62, 'directory_bytes': 21, 'group_sizes': [191, 191, 129], 'group_origin': 76, 'address': 211, 'checksum': 265, 'allocation_end': 587}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'group_count': 4, 'group_id': 2, 'group_row': 0, 'row_span': 86, 'directory_bytes': 28, 'group_sizes': [263, 263, 263, 263], 'group_origin': 609, 'address': 662, 'checksum': 698, 'allocation_end': 1135}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'group_count': 3, 'group_id': 2, 'group_row': 1, 'row_span': 98, 'directory_bytes': 21, 'group_sizes': [299, 299, 201], 'group_origin': 674, 'address': 867, 'checksum': 873, 'allocation_end': 875}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 2, 'group_row': 2, 'row_span': 134, 'directory_bytes': 35, 'group_sizes': [407, 407, 407, 407, 273], 'group_origin': 904, 'address': 1273, 'checksum': 1309, 'allocation_end': 1991}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'group_count': 5, 'group_id': 4, 'group_row': 0, 'row_span': 44, 'directory_bytes': 35, 'group_sizes': [137, 137, 137, 137, 49], 'group_origin': 638, 'address': 661, 'checksum': 685, 'allocation_end': 687})]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| layout fixture 1 | {'address': 23, 'allocation_end': 27, 'checksum': 25, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 18, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | {'address': 23, 'allocation_end': 27, 'checksum': 25, 'directory_bytes': 7, 'group_count': 1, 'group_id': 0, 'group_origin': 18, 'group_row': 0, 'group_sizes': [9], 'row_span': 4} | Passed |
| layout fixture 2 | {'address': 60, 'allocation_end': 91, 'checksum': 70, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 25, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | {'address': 60, 'allocation_end': 91, 'checksum': 70, 'directory_bytes': 14, 'group_count': 2, 'group_id': 0, 'group_origin': 25, 'group_row': 2, 'group_sizes': [47, 19], 'row_span': 14} | Passed |
| layout fixture 3 | {'address': 195, 'allocation_end': 223, 'checksum': 199, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 174, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | {'address': 195, 'allocation_end': 223, 'checksum': 199, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 174, 'group_row': 0, 'group_sizes': [71, 71, 49], 'row_span': 22} | Passed |
| layout fixture 4 | {'address': 315, 'allocation_end': 319, 'checksum': 317, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 246, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | {'address': 315, 'allocation_end': 319, 'checksum': 317, 'directory_bytes': 21, 'group_count': 3, 'group_id': 2, 'group_origin': 246, 'group_row': 1, 'group_sizes': [107, 107, 73], 'row_span': 34} | Passed |
| layout fixture 5 | {'address': 390, 'allocation_end': 439, 'checksum': 394, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 277, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | {'address': 390, 'allocation_end': 439, 'checksum': 394, 'directory_bytes': 28, 'group_count': 4, 'group_id': 2, 'group_origin': 277, 'group_row': 2, 'group_sizes': [119, 119, 119, 43], 'row_span': 38} | Passed |
| layout fixture 6 | {'address': 269, 'allocation_end': 279, 'checksum': 277, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 258, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | {'address': 269, 'allocation_end': 279, 'checksum': 277, 'directory_bytes': 35, 'group_count': 5, 'group_id': 4, 'group_origin': 258, 'group_row': 0, 'group_sizes': [53, 53, 53, 53, 21], 'row_span': 16} | Passed |
SHA-256 / c8aab124efa02febec091752c5872362a2ccb2faa84a9e2944b4b78a4656c9ce
Verification & scope
Stipulated deterministic toy buffer layout; not a graphics API, codec, GPU vendor tiling specification, or hardware-conformance claim. Inputs satisfy the dimensions and bounds stated by the model. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:45:32.888227+00:00.
Case digest / b7ca2cb5529661aa57ef58183e7363aa51c11edf7718275108dfc82fe567f657