FA-52896 / Raster memory layout / Open access
Capture Ring Frame Slots: Capture slot pitch excludes fence or generation header · case 01
The returned physical layout descriptor disagrees with the declared buffer mapping at slot_pitch.
ROOT CAUSE
Capture slot pitch excludes fence or generation header The faulty expression is 8+payload_bytes.
VERIFIED REPAIR
Apply the stipulated layout rule at slot_pitch: 8+payload_bytes+3.
Unsuccessful approach: The attempted repair uses payload_bytes+3 and still violates the layout contract.
Case contract
A capture ring holds four frame slots, each with an eight-byte generation header and image payload followed by a three-byte fence word. Frame generation maps monotonically to slot modulo capacity; byte addresses use slot, freshness uses full generation. 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)
payload_bytes = p["w"]*p["h"]*p["b"]
slot_pitch = 8+payload_bytes
write_slot = p["generation"]%p["capacity"]
read_slot = p["requested"]%p["capacity"]
write_header = p["base"]+write_slot*slot_pitch
read_header = p["base"]+read_slot*slot_pitch
fresh = p["stored"][read_slot%4]==p["requested"]
read_address = read_header+8+(p["y"]*p["w"]+p["x"])*p["b"]
fence_address = write_header+8+payload_bytes
allocation_end = p["base"]+p["capacity"]*slot_pitch
return {'payload_bytes': payload_bytes, 'slot_pitch': slot_pitch, 'write_slot': write_slot, 'read_slot': read_slot, 'write_header': write_header, 'read_header': read_header, 'fresh': fresh, 'read_address': read_address, 'fence_address': fence_address, '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, 'generation': 4, 'requested': 3, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 2, 'slot_pitch': 13, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 50, 'fresh': False, 'read_address': 58, 'fence_address': 21, 'allocation_end': 63}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'generation': 5, 'requested': 4, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 48, 'slot_pitch': 59, 'write_slot': 1, 'read_slot': 0, 'write_header': 70, 'read_header': 11, 'fresh': True, 'read_address': 45, 'fence_address': 126, 'allocation_end': 247}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'generation': 6, 'requested': 5, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 160, 'slot_pitch': 171, 'write_slot': 2, 'read_slot': 1, 'write_header': 353, 'read_header': 182, 'fresh': True, 'read_address': 326, 'fence_address': 521, 'allocation_end': 695}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'generation': 7, 'requested': 6, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 256, 'slot_pitch': 267, 'write_slot': 3, 'read_slot': 2, 'write_header': 812, 'read_header': 545, 'fresh': True, 'read_address': 807, 'fence_address': 1076, 'allocation_end': 1079}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 360, 'slot_pitch': 371, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 1124, 'fresh': True, 'read_address': 1452, 'fence_address': 379, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 182, 'slot_pitch': 193, 'write_slot': 1, 'read_slot': 0, 'write_header': 204, 'read_header': 11, 'fresh': False, 'read_address': 193, 'fence_address': 394, 'allocation_end': 783})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 3, 'slot_pitch': 14, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 64, 'fresh': False, 'read_address': 72, 'fence_address': 33, 'allocation_end': 78}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 105, 'slot_pitch': 116, 'write_slot': 1, 'read_slot': 0, 'write_header': 138, 'read_header': 22, 'fresh': True, 'read_address': 75, 'fence_address': 251, 'allocation_end': 486}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'generation': 10, 'requested': 9, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 297, 'slot_pitch': 308, 'write_slot': 2, 'read_slot': 1, 'write_header': 638, 'read_header': 330, 'fresh': True, 'read_address': 560, 'fence_address': 943, 'allocation_end': 1254}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'generation': 11, 'requested': 10, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 384, 'slot_pitch': 395, 'write_slot': 3, 'read_slot': 2, 'write_header': 1207, 'read_header': 812, 'fresh': True, 'read_address': 1201, 'fence_address': 1599, 'allocation_end': 1602}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 627, 'slot_pitch': 638, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 1936, 'fresh': True, 'read_address': 2448, 'fence_address': 657, 'allocation_end': 2574}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 273, 'slot_pitch': 284, 'write_slot': 1, 'read_slot': 0, 'write_header': 306, 'read_header': 22, 'fresh': False, 'read_address': 291, 'fence_address': 587, 'allocation_end': 1158})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 4, 'slot_pitch': 15, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 78, 'fresh': False, 'read_address': 86, 'fence_address': 45, 'allocation_end': 93}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 192, 'slot_pitch': 203, 'write_slot': 1, 'read_slot': 0, 'write_header': 236, 'read_header': 33, 'fresh': True, 'read_address': 109, 'fence_address': 436, 'allocation_end': 845}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'generation': 14, 'requested': 13, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 2, 'read_slot': 1, 'write_header': 1015, 'read_header': 524, 'fresh': True, 'read_address': 852, 'fence_address': 1503, 'allocation_end': 1997}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'generation': 15, 'requested': 14, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 512, 'slot_pitch': 523, 'write_slot': 3, 'read_slot': 2, 'write_header': 1602, 'read_header': 1079, 'fresh': True, 'read_address': 1595, 'fence_address': 2122, 'allocation_end': 2125}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 960, 'slot_pitch': 971, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 2946, 'fresh': True, 'read_address': 3658, 'fence_address': 1001, 'allocation_end': 3917}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 364, 'slot_pitch': 375, 'write_slot': 1, 'read_slot': 0, 'write_header': 408, 'read_header': 33, 'fresh': False, 'read_address': 389, 'fence_address': 780, 'allocation_end': 1533})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 5, 'slot_pitch': 16, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 92, 'fresh': False, 'read_address': 100, 'fence_address': 57, 'allocation_end': 108}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 315, 'slot_pitch': 326, 'write_slot': 1, 'read_slot': 0, 'write_header': 370, 'read_header': 44, 'fresh': True, 'read_address': 147, 'fence_address': 693, 'allocation_end': 1348}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'generation': 18, 'requested': 17, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 715, 'slot_pitch': 726, 'write_slot': 2, 'read_slot': 1, 'write_header': 1496, 'read_header': 770, 'fresh': True, 'read_address': 1208, 'fence_address': 2219, 'allocation_end': 2948}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'generation': 19, 'requested': 18, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 640, 'slot_pitch': 651, 'write_slot': 3, 'read_slot': 2, 'write_header': 1997, 'read_header': 1346, 'fresh': True, 'read_address': 1989, 'fence_address': 2645, 'allocation_end': 2648}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 1365, 'slot_pitch': 1376, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 4172, 'fresh': True, 'read_address': 5100, 'fence_address': 1417, 'allocation_end': 5548}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 455, 'slot_pitch': 466, 'write_slot': 1, 'read_slot': 0, 'write_header': 510, 'read_header': 44, 'fresh': False, 'read_address': 487, 'fence_address': 973, 'allocation_end': 1908})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 6, 'slot_pitch': 17, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 106, 'fresh': False, 'read_address': 114, 'fence_address': 69, 'allocation_end': 123}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 1, 'read_slot': 0, 'write_header': 546, 'read_header': 55, 'fresh': True, 'read_address': 189, 'fence_address': 1034, 'allocation_end': 2019}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'generation': 22, 'requested': 21, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1008, 'slot_pitch': 1019, 'write_slot': 2, 'read_slot': 1, 'write_header': 2093, 'read_header': 1074, 'fresh': True, 'read_address': 1634, 'fence_address': 3109, 'allocation_end': 4131}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'generation': 23, 'requested': 22, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 768, 'slot_pitch': 779, 'write_slot': 3, 'read_slot': 2, 'write_header': 2392, 'read_header': 1613, 'fresh': True, 'read_address': 2383, 'fence_address': 3168, 'allocation_end': 3171}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'generation': 24, 'requested': 23, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1848, 'slot_pitch': 1859, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 5632, 'fresh': True, 'read_address': 6792, 'fence_address': 1911, 'allocation_end': 7491}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'generation': 25, 'requested': 24, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 546, 'slot_pitch': 557, 'write_slot': 1, 'read_slot': 0, 'write_header': 612, 'read_header': 55, 'fresh': False, 'read_address': 585, 'fence_address': 1166, 'allocation_end': 2283})]}
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 | {'allocation_end': 51, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 49, 'read_header': 41, 'read_slot': 3, 'slot_pitch': 10, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 63, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 58, 'read_header': 50, 'read_slot': 3, 'slot_pitch': 13, 'write_header': 11, 'write_slot': 0} | Failed |
| layout fixture 2 | {'allocation_end': 235, 'fence_address': 123, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 56, 'write_header': 67, 'write_slot': 1} | {'allocation_end': 247, 'fence_address': 126, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 59, 'write_header': 70, 'write_slot': 1} | Failed |
| layout fixture 3 | {'allocation_end': 683, 'fence_address': 515, 'fresh': True, 'payload_bytes': 160, 'read_address': 323, 'read_header': 179, 'read_slot': 1, 'slot_pitch': 168, 'write_header': 347, 'write_slot': 2} | {'allocation_end': 695, 'fence_address': 521, 'fresh': True, 'payload_bytes': 160, 'read_address': 326, 'read_header': 182, 'read_slot': 1, 'slot_pitch': 171, 'write_header': 353, 'write_slot': 2} | Failed |
| layout fixture 4 | {'allocation_end': 1067, 'fence_address': 1067, 'fresh': True, 'payload_bytes': 256, 'read_address': 801, 'read_header': 539, 'read_slot': 2, 'slot_pitch': 264, 'write_header': 803, 'write_slot': 3} | {'allocation_end': 1079, 'fence_address': 1076, 'fresh': True, 'payload_bytes': 256, 'read_address': 807, 'read_header': 545, 'read_slot': 2, 'slot_pitch': 267, 'write_header': 812, 'write_slot': 3} | Failed |
| layout fixture 5 | {'allocation_end': 1483, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1443, 'read_header': 1115, 'read_slot': 3, 'slot_pitch': 368, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 1495, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1452, 'read_header': 1124, 'read_slot': 3, 'slot_pitch': 371, 'write_header': 11, 'write_slot': 0} | Failed |
| layout fixture 6 | {'allocation_end': 771, 'fence_address': 391, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 190, 'write_header': 201, 'write_slot': 1} | {'allocation_end': 783, 'fence_address': 394, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 193, 'write_header': 204, 'write_slot': 1} | Failed |
SHA-256 / 974db2f052ea846246d9317b8a7afac3a0d327993a50b7b2948acd744720795f
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)
payload_bytes = p["w"]*p["h"]*p["b"]
slot_pitch = payload_bytes+3
write_slot = p["generation"]%p["capacity"]
read_slot = p["requested"]%p["capacity"]
write_header = p["base"]+write_slot*slot_pitch
read_header = p["base"]+read_slot*slot_pitch
fresh = p["stored"][read_slot%4]==p["requested"]
read_address = read_header+8+(p["y"]*p["w"]+p["x"])*p["b"]
fence_address = write_header+8+payload_bytes
allocation_end = p["base"]+p["capacity"]*slot_pitch
return {'payload_bytes': payload_bytes, 'slot_pitch': slot_pitch, 'write_slot': write_slot, 'read_slot': read_slot, 'write_header': write_header, 'read_header': read_header, 'fresh': fresh, 'read_address': read_address, 'fence_address': fence_address, '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, 'generation': 4, 'requested': 3, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 2, 'slot_pitch': 13, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 50, 'fresh': False, 'read_address': 58, 'fence_address': 21, 'allocation_end': 63}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'generation': 5, 'requested': 4, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 48, 'slot_pitch': 59, 'write_slot': 1, 'read_slot': 0, 'write_header': 70, 'read_header': 11, 'fresh': True, 'read_address': 45, 'fence_address': 126, 'allocation_end': 247}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'generation': 6, 'requested': 5, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 160, 'slot_pitch': 171, 'write_slot': 2, 'read_slot': 1, 'write_header': 353, 'read_header': 182, 'fresh': True, 'read_address': 326, 'fence_address': 521, 'allocation_end': 695}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'generation': 7, 'requested': 6, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 256, 'slot_pitch': 267, 'write_slot': 3, 'read_slot': 2, 'write_header': 812, 'read_header': 545, 'fresh': True, 'read_address': 807, 'fence_address': 1076, 'allocation_end': 1079}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 360, 'slot_pitch': 371, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 1124, 'fresh': True, 'read_address': 1452, 'fence_address': 379, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 182, 'slot_pitch': 193, 'write_slot': 1, 'read_slot': 0, 'write_header': 204, 'read_header': 11, 'fresh': False, 'read_address': 193, 'fence_address': 394, 'allocation_end': 783})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 3, 'slot_pitch': 14, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 64, 'fresh': False, 'read_address': 72, 'fence_address': 33, 'allocation_end': 78}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 105, 'slot_pitch': 116, 'write_slot': 1, 'read_slot': 0, 'write_header': 138, 'read_header': 22, 'fresh': True, 'read_address': 75, 'fence_address': 251, 'allocation_end': 486}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'generation': 10, 'requested': 9, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 297, 'slot_pitch': 308, 'write_slot': 2, 'read_slot': 1, 'write_header': 638, 'read_header': 330, 'fresh': True, 'read_address': 560, 'fence_address': 943, 'allocation_end': 1254}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'generation': 11, 'requested': 10, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 384, 'slot_pitch': 395, 'write_slot': 3, 'read_slot': 2, 'write_header': 1207, 'read_header': 812, 'fresh': True, 'read_address': 1201, 'fence_address': 1599, 'allocation_end': 1602}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 627, 'slot_pitch': 638, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 1936, 'fresh': True, 'read_address': 2448, 'fence_address': 657, 'allocation_end': 2574}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 273, 'slot_pitch': 284, 'write_slot': 1, 'read_slot': 0, 'write_header': 306, 'read_header': 22, 'fresh': False, 'read_address': 291, 'fence_address': 587, 'allocation_end': 1158})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 4, 'slot_pitch': 15, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 78, 'fresh': False, 'read_address': 86, 'fence_address': 45, 'allocation_end': 93}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 192, 'slot_pitch': 203, 'write_slot': 1, 'read_slot': 0, 'write_header': 236, 'read_header': 33, 'fresh': True, 'read_address': 109, 'fence_address': 436, 'allocation_end': 845}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'generation': 14, 'requested': 13, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 2, 'read_slot': 1, 'write_header': 1015, 'read_header': 524, 'fresh': True, 'read_address': 852, 'fence_address': 1503, 'allocation_end': 1997}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'generation': 15, 'requested': 14, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 512, 'slot_pitch': 523, 'write_slot': 3, 'read_slot': 2, 'write_header': 1602, 'read_header': 1079, 'fresh': True, 'read_address': 1595, 'fence_address': 2122, 'allocation_end': 2125}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 960, 'slot_pitch': 971, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 2946, 'fresh': True, 'read_address': 3658, 'fence_address': 1001, 'allocation_end': 3917}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 364, 'slot_pitch': 375, 'write_slot': 1, 'read_slot': 0, 'write_header': 408, 'read_header': 33, 'fresh': False, 'read_address': 389, 'fence_address': 780, 'allocation_end': 1533})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 5, 'slot_pitch': 16, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 92, 'fresh': False, 'read_address': 100, 'fence_address': 57, 'allocation_end': 108}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 315, 'slot_pitch': 326, 'write_slot': 1, 'read_slot': 0, 'write_header': 370, 'read_header': 44, 'fresh': True, 'read_address': 147, 'fence_address': 693, 'allocation_end': 1348}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'generation': 18, 'requested': 17, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 715, 'slot_pitch': 726, 'write_slot': 2, 'read_slot': 1, 'write_header': 1496, 'read_header': 770, 'fresh': True, 'read_address': 1208, 'fence_address': 2219, 'allocation_end': 2948}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'generation': 19, 'requested': 18, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 640, 'slot_pitch': 651, 'write_slot': 3, 'read_slot': 2, 'write_header': 1997, 'read_header': 1346, 'fresh': True, 'read_address': 1989, 'fence_address': 2645, 'allocation_end': 2648}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 1365, 'slot_pitch': 1376, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 4172, 'fresh': True, 'read_address': 5100, 'fence_address': 1417, 'allocation_end': 5548}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 455, 'slot_pitch': 466, 'write_slot': 1, 'read_slot': 0, 'write_header': 510, 'read_header': 44, 'fresh': False, 'read_address': 487, 'fence_address': 973, 'allocation_end': 1908})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 6, 'slot_pitch': 17, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 106, 'fresh': False, 'read_address': 114, 'fence_address': 69, 'allocation_end': 123}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 1, 'read_slot': 0, 'write_header': 546, 'read_header': 55, 'fresh': True, 'read_address': 189, 'fence_address': 1034, 'allocation_end': 2019}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'generation': 22, 'requested': 21, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1008, 'slot_pitch': 1019, 'write_slot': 2, 'read_slot': 1, 'write_header': 2093, 'read_header': 1074, 'fresh': True, 'read_address': 1634, 'fence_address': 3109, 'allocation_end': 4131}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'generation': 23, 'requested': 22, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 768, 'slot_pitch': 779, 'write_slot': 3, 'read_slot': 2, 'write_header': 2392, 'read_header': 1613, 'fresh': True, 'read_address': 2383, 'fence_address': 3168, 'allocation_end': 3171}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'generation': 24, 'requested': 23, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1848, 'slot_pitch': 1859, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 5632, 'fresh': True, 'read_address': 6792, 'fence_address': 1911, 'allocation_end': 7491}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'generation': 25, 'requested': 24, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 546, 'slot_pitch': 557, 'write_slot': 1, 'read_slot': 0, 'write_header': 612, 'read_header': 55, 'fresh': False, 'read_address': 585, 'fence_address': 1166, 'allocation_end': 2283})]}
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 | {'allocation_end': 31, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 34, 'read_header': 26, 'read_slot': 3, 'slot_pitch': 5, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 63, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 58, 'read_header': 50, 'read_slot': 3, 'slot_pitch': 13, 'write_header': 11, 'write_slot': 0} | Failed |
| layout fixture 2 | {'allocation_end': 215, 'fence_address': 118, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 51, 'write_header': 62, 'write_slot': 1} | {'allocation_end': 247, 'fence_address': 126, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 59, 'write_header': 70, 'write_slot': 1} | Failed |
| layout fixture 3 | {'allocation_end': 663, 'fence_address': 505, 'fresh': True, 'payload_bytes': 160, 'read_address': 318, 'read_header': 174, 'read_slot': 1, 'slot_pitch': 163, 'write_header': 337, 'write_slot': 2} | {'allocation_end': 695, 'fence_address': 521, 'fresh': True, 'payload_bytes': 160, 'read_address': 326, 'read_header': 182, 'read_slot': 1, 'slot_pitch': 171, 'write_header': 353, 'write_slot': 2} | Failed |
| layout fixture 4 | {'allocation_end': 1047, 'fence_address': 1052, 'fresh': True, 'payload_bytes': 256, 'read_address': 791, 'read_header': 529, 'read_slot': 2, 'slot_pitch': 259, 'write_header': 788, 'write_slot': 3} | {'allocation_end': 1079, 'fence_address': 1076, 'fresh': True, 'payload_bytes': 256, 'read_address': 807, 'read_header': 545, 'read_slot': 2, 'slot_pitch': 267, 'write_header': 812, 'write_slot': 3} | Failed |
| layout fixture 5 | {'allocation_end': 1463, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1428, 'read_header': 1100, 'read_slot': 3, 'slot_pitch': 363, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 1495, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1452, 'read_header': 1124, 'read_slot': 3, 'slot_pitch': 371, 'write_header': 11, 'write_slot': 0} | Failed |
| layout fixture 6 | {'allocation_end': 751, 'fence_address': 386, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 185, 'write_header': 196, 'write_slot': 1} | {'allocation_end': 783, 'fence_address': 394, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 193, 'write_header': 204, 'write_slot': 1} | Failed |
SHA-256 / 903db110103d752cb3bf05d5dbb5ca0eb069bab84c441ba35431e91e1e8419b9
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)
payload_bytes = p["w"]*p["h"]*p["b"]
slot_pitch = 8+payload_bytes+3
write_slot = p["generation"]%p["capacity"]
read_slot = p["requested"]%p["capacity"]
write_header = p["base"]+write_slot*slot_pitch
read_header = p["base"]+read_slot*slot_pitch
fresh = p["stored"][read_slot%4]==p["requested"]
read_address = read_header+8+(p["y"]*p["w"]+p["x"])*p["b"]
fence_address = write_header+8+payload_bytes
allocation_end = p["base"]+p["capacity"]*slot_pitch
return {'payload_bytes': payload_bytes, 'slot_pitch': slot_pitch, 'write_slot': write_slot, 'read_slot': read_slot, 'write_header': write_header, 'read_header': read_header, 'fresh': fresh, 'read_address': read_address, 'fence_address': fence_address, '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, 'generation': 4, 'requested': 3, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 2, 'slot_pitch': 13, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 50, 'fresh': False, 'read_address': 58, 'fence_address': 21, 'allocation_end': 63}), ({'w': 6, 'h': 4, 'x': 1, 'y': 2, 'b': 2, 'base': 11, 'generation': 5, 'requested': 4, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 48, 'slot_pitch': 59, 'write_slot': 1, 'read_slot': 0, 'write_header': 70, 'read_header': 11, 'fresh': True, 'read_address': 45, 'fence_address': 126, 'allocation_end': 247}), ({'w': 10, 'h': 8, 'x': 8, 'y': 6, 'b': 2, 'base': 11, 'generation': 6, 'requested': 5, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 160, 'slot_pitch': 171, 'write_slot': 2, 'read_slot': 1, 'write_header': 353, 'read_header': 182, 'fresh': True, 'read_address': 326, 'fence_address': 521, 'allocation_end': 695}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 2, 'base': 11, 'generation': 7, 'requested': 6, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 256, 'slot_pitch': 267, 'write_slot': 3, 'read_slot': 2, 'write_header': 812, 'read_header': 545, 'fresh': True, 'read_address': 807, 'fence_address': 1076, 'allocation_end': 1079}), ({'w': 18, 'h': 10, 'x': 16, 'y': 8, 'b': 2, 'base': 11, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 360, 'slot_pitch': 371, 'write_slot': 0, 'read_slot': 3, 'write_header': 11, 'read_header': 1124, 'fresh': True, 'read_address': 1452, 'fence_address': 379, 'allocation_end': 1495}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 2, 'base': 11, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [4, 5, 6, 7]}, {'payload_bytes': 182, 'slot_pitch': 193, 'write_slot': 1, 'read_slot': 0, 'write_header': 204, 'read_header': 11, 'fresh': False, 'read_address': 193, 'fence_address': 394, 'allocation_end': 783})], 2: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 3, 'base': 22, 'generation': 8, 'requested': 7, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 3, 'slot_pitch': 14, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 64, 'fresh': False, 'read_address': 72, 'fence_address': 33, 'allocation_end': 78}), ({'w': 7, 'h': 5, 'x': 1, 'y': 2, 'b': 3, 'base': 22, 'generation': 9, 'requested': 8, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 105, 'slot_pitch': 116, 'write_slot': 1, 'read_slot': 0, 'write_header': 138, 'read_header': 22, 'fresh': True, 'read_address': 75, 'fence_address': 251, 'allocation_end': 486}), ({'w': 11, 'h': 9, 'x': 8, 'y': 6, 'b': 3, 'base': 22, 'generation': 10, 'requested': 9, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 297, 'slot_pitch': 308, 'write_slot': 2, 'read_slot': 1, 'write_header': 638, 'read_header': 330, 'fresh': True, 'read_address': 560, 'fence_address': 943, 'allocation_end': 1254}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 3, 'base': 22, 'generation': 11, 'requested': 10, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 384, 'slot_pitch': 395, 'write_slot': 3, 'read_slot': 2, 'write_header': 1207, 'read_header': 812, 'fresh': True, 'read_address': 1201, 'fence_address': 1599, 'allocation_end': 1602}), ({'w': 19, 'h': 11, 'x': 16, 'y': 8, 'b': 3, 'base': 22, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 627, 'slot_pitch': 638, 'write_slot': 0, 'read_slot': 3, 'write_header': 22, 'read_header': 1936, 'fresh': True, 'read_address': 2448, 'fence_address': 657, 'allocation_end': 2574}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 3, 'base': 22, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [8, 9, 10, 11]}, {'payload_bytes': 273, 'slot_pitch': 284, 'write_slot': 1, 'read_slot': 0, 'write_header': 306, 'read_header': 22, 'fresh': False, 'read_address': 291, 'fence_address': 587, 'allocation_end': 1158})], 3: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 4, 'base': 33, 'generation': 12, 'requested': 11, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 4, 'slot_pitch': 15, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 78, 'fresh': False, 'read_address': 86, 'fence_address': 45, 'allocation_end': 93}), ({'w': 8, 'h': 6, 'x': 1, 'y': 2, 'b': 4, 'base': 33, 'generation': 13, 'requested': 12, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 192, 'slot_pitch': 203, 'write_slot': 1, 'read_slot': 0, 'write_header': 236, 'read_header': 33, 'fresh': True, 'read_address': 109, 'fence_address': 436, 'allocation_end': 845}), ({'w': 12, 'h': 10, 'x': 8, 'y': 6, 'b': 4, 'base': 33, 'generation': 14, 'requested': 13, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 2, 'read_slot': 1, 'write_header': 1015, 'read_header': 524, 'fresh': True, 'read_address': 852, 'fence_address': 1503, 'allocation_end': 1997}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 4, 'base': 33, 'generation': 15, 'requested': 14, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 512, 'slot_pitch': 523, 'write_slot': 3, 'read_slot': 2, 'write_header': 1602, 'read_header': 1079, 'fresh': True, 'read_address': 1595, 'fence_address': 2122, 'allocation_end': 2125}), ({'w': 20, 'h': 12, 'x': 16, 'y': 8, 'b': 4, 'base': 33, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 960, 'slot_pitch': 971, 'write_slot': 0, 'read_slot': 3, 'write_header': 33, 'read_header': 2946, 'fresh': True, 'read_address': 3658, 'fence_address': 1001, 'allocation_end': 3917}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 4, 'base': 33, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [12, 13, 14, 15]}, {'payload_bytes': 364, 'slot_pitch': 375, 'write_slot': 1, 'read_slot': 0, 'write_header': 408, 'read_header': 33, 'fresh': False, 'read_address': 389, 'fence_address': 780, 'allocation_end': 1533})], 4: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 5, 'base': 44, 'generation': 16, 'requested': 15, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 5, 'slot_pitch': 16, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 92, 'fresh': False, 'read_address': 100, 'fence_address': 57, 'allocation_end': 108}), ({'w': 9, 'h': 7, 'x': 1, 'y': 2, 'b': 5, 'base': 44, 'generation': 17, 'requested': 16, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 315, 'slot_pitch': 326, 'write_slot': 1, 'read_slot': 0, 'write_header': 370, 'read_header': 44, 'fresh': True, 'read_address': 147, 'fence_address': 693, 'allocation_end': 1348}), ({'w': 13, 'h': 11, 'x': 8, 'y': 6, 'b': 5, 'base': 44, 'generation': 18, 'requested': 17, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 715, 'slot_pitch': 726, 'write_slot': 2, 'read_slot': 1, 'write_header': 1496, 'read_header': 770, 'fresh': True, 'read_address': 1208, 'fence_address': 2219, 'allocation_end': 2948}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 5, 'base': 44, 'generation': 19, 'requested': 18, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 640, 'slot_pitch': 651, 'write_slot': 3, 'read_slot': 2, 'write_header': 1997, 'read_header': 1346, 'fresh': True, 'read_address': 1989, 'fence_address': 2645, 'allocation_end': 2648}), ({'w': 21, 'h': 13, 'x': 16, 'y': 8, 'b': 5, 'base': 44, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 1365, 'slot_pitch': 1376, 'write_slot': 0, 'read_slot': 3, 'write_header': 44, 'read_header': 4172, 'fresh': True, 'read_address': 5100, 'fence_address': 1417, 'allocation_end': 5548}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 5, 'base': 44, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [16, 17, 18, 19]}, {'payload_bytes': 455, 'slot_pitch': 466, 'write_slot': 1, 'read_slot': 0, 'write_header': 510, 'read_header': 44, 'fresh': False, 'read_address': 487, 'fence_address': 973, 'allocation_end': 1908})], 5: [({'w': 1, 'h': 1, 'x': 0, 'y': 0, 'b': 6, 'base': 55, 'generation': 20, 'requested': 19, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 6, 'slot_pitch': 17, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 106, 'fresh': False, 'read_address': 114, 'fence_address': 69, 'allocation_end': 123}), ({'w': 10, 'h': 8, 'x': 1, 'y': 2, 'b': 6, 'base': 55, 'generation': 21, 'requested': 20, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 480, 'slot_pitch': 491, 'write_slot': 1, 'read_slot': 0, 'write_header': 546, 'read_header': 55, 'fresh': True, 'read_address': 189, 'fence_address': 1034, 'allocation_end': 2019}), ({'w': 14, 'h': 12, 'x': 8, 'y': 6, 'b': 6, 'base': 55, 'generation': 22, 'requested': 21, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1008, 'slot_pitch': 1019, 'write_slot': 2, 'read_slot': 1, 'write_header': 2093, 'read_header': 1074, 'fresh': True, 'read_address': 1634, 'fence_address': 3109, 'allocation_end': 4131}), ({'w': 16, 'h': 8, 'x': 15, 'y': 7, 'b': 6, 'base': 55, 'generation': 23, 'requested': 22, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 768, 'slot_pitch': 779, 'write_slot': 3, 'read_slot': 2, 'write_header': 2392, 'read_header': 1613, 'fresh': True, 'read_address': 2383, 'fence_address': 3168, 'allocation_end': 3171}), ({'w': 22, 'h': 14, 'x': 16, 'y': 8, 'b': 6, 'base': 55, 'generation': 24, 'requested': 23, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 1848, 'slot_pitch': 1859, 'write_slot': 0, 'read_slot': 3, 'write_header': 55, 'read_header': 5632, 'fresh': True, 'read_address': 6792, 'fence_address': 1911, 'allocation_end': 7491}), ({'w': 7, 'h': 13, 'x': 3, 'y': 12, 'b': 6, 'base': 55, 'generation': 25, 'requested': 24, 'capacity': 4, 'stored': [20, 21, 22, 23]}, {'payload_bytes': 546, 'slot_pitch': 557, 'write_slot': 1, 'read_slot': 0, 'write_header': 612, 'read_header': 55, 'fresh': False, 'read_address': 585, 'fence_address': 1166, 'allocation_end': 2283})]}
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 | {'allocation_end': 63, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 58, 'read_header': 50, 'read_slot': 3, 'slot_pitch': 13, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 63, 'fence_address': 21, 'fresh': False, 'payload_bytes': 2, 'read_address': 58, 'read_header': 50, 'read_slot': 3, 'slot_pitch': 13, 'write_header': 11, 'write_slot': 0} | Passed |
| layout fixture 2 | {'allocation_end': 247, 'fence_address': 126, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 59, 'write_header': 70, 'write_slot': 1} | {'allocation_end': 247, 'fence_address': 126, 'fresh': True, 'payload_bytes': 48, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 59, 'write_header': 70, 'write_slot': 1} | Passed |
| layout fixture 3 | {'allocation_end': 695, 'fence_address': 521, 'fresh': True, 'payload_bytes': 160, 'read_address': 326, 'read_header': 182, 'read_slot': 1, 'slot_pitch': 171, 'write_header': 353, 'write_slot': 2} | {'allocation_end': 695, 'fence_address': 521, 'fresh': True, 'payload_bytes': 160, 'read_address': 326, 'read_header': 182, 'read_slot': 1, 'slot_pitch': 171, 'write_header': 353, 'write_slot': 2} | Passed |
| layout fixture 4 | {'allocation_end': 1079, 'fence_address': 1076, 'fresh': True, 'payload_bytes': 256, 'read_address': 807, 'read_header': 545, 'read_slot': 2, 'slot_pitch': 267, 'write_header': 812, 'write_slot': 3} | {'allocation_end': 1079, 'fence_address': 1076, 'fresh': True, 'payload_bytes': 256, 'read_address': 807, 'read_header': 545, 'read_slot': 2, 'slot_pitch': 267, 'write_header': 812, 'write_slot': 3} | Passed |
| layout fixture 5 | {'allocation_end': 1495, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1452, 'read_header': 1124, 'read_slot': 3, 'slot_pitch': 371, 'write_header': 11, 'write_slot': 0} | {'allocation_end': 1495, 'fence_address': 379, 'fresh': True, 'payload_bytes': 360, 'read_address': 1452, 'read_header': 1124, 'read_slot': 3, 'slot_pitch': 371, 'write_header': 11, 'write_slot': 0} | Passed |
| layout fixture 6 | {'allocation_end': 783, 'fence_address': 394, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 193, 'write_header': 204, 'write_slot': 1} | {'allocation_end': 783, 'fence_address': 394, 'fresh': False, 'payload_bytes': 182, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 193, 'write_header': 204, 'write_slot': 1} | Passed |
SHA-256 / 707be3582647383bee42a92b2279bd1bc2c3564f07d76ab5848af58ad27690d7
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:33.606600+00:00.
Case digest / eac0b546ecc48ec05319d9c522dab3d778cb128724745ca499ca1e3adb1f6eb8