FA-52686 / Raster memory layout / Open access
Xor Bank Swizzle: Banked sample points at tag or assumes bank-interleaved storage · case 01
The returned physical layout descriptor disagrees with the declared buffer mapping at address.
ROOT CAUSE
Banked sample points at tag or assumes bank-interleaved storage The faulty expression is tile_origin+bank*bank_pitch+bank_local*p["b"].
VERIFIED REPAIR
Apply the stipulated layout rule at address: tile_origin+bank*bank_pitch+1+bank_local*p["b"].
Unsuccessful approach: The attempted repair uses tile_origin+bank_local*4*p["b"]+bank*p["b"]+1 and still violates the layout contract.
Case contract
A stipulated 8x4 tile has four banks. Bank = (local x modulo 4) XOR (local y modulo 4); each bank stores two columns per row and begins with a one-byte tag. Tile rows include a seven-byte trailer. 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)
tile_columns = (p["w"]+7)//8
tile_x = p["x"]//8
tile_y = p["y"]//4
bank = (p["x"]%4)^(p["y"]%4)
bank_local = (p["y"]%4)*2+(p["x"]%8)//4
bank_pitch = 8*p["b"]+1
tile_pitch = 4*bank_pitch
tile_row_pitch = tile_columns*tile_pitch+7
tile_origin = p["base"]+tile_y*tile_row_pitch+tile_x*tile_pitch
address = tile_origin+bank*bank_pitch+bank_local*p["b"]
return {'tile_columns': tile_columns, 'tile_x': tile_x, 'tile_y': tile_y, 'bank': bank, 'bank_local': bank_local, 'bank_pitch': bank_pitch, 'tile_pitch': tile_pitch, 'tile_row_pitch': tile_row_pitch, 'tile_origin': tile_origin, 'address': address}
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}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 12}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 71}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 265}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 237}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_origin': 569, 'address': 570}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 236, 'address': 288})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 23}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 110}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 392}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 351}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 307, 'tile_origin': 836, 'address': 837}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 343, 'address': 419})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 34}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 149}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 519}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 465}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 403, 'tile_origin': 1103, 'address': 1104}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 450, 'address': 550})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 44, 'address': 45}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 44, 'address': 188}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 646}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 579}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 499, 'tile_origin': 1370, 'address': 1371}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 557, 'address': 681})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 55, 'address': 56}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 55, 'address': 227}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 773}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 693}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 595, 'tile_origin': 1637, 'address': 1638}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 664, 'address': 812})]}
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': 11, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 12, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Failed |
| layout fixture 2 | {'address': 70, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 71, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Failed |
| layout fixture 3 | {'address': 264, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 265, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Failed |
| layout fixture 4 | {'address': 236, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 237, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Failed |
| layout fixture 5 | {'address': 569, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | {'address': 570, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | Failed |
| layout fixture 6 | {'address': 287, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | {'address': 288, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | Failed |
SHA-256 / 413735f1d4f6b6646dd8a3d9a2795aff370fab3634646324558c277320a04625
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)
tile_columns = (p["w"]+7)//8
tile_x = p["x"]//8
tile_y = p["y"]//4
bank = (p["x"]%4)^(p["y"]%4)
bank_local = (p["y"]%4)*2+(p["x"]%8)//4
bank_pitch = 8*p["b"]+1
tile_pitch = 4*bank_pitch
tile_row_pitch = tile_columns*tile_pitch+7
tile_origin = p["base"]+tile_y*tile_row_pitch+tile_x*tile_pitch
address = tile_origin+bank_local*4*p["b"]+bank*p["b"]+1
return {'tile_columns': tile_columns, 'tile_x': tile_x, 'tile_y': tile_y, 'bank': bank, 'bank_local': bank_local, 'bank_pitch': bank_pitch, 'tile_pitch': tile_pitch, 'tile_row_pitch': tile_row_pitch, 'tile_origin': tile_origin, 'address': address}
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}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 12}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 71}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 265}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 237}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_origin': 569, 'address': 570}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 236, 'address': 288})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 23}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 110}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 392}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 351}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 307, 'tile_origin': 836, 'address': 837}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 343, 'address': 419})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 34}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 149}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 519}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 465}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 403, 'tile_origin': 1103, 'address': 1104}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 450, 'address': 550})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 44, 'address': 45}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 44, 'address': 188}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 646}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 579}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 499, 'tile_origin': 1370, 'address': 1371}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 557, 'address': 681})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 55, 'address': 56}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 55, 'address': 227}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 773}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 693}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 595, 'tile_origin': 1637, 'address': 1638}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 664, 'address': 812})]}
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': 12, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 12, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Passed |
| layout fixture 2 | {'address': 50, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 71, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Failed |
| layout fixture 3 | {'address': 259, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 265, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Failed |
| layout fixture 4 | {'address': 279, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 237, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Failed |
| layout fixture 5 | {'address': 570, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | {'address': 570, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | Passed |
| layout fixture 6 | {'address': 243, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | {'address': 288, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | Failed |
SHA-256 / 9fc2bd46e89306212965a2962955d07b7806fdd3d80bd1d55ebf26bb9b6726a0
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)
tile_columns = (p["w"]+7)//8
tile_x = p["x"]//8
tile_y = p["y"]//4
bank = (p["x"]%4)^(p["y"]%4)
bank_local = (p["y"]%4)*2+(p["x"]%8)//4
bank_pitch = 8*p["b"]+1
tile_pitch = 4*bank_pitch
tile_row_pitch = tile_columns*tile_pitch+7
tile_origin = p["base"]+tile_y*tile_row_pitch+tile_x*tile_pitch
address = tile_origin+bank*bank_pitch+1+bank_local*p["b"]
return {'tile_columns': tile_columns, 'tile_x': tile_x, 'tile_y': tile_y, 'bank': bank, 'bank_local': bank_local, 'bank_pitch': bank_pitch, 'tile_pitch': tile_pitch, 'tile_row_pitch': tile_row_pitch, 'tile_origin': tile_origin, 'address': address}
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}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 12}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 11, 'address': 71}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 265}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_origin': 222, 'address': 237}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_origin': 569, 'address': 570}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_origin': 236, 'address': 288})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 23}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 22, 'address': 110}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 392}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 207, 'tile_origin': 329, 'address': 351}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 307, 'tile_origin': 836, 'address': 837}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 25, 'tile_pitch': 100, 'tile_row_pitch': 107, 'tile_origin': 343, 'address': 419})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 34}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 33, 'address': 149}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 519}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 271, 'tile_origin': 436, 'address': 465}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 403, 'tile_origin': 1103, 'address': 1104}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 33, 'tile_pitch': 132, 'tile_row_pitch': 139, 'tile_origin': 450, 'address': 550})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 44, 'address': 45}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 44, 'address': 188}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 646}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 335, 'tile_origin': 543, 'address': 579}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 499, 'tile_origin': 1370, 'address': 1371}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 41, 'tile_pitch': 164, 'tile_row_pitch': 171, 'tile_origin': 557, 'address': 681})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 0, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 55, 'address': 56}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 0, 'tile_y': 0, 'bank': 3, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 55, 'address': 227}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 2, 'bank_local': 4, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 773}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55}, {'tile_columns': 2, 'tile_x': 1, 'tile_y': 1, 'bank': 0, 'bank_local': 7, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 399, 'tile_origin': 650, 'address': 693}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55}, {'tile_columns': 3, 'tile_x': 2, 'tile_y': 2, 'bank': 0, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 595, 'tile_origin': 1637, 'address': 1638}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55}, {'tile_columns': 1, 'tile_x': 0, 'tile_y': 3, 'bank': 3, 'bank_local': 0, 'bank_pitch': 49, 'tile_pitch': 196, 'tile_row_pitch': 203, 'tile_origin': 664, 'address': 812})]}
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': 12, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 12, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Passed |
| layout fixture 2 | {'address': 71, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | {'address': 71, 'bank': 3, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 11, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 0} | Passed |
| layout fixture 3 | {'address': 265, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 265, 'bank': 2, 'bank_local': 4, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Passed |
| layout fixture 4 | {'address': 237, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | {'address': 237, 'bank': 0, 'bank_local': 7, 'bank_pitch': 17, 'tile_columns': 2, 'tile_origin': 222, 'tile_pitch': 68, 'tile_row_pitch': 143, 'tile_x': 1, 'tile_y': 1} | Passed |
| layout fixture 5 | {'address': 570, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | {'address': 570, 'bank': 0, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 3, 'tile_origin': 569, 'tile_pitch': 68, 'tile_row_pitch': 211, 'tile_x': 2, 'tile_y': 2} | Passed |
| layout fixture 6 | {'address': 288, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | {'address': 288, 'bank': 3, 'bank_local': 0, 'bank_pitch': 17, 'tile_columns': 1, 'tile_origin': 236, 'tile_pitch': 68, 'tile_row_pitch': 75, 'tile_x': 0, 'tile_y': 3} | Passed |
SHA-256 / 36d2b11d5a00ee8f888faeefe0d55663dfaa2ffc3b764dd1c104dc3dc24c1c3f
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:31.509153+00:00.
Case digest / 021979d1643dfb15062f35750b99897743232ccb32b3809082034c5838a30c1b