FAILURE MAP
← Case archive

FA-52891 / Raster memory layout / Open access

Capture Ring Frame Slots: Capture payload ignores pixel width or counts entire ring · case 01

The returned physical layout descriptor disagrees with the declared buffer mapping at payload_bytes.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Capture payload ignores pixel width or counts entire ring The faulty expression is p["w"]*p["h"].

VERIFIED REPAIR

Apply the stipulated layout rule at payload_bytes: p["w"]*p["h"]*p["b"].

Unsuccessful approach: The attempted repair uses p["w"]*p["h"]*p["b"]*p["capacity"] 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"]
    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 fixtureActualExpectedOutcome
layout fixture 1{'allocation_end': 59, 'fence_address': 20, 'fresh': False, 'payload_bytes': 1, 'read_address': 55, 'read_header': 47, 'read_slot': 3, 'slot_pitch': 12, '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': 151, 'fence_address': 78, 'fresh': True, 'payload_bytes': 24, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 35, 'write_header': 46, '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': 375, 'fence_address': 281, 'fresh': True, 'payload_bytes': 80, 'read_address': 246, 'read_header': 102, 'read_slot': 1, 'slot_pitch': 91, 'write_header': 193, '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': 567, 'fence_address': 564, 'fresh': True, 'payload_bytes': 128, 'read_address': 551, 'read_header': 289, 'read_slot': 2, 'slot_pitch': 139, 'write_header': 428, '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': 775, 'fence_address': 199, 'fresh': True, 'payload_bytes': 180, 'read_address': 912, 'read_header': 584, 'read_slot': 3, 'slot_pitch': 191, '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': 419, 'fence_address': 212, 'fresh': False, 'payload_bytes': 91, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 102, 'write_header': 113, '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 / b1162066eca3f0856ff3450a4d11fa333a0fd28521127fdf88c37af61d7a58f3

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"]*p["capacity"]
    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 fixtureActualExpectedOutcome
layout fixture 1{'allocation_end': 87, 'fence_address': 27, 'fresh': False, 'payload_bytes': 8, 'read_address': 76, 'read_header': 68, 'read_slot': 3, 'slot_pitch': 19, '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': 823, 'fence_address': 414, 'fresh': True, 'payload_bytes': 192, 'read_address': 45, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 203, 'write_header': 214, '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': 2615, 'fence_address': 1961, 'fresh': True, 'payload_bytes': 640, 'read_address': 806, 'read_header': 662, 'read_slot': 1, 'slot_pitch': 651, 'write_header': 1313, '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': 4151, 'fence_address': 4148, 'fresh': True, 'payload_bytes': 1024, 'read_address': 2343, 'read_header': 2081, 'read_slot': 2, 'slot_pitch': 1035, 'write_header': 3116, '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': 5815, 'fence_address': 1459, 'fresh': True, 'payload_bytes': 1440, 'read_address': 4692, 'read_header': 4364, 'read_slot': 3, 'slot_pitch': 1451, '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': 2967, 'fence_address': 1486, 'fresh': False, 'payload_bytes': 728, 'read_address': 193, 'read_header': 11, 'read_slot': 0, 'slot_pitch': 739, 'write_header': 750, '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 / d6e24a1bb53885782bdde6677f59bec422de09ba4a6ae1dfbbccbb1bebe2edca

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 fixtureActualExpectedOutcome
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.604634+00:00.

Case digest / e265f8636eb2f3510d31dfb64e81096fe0f485b592cd018ef1530e425e643a9e