FAILURE MAP
← Case archive

FA-53166 / Raster memory layout / Open access

Page Split Texel Spans: Physical mapping bypassed or physical page ID not scaled · case 01

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

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

ROOT CAUSE

Physical mapping bypassed or physical page ID not scaled The faulty expression is first_page*16+page_offset.

VERIFIED REPAIR

Apply the stipulated layout rule at first_physical: p["pages"][first_page%len(p["pages"])]*16+page_offset.

Unsuccessful approach: The attempted repair uses p["pages"][first_page%len(p["pages"])]+page_offset and still violates the layout contract.

Case contract

Raster texels contain six bytes and may straddle 16-byte virtual pages. A virtual byte span maps through a noncontiguous physical page directory; output contains source spans and offsets for reassembling one texel. 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)
    virtual_start = p["base"]+p["y"]*p["pitch"]+p["x"]*6
    first_page = virtual_start//16
    page_offset = virtual_start%16
    first_bytes = min(6,16-page_offset)
    remaining = 6-first_bytes
    first_physical = first_page*16+page_offset
    second_physical = p["pages"][(first_page+1)%len(p["pages"])]*16
    spans = [[first_physical,first_bytes]]+([[second_physical,remaining]] if remaining else [])
    destination_offsets = [0,first_bytes] if remaining else [0]
    byte_addresses = [a+i for a,count in spans for i in range(count)]
    return {'virtual_start': virtual_start, 'first_page': first_page, 'page_offset': page_offset, 'first_bytes': first_bytes, 'remaining': remaining, 'first_physical': first_physical, 'second_physical': second_physical, 'spans': spans, 'destination_offsets': destination_offsets, 'byte_addresses': byte_addresses}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 8, 'x': 0, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 13, 'first_page': 0, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 61, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [61, 62, 63, 112, 113, 114]}), ({'w': 8, 'x': 1, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 68, 'first_page': 4, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 36, 'second_physical': 160, 'spans': [[36, 6]], 'destination_offsets': [0], 'byte_addresses': [36, 37, 38, 39, 40, 41]}), ({'w': 8, 'x': 2, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 123, 'first_page': 7, 'page_offset': 11, 'first_bytes': 5, 'remaining': 1, 'first_physical': 155, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'destination_offsets': [0, 5], 'byte_addresses': [155, 156, 157, 158, 159, 96]}), ({'w': 8, 'x': 3, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 31, 'first_page': 1, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 127, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [127, 16, 17, 18, 19, 20]}), ({'w': 8, 'x': 4, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 86, 'first_page': 5, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 166, 'second_physical': 64, 'spans': [[166, 6]], 'destination_offsets': [0], 'byte_addresses': [166, 167, 168, 169, 170, 171]}), ({'w': 8, 'x': 5, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 141, 'first_page': 8, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 109, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [109, 110, 111, 176, 177, 178]})], 2: [({'w': 9, 'x': 0, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 26, 'first_page': 1, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 122, 'second_physical': 16, 'spans': [[122, 6]], 'destination_offsets': [0], 'byte_addresses': [122, 123, 124, 125, 126, 127]}), ({'w': 9, 'x': 1, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 87, 'first_page': 5, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 167, 'second_physical': 64, 'spans': [[167, 6]], 'destination_offsets': [0], 'byte_addresses': [167, 168, 169, 170, 171, 172]}), ({'w': 9, 'x': 2, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 148, 'first_page': 9, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 180, 'second_physical': 80, 'spans': [[180, 6]], 'destination_offsets': [0], 'byte_addresses': [180, 181, 182, 183, 184, 185]}), ({'w': 9, 'x': 3, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 44, 'first_page': 2, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 28, 'second_physical': 128, 'spans': [[28, 4], [128, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [28, 29, 30, 31, 128, 129]}), ({'w': 9, 'x': 4, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 105, 'first_page': 6, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 73, 'second_physical': 144, 'spans': [[73, 6]], 'destination_offsets': [0], 'byte_addresses': [73, 74, 75, 76, 77, 78]}), ({'w': 9, 'x': 5, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 166, 'first_page': 10, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 86, 'second_physical': 192, 'spans': [[86, 6]], 'destination_offsets': [0], 'byte_addresses': [86, 87, 88, 89, 90, 91]})], 3: [({'w': 10, 'x': 0, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 39, 'first_page': 2, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 23, 'second_physical': 128, 'spans': [[23, 6]], 'destination_offsets': [0], 'byte_addresses': [23, 24, 25, 26, 27, 28]}), ({'w': 10, 'x': 1, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 106, 'first_page': 6, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 74, 'second_physical': 144, 'spans': [[74, 6]], 'destination_offsets': [0], 'byte_addresses': [74, 75, 76, 77, 78, 79]}), ({'w': 10, 'x': 2, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 173, 'first_page': 10, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 93, 'second_physical': 192, 'spans': [[93, 3], [192, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [93, 94, 95, 192, 193, 194]}), ({'w': 10, 'x': 3, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 57, 'first_page': 3, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 137, 'second_physical': 32, 'spans': [[137, 6]], 'destination_offsets': [0], 'byte_addresses': [137, 138, 139, 140, 141, 142]}), ({'w': 10, 'x': 4, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 124, 'first_page': 7, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 156, 'second_physical': 96, 'spans': [[156, 4], [96, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [156, 157, 158, 159, 96, 97]}), ({'w': 10, 'x': 5, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 191, 'first_page': 11, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 207, 'second_physical': 224, 'spans': [[207, 1], [224, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [207, 224, 225, 226, 227, 228]})], 4: [({'w': 11, 'x': 0, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 52, 'first_page': 3, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 132, 'second_physical': 32, 'spans': [[132, 6]], 'destination_offsets': [0], 'byte_addresses': [132, 133, 134, 135, 136, 137]}), ({'w': 11, 'x': 1, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 125, 'first_page': 7, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 157, 'second_physical': 96, 'spans': [[157, 3], [96, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [157, 158, 159, 96, 97, 98]}), ({'w': 11, 'x': 2, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 198, 'first_page': 12, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 230, 'second_physical': 208, 'spans': [[230, 6]], 'destination_offsets': [0], 'byte_addresses': [230, 231, 232, 233, 234, 235]}), ({'w': 11, 'x': 3, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 70, 'first_page': 4, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 38, 'second_physical': 160, 'spans': [[38, 6]], 'destination_offsets': [0], 'byte_addresses': [38, 39, 40, 41, 42, 43]}), ({'w': 11, 'x': 4, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 143, 'first_page': 8, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 111, 'second_physical': 176, 'spans': [[111, 1], [176, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [111, 176, 177, 178, 179, 180]}), ({'w': 11, 'x': 5, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 216, 'first_page': 13, 'page_offset': 8, 'first_bytes': 6, 'remaining': 0, 'first_physical': 216, 'second_physical': 240, 'spans': [[216, 6]], 'destination_offsets': [0], 'byte_addresses': [216, 217, 218, 219, 220, 221]})], 5: [({'w': 12, 'x': 0, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 65, 'first_page': 4, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 33, 'second_physical': 160, 'spans': [[33, 6]], 'destination_offsets': [0], 'byte_addresses': [33, 34, 35, 36, 37, 38]}), ({'w': 12, 'x': 1, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 144, 'first_page': 9, 'page_offset': 0, 'first_bytes': 6, 'remaining': 0, 'first_physical': 176, 'second_physical': 80, 'spans': [[176, 6]], 'destination_offsets': [0], 'byte_addresses': [176, 177, 178, 179, 180, 181]}), ({'w': 12, 'x': 2, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 223, 'first_page': 13, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 223, 'second_physical': 240, 'spans': [[223, 1], [240, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [223, 240, 241, 242, 243, 244]}), ({'w': 12, 'x': 3, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 83, 'first_page': 5, 'page_offset': 3, 'first_bytes': 6, 'remaining': 0, 'first_physical': 163, 'second_physical': 64, 'spans': [[163, 6]], 'destination_offsets': [0], 'byte_addresses': [163, 164, 165, 166, 167, 168]}), ({'w': 12, 'x': 4, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 162, 'first_page': 10, 'page_offset': 2, 'first_bytes': 6, 'remaining': 0, 'first_physical': 82, 'second_physical': 192, 'spans': [[82, 6]], 'destination_offsets': [0], 'byte_addresses': [82, 83, 84, 85, 86, 87]}), ({'w': 12, 'x': 5, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 241, 'first_page': 15, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 257, 'second_physical': 272, 'spans': [[257, 6]], 'destination_offsets': [0], 'byte_addresses': [257, 258, 259, 260, 261, 262]})]}
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{'byte_addresses': [13, 14, 15, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 13, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[13, 3], [112, 3]], 'virtual_start': 13}{'byte_addresses': [61, 62, 63, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 61, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'virtual_start': 13}Failed
layout fixture 2{'byte_addresses': [68, 69, 70, 71, 72, 73], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 68, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[68, 6]], 'virtual_start': 68}{'byte_addresses': [36, 37, 38, 39, 40, 41], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 36, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[36, 6]], 'virtual_start': 68}Failed
layout fixture 3{'byte_addresses': [123, 124, 125, 126, 127, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 123, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[123, 5], [96, 1]], 'virtual_start': 123}{'byte_addresses': [155, 156, 157, 158, 159, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 155, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'virtual_start': 123}Failed
layout fixture 4{'byte_addresses': [31, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 31, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[31, 1], [16, 5]], 'virtual_start': 31}{'byte_addresses': [127, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 127, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'virtual_start': 31}Failed
layout fixture 5{'byte_addresses': [86, 87, 88, 89, 90, 91], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 86, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[86, 6]], 'virtual_start': 86}{'byte_addresses': [166, 167, 168, 169, 170, 171], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 166, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[166, 6]], 'virtual_start': 86}Failed
layout fixture 6{'byte_addresses': [141, 142, 143, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 141, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[141, 3], [176, 3]], 'virtual_start': 141}{'byte_addresses': [109, 110, 111, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 109, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'virtual_start': 141}Failed

SHA-256 / 3e583691aebeafc595c07c37c42ac772cc680951fa8418d115f13152441cd26f

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)
    virtual_start = p["base"]+p["y"]*p["pitch"]+p["x"]*6
    first_page = virtual_start//16
    page_offset = virtual_start%16
    first_bytes = min(6,16-page_offset)
    remaining = 6-first_bytes
    first_physical = p["pages"][first_page%len(p["pages"])]+page_offset
    second_physical = p["pages"][(first_page+1)%len(p["pages"])]*16
    spans = [[first_physical,first_bytes]]+([[second_physical,remaining]] if remaining else [])
    destination_offsets = [0,first_bytes] if remaining else [0]
    byte_addresses = [a+i for a,count in spans for i in range(count)]
    return {'virtual_start': virtual_start, 'first_page': first_page, 'page_offset': page_offset, 'first_bytes': first_bytes, 'remaining': remaining, 'first_physical': first_physical, 'second_physical': second_physical, 'spans': spans, 'destination_offsets': destination_offsets, 'byte_addresses': byte_addresses}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 8, 'x': 0, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 13, 'first_page': 0, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 61, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [61, 62, 63, 112, 113, 114]}), ({'w': 8, 'x': 1, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 68, 'first_page': 4, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 36, 'second_physical': 160, 'spans': [[36, 6]], 'destination_offsets': [0], 'byte_addresses': [36, 37, 38, 39, 40, 41]}), ({'w': 8, 'x': 2, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 123, 'first_page': 7, 'page_offset': 11, 'first_bytes': 5, 'remaining': 1, 'first_physical': 155, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'destination_offsets': [0, 5], 'byte_addresses': [155, 156, 157, 158, 159, 96]}), ({'w': 8, 'x': 3, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 31, 'first_page': 1, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 127, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [127, 16, 17, 18, 19, 20]}), ({'w': 8, 'x': 4, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 86, 'first_page': 5, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 166, 'second_physical': 64, 'spans': [[166, 6]], 'destination_offsets': [0], 'byte_addresses': [166, 167, 168, 169, 170, 171]}), ({'w': 8, 'x': 5, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 141, 'first_page': 8, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 109, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [109, 110, 111, 176, 177, 178]})], 2: [({'w': 9, 'x': 0, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 26, 'first_page': 1, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 122, 'second_physical': 16, 'spans': [[122, 6]], 'destination_offsets': [0], 'byte_addresses': [122, 123, 124, 125, 126, 127]}), ({'w': 9, 'x': 1, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 87, 'first_page': 5, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 167, 'second_physical': 64, 'spans': [[167, 6]], 'destination_offsets': [0], 'byte_addresses': [167, 168, 169, 170, 171, 172]}), ({'w': 9, 'x': 2, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 148, 'first_page': 9, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 180, 'second_physical': 80, 'spans': [[180, 6]], 'destination_offsets': [0], 'byte_addresses': [180, 181, 182, 183, 184, 185]}), ({'w': 9, 'x': 3, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 44, 'first_page': 2, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 28, 'second_physical': 128, 'spans': [[28, 4], [128, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [28, 29, 30, 31, 128, 129]}), ({'w': 9, 'x': 4, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 105, 'first_page': 6, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 73, 'second_physical': 144, 'spans': [[73, 6]], 'destination_offsets': [0], 'byte_addresses': [73, 74, 75, 76, 77, 78]}), ({'w': 9, 'x': 5, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 166, 'first_page': 10, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 86, 'second_physical': 192, 'spans': [[86, 6]], 'destination_offsets': [0], 'byte_addresses': [86, 87, 88, 89, 90, 91]})], 3: [({'w': 10, 'x': 0, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 39, 'first_page': 2, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 23, 'second_physical': 128, 'spans': [[23, 6]], 'destination_offsets': [0], 'byte_addresses': [23, 24, 25, 26, 27, 28]}), ({'w': 10, 'x': 1, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 106, 'first_page': 6, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 74, 'second_physical': 144, 'spans': [[74, 6]], 'destination_offsets': [0], 'byte_addresses': [74, 75, 76, 77, 78, 79]}), ({'w': 10, 'x': 2, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 173, 'first_page': 10, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 93, 'second_physical': 192, 'spans': [[93, 3], [192, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [93, 94, 95, 192, 193, 194]}), ({'w': 10, 'x': 3, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 57, 'first_page': 3, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 137, 'second_physical': 32, 'spans': [[137, 6]], 'destination_offsets': [0], 'byte_addresses': [137, 138, 139, 140, 141, 142]}), ({'w': 10, 'x': 4, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 124, 'first_page': 7, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 156, 'second_physical': 96, 'spans': [[156, 4], [96, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [156, 157, 158, 159, 96, 97]}), ({'w': 10, 'x': 5, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 191, 'first_page': 11, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 207, 'second_physical': 224, 'spans': [[207, 1], [224, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [207, 224, 225, 226, 227, 228]})], 4: [({'w': 11, 'x': 0, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 52, 'first_page': 3, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 132, 'second_physical': 32, 'spans': [[132, 6]], 'destination_offsets': [0], 'byte_addresses': [132, 133, 134, 135, 136, 137]}), ({'w': 11, 'x': 1, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 125, 'first_page': 7, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 157, 'second_physical': 96, 'spans': [[157, 3], [96, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [157, 158, 159, 96, 97, 98]}), ({'w': 11, 'x': 2, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 198, 'first_page': 12, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 230, 'second_physical': 208, 'spans': [[230, 6]], 'destination_offsets': [0], 'byte_addresses': [230, 231, 232, 233, 234, 235]}), ({'w': 11, 'x': 3, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 70, 'first_page': 4, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 38, 'second_physical': 160, 'spans': [[38, 6]], 'destination_offsets': [0], 'byte_addresses': [38, 39, 40, 41, 42, 43]}), ({'w': 11, 'x': 4, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 143, 'first_page': 8, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 111, 'second_physical': 176, 'spans': [[111, 1], [176, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [111, 176, 177, 178, 179, 180]}), ({'w': 11, 'x': 5, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 216, 'first_page': 13, 'page_offset': 8, 'first_bytes': 6, 'remaining': 0, 'first_physical': 216, 'second_physical': 240, 'spans': [[216, 6]], 'destination_offsets': [0], 'byte_addresses': [216, 217, 218, 219, 220, 221]})], 5: [({'w': 12, 'x': 0, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 65, 'first_page': 4, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 33, 'second_physical': 160, 'spans': [[33, 6]], 'destination_offsets': [0], 'byte_addresses': [33, 34, 35, 36, 37, 38]}), ({'w': 12, 'x': 1, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 144, 'first_page': 9, 'page_offset': 0, 'first_bytes': 6, 'remaining': 0, 'first_physical': 176, 'second_physical': 80, 'spans': [[176, 6]], 'destination_offsets': [0], 'byte_addresses': [176, 177, 178, 179, 180, 181]}), ({'w': 12, 'x': 2, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 223, 'first_page': 13, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 223, 'second_physical': 240, 'spans': [[223, 1], [240, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [223, 240, 241, 242, 243, 244]}), ({'w': 12, 'x': 3, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 83, 'first_page': 5, 'page_offset': 3, 'first_bytes': 6, 'remaining': 0, 'first_physical': 163, 'second_physical': 64, 'spans': [[163, 6]], 'destination_offsets': [0], 'byte_addresses': [163, 164, 165, 166, 167, 168]}), ({'w': 12, 'x': 4, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 162, 'first_page': 10, 'page_offset': 2, 'first_bytes': 6, 'remaining': 0, 'first_physical': 82, 'second_physical': 192, 'spans': [[82, 6]], 'destination_offsets': [0], 'byte_addresses': [82, 83, 84, 85, 86, 87]}), ({'w': 12, 'x': 5, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 241, 'first_page': 15, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 257, 'second_physical': 272, 'spans': [[257, 6]], 'destination_offsets': [0], 'byte_addresses': [257, 258, 259, 260, 261, 262]})]}
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{'byte_addresses': [16, 17, 18, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 16, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[16, 3], [112, 3]], 'virtual_start': 13}{'byte_addresses': [61, 62, 63, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 61, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'virtual_start': 13}Failed
layout fixture 2{'byte_addresses': [6, 7, 8, 9, 10, 11], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 6, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[6, 6]], 'virtual_start': 68}{'byte_addresses': [36, 37, 38, 39, 40, 41], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 36, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[36, 6]], 'virtual_start': 68}Failed
layout fixture 3{'byte_addresses': [20, 21, 22, 23, 24, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 20, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[20, 5], [96, 1]], 'virtual_start': 123}{'byte_addresses': [155, 156, 157, 158, 159, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 155, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'virtual_start': 123}Failed
layout fixture 4{'byte_addresses': [22, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 22, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[22, 1], [16, 5]], 'virtual_start': 31}{'byte_addresses': [127, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 127, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'virtual_start': 31}Failed
layout fixture 5{'byte_addresses': [16, 17, 18, 19, 20, 21], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 16, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[16, 6]], 'virtual_start': 86}{'byte_addresses': [166, 167, 168, 169, 170, 171], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 166, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[166, 6]], 'virtual_start': 86}Failed
layout fixture 6{'byte_addresses': [19, 20, 21, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 19, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[19, 3], [176, 3]], 'virtual_start': 141}{'byte_addresses': [109, 110, 111, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 109, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'virtual_start': 141}Failed

SHA-256 / 86ce8847ba9e7d87734052ffadfd52bb920e52a50af4dce6d278b5afd007c788

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)
    virtual_start = p["base"]+p["y"]*p["pitch"]+p["x"]*6
    first_page = virtual_start//16
    page_offset = virtual_start%16
    first_bytes = min(6,16-page_offset)
    remaining = 6-first_bytes
    first_physical = p["pages"][first_page%len(p["pages"])]*16+page_offset
    second_physical = p["pages"][(first_page+1)%len(p["pages"])]*16
    spans = [[first_physical,first_bytes]]+([[second_physical,remaining]] if remaining else [])
    destination_offsets = [0,first_bytes] if remaining else [0]
    byte_addresses = [a+i for a,count in spans for i in range(count)]
    return {'virtual_start': virtual_start, 'first_page': first_page, 'page_offset': page_offset, 'first_bytes': first_bytes, 'remaining': remaining, 'first_physical': first_physical, 'second_physical': second_physical, 'spans': spans, 'destination_offsets': destination_offsets, 'byte_addresses': byte_addresses}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [({'w': 8, 'x': 0, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 13, 'first_page': 0, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 61, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [61, 62, 63, 112, 113, 114]}), ({'w': 8, 'x': 1, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 68, 'first_page': 4, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 36, 'second_physical': 160, 'spans': [[36, 6]], 'destination_offsets': [0], 'byte_addresses': [36, 37, 38, 39, 40, 41]}), ({'w': 8, 'x': 2, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 123, 'first_page': 7, 'page_offset': 11, 'first_bytes': 5, 'remaining': 1, 'first_physical': 155, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'destination_offsets': [0, 5], 'byte_addresses': [155, 156, 157, 158, 159, 96]}), ({'w': 8, 'x': 3, 'y': 0, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 31, 'first_page': 1, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 127, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [127, 16, 17, 18, 19, 20]}), ({'w': 8, 'x': 4, 'y': 1, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 86, 'first_page': 5, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 166, 'second_physical': 64, 'spans': [[166, 6]], 'destination_offsets': [0], 'byte_addresses': [166, 167, 168, 169, 170, 171]}), ({'w': 8, 'x': 5, 'y': 2, 'pitch': 49, 'base': 13, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 141, 'first_page': 8, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 109, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [109, 110, 111, 176, 177, 178]})], 2: [({'w': 9, 'x': 0, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 26, 'first_page': 1, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 122, 'second_physical': 16, 'spans': [[122, 6]], 'destination_offsets': [0], 'byte_addresses': [122, 123, 124, 125, 126, 127]}), ({'w': 9, 'x': 1, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 87, 'first_page': 5, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 167, 'second_physical': 64, 'spans': [[167, 6]], 'destination_offsets': [0], 'byte_addresses': [167, 168, 169, 170, 171, 172]}), ({'w': 9, 'x': 2, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 148, 'first_page': 9, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 180, 'second_physical': 80, 'spans': [[180, 6]], 'destination_offsets': [0], 'byte_addresses': [180, 181, 182, 183, 184, 185]}), ({'w': 9, 'x': 3, 'y': 0, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 44, 'first_page': 2, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 28, 'second_physical': 128, 'spans': [[28, 4], [128, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [28, 29, 30, 31, 128, 129]}), ({'w': 9, 'x': 4, 'y': 1, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 105, 'first_page': 6, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 73, 'second_physical': 144, 'spans': [[73, 6]], 'destination_offsets': [0], 'byte_addresses': [73, 74, 75, 76, 77, 78]}), ({'w': 9, 'x': 5, 'y': 2, 'pitch': 55, 'base': 26, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 166, 'first_page': 10, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 86, 'second_physical': 192, 'spans': [[86, 6]], 'destination_offsets': [0], 'byte_addresses': [86, 87, 88, 89, 90, 91]})], 3: [({'w': 10, 'x': 0, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 39, 'first_page': 2, 'page_offset': 7, 'first_bytes': 6, 'remaining': 0, 'first_physical': 23, 'second_physical': 128, 'spans': [[23, 6]], 'destination_offsets': [0], 'byte_addresses': [23, 24, 25, 26, 27, 28]}), ({'w': 10, 'x': 1, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 106, 'first_page': 6, 'page_offset': 10, 'first_bytes': 6, 'remaining': 0, 'first_physical': 74, 'second_physical': 144, 'spans': [[74, 6]], 'destination_offsets': [0], 'byte_addresses': [74, 75, 76, 77, 78, 79]}), ({'w': 10, 'x': 2, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 173, 'first_page': 10, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 93, 'second_physical': 192, 'spans': [[93, 3], [192, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [93, 94, 95, 192, 193, 194]}), ({'w': 10, 'x': 3, 'y': 0, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 57, 'first_page': 3, 'page_offset': 9, 'first_bytes': 6, 'remaining': 0, 'first_physical': 137, 'second_physical': 32, 'spans': [[137, 6]], 'destination_offsets': [0], 'byte_addresses': [137, 138, 139, 140, 141, 142]}), ({'w': 10, 'x': 4, 'y': 1, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 124, 'first_page': 7, 'page_offset': 12, 'first_bytes': 4, 'remaining': 2, 'first_physical': 156, 'second_physical': 96, 'spans': [[156, 4], [96, 2]], 'destination_offsets': [0, 4], 'byte_addresses': [156, 157, 158, 159, 96, 97]}), ({'w': 10, 'x': 5, 'y': 2, 'pitch': 61, 'base': 39, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 191, 'first_page': 11, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 207, 'second_physical': 224, 'spans': [[207, 1], [224, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [207, 224, 225, 226, 227, 228]})], 4: [({'w': 11, 'x': 0, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 52, 'first_page': 3, 'page_offset': 4, 'first_bytes': 6, 'remaining': 0, 'first_physical': 132, 'second_physical': 32, 'spans': [[132, 6]], 'destination_offsets': [0], 'byte_addresses': [132, 133, 134, 135, 136, 137]}), ({'w': 11, 'x': 1, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 125, 'first_page': 7, 'page_offset': 13, 'first_bytes': 3, 'remaining': 3, 'first_physical': 157, 'second_physical': 96, 'spans': [[157, 3], [96, 3]], 'destination_offsets': [0, 3], 'byte_addresses': [157, 158, 159, 96, 97, 98]}), ({'w': 11, 'x': 2, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 198, 'first_page': 12, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 230, 'second_physical': 208, 'spans': [[230, 6]], 'destination_offsets': [0], 'byte_addresses': [230, 231, 232, 233, 234, 235]}), ({'w': 11, 'x': 3, 'y': 0, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 70, 'first_page': 4, 'page_offset': 6, 'first_bytes': 6, 'remaining': 0, 'first_physical': 38, 'second_physical': 160, 'spans': [[38, 6]], 'destination_offsets': [0], 'byte_addresses': [38, 39, 40, 41, 42, 43]}), ({'w': 11, 'x': 4, 'y': 1, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 143, 'first_page': 8, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 111, 'second_physical': 176, 'spans': [[111, 1], [176, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [111, 176, 177, 178, 179, 180]}), ({'w': 11, 'x': 5, 'y': 2, 'pitch': 67, 'base': 52, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 216, 'first_page': 13, 'page_offset': 8, 'first_bytes': 6, 'remaining': 0, 'first_physical': 216, 'second_physical': 240, 'spans': [[216, 6]], 'destination_offsets': [0], 'byte_addresses': [216, 217, 218, 219, 220, 221]})], 5: [({'w': 12, 'x': 0, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 65, 'first_page': 4, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 33, 'second_physical': 160, 'spans': [[33, 6]], 'destination_offsets': [0], 'byte_addresses': [33, 34, 35, 36, 37, 38]}), ({'w': 12, 'x': 1, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 144, 'first_page': 9, 'page_offset': 0, 'first_bytes': 6, 'remaining': 0, 'first_physical': 176, 'second_physical': 80, 'spans': [[176, 6]], 'destination_offsets': [0], 'byte_addresses': [176, 177, 178, 179, 180, 181]}), ({'w': 12, 'x': 2, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 223, 'first_page': 13, 'page_offset': 15, 'first_bytes': 1, 'remaining': 5, 'first_physical': 223, 'second_physical': 240, 'spans': [[223, 1], [240, 5]], 'destination_offsets': [0, 1], 'byte_addresses': [223, 240, 241, 242, 243, 244]}), ({'w': 12, 'x': 3, 'y': 0, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 83, 'first_page': 5, 'page_offset': 3, 'first_bytes': 6, 'remaining': 0, 'first_physical': 163, 'second_physical': 64, 'spans': [[163, 6]], 'destination_offsets': [0], 'byte_addresses': [163, 164, 165, 166, 167, 168]}), ({'w': 12, 'x': 4, 'y': 1, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 162, 'first_page': 10, 'page_offset': 2, 'first_bytes': 6, 'remaining': 0, 'first_physical': 82, 'second_physical': 192, 'spans': [[82, 6]], 'destination_offsets': [0], 'byte_addresses': [82, 83, 84, 85, 86, 87]}), ({'w': 12, 'x': 5, 'y': 2, 'pitch': 73, 'base': 65, 'pages': [3, 7, 1, 8, 2, 10, 4, 9, 6, 11, 5, 12, 14, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]}, {'virtual_start': 241, 'first_page': 15, 'page_offset': 1, 'first_bytes': 6, 'remaining': 0, 'first_physical': 257, 'second_physical': 272, 'spans': [[257, 6]], 'destination_offsets': [0], 'byte_addresses': [257, 258, 259, 260, 261, 262]})]}
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{'byte_addresses': [61, 62, 63, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 61, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'virtual_start': 13}{'byte_addresses': [61, 62, 63, 112, 113, 114], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 0, 'first_physical': 61, 'page_offset': 13, 'remaining': 3, 'second_physical': 112, 'spans': [[61, 3], [112, 3]], 'virtual_start': 13}Passed
layout fixture 2{'byte_addresses': [36, 37, 38, 39, 40, 41], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 36, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[36, 6]], 'virtual_start': 68}{'byte_addresses': [36, 37, 38, 39, 40, 41], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 4, 'first_physical': 36, 'page_offset': 4, 'remaining': 0, 'second_physical': 160, 'spans': [[36, 6]], 'virtual_start': 68}Passed
layout fixture 3{'byte_addresses': [155, 156, 157, 158, 159, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 155, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'virtual_start': 123}{'byte_addresses': [155, 156, 157, 158, 159, 96], 'destination_offsets': [0, 5], 'first_bytes': 5, 'first_page': 7, 'first_physical': 155, 'page_offset': 11, 'remaining': 1, 'second_physical': 96, 'spans': [[155, 5], [96, 1]], 'virtual_start': 123}Passed
layout fixture 4{'byte_addresses': [127, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 127, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'virtual_start': 31}{'byte_addresses': [127, 16, 17, 18, 19, 20], 'destination_offsets': [0, 1], 'first_bytes': 1, 'first_page': 1, 'first_physical': 127, 'page_offset': 15, 'remaining': 5, 'second_physical': 16, 'spans': [[127, 1], [16, 5]], 'virtual_start': 31}Passed
layout fixture 5{'byte_addresses': [166, 167, 168, 169, 170, 171], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 166, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[166, 6]], 'virtual_start': 86}{'byte_addresses': [166, 167, 168, 169, 170, 171], 'destination_offsets': [0], 'first_bytes': 6, 'first_page': 5, 'first_physical': 166, 'page_offset': 6, 'remaining': 0, 'second_physical': 64, 'spans': [[166, 6]], 'virtual_start': 86}Passed
layout fixture 6{'byte_addresses': [109, 110, 111, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 109, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'virtual_start': 141}{'byte_addresses': [109, 110, 111, 176, 177, 178], 'destination_offsets': [0, 3], 'first_bytes': 3, 'first_page': 8, 'first_physical': 109, 'page_offset': 13, 'remaining': 3, 'second_physical': 176, 'spans': [[109, 3], [176, 3]], 'virtual_start': 141}Passed

SHA-256 / bfc24972b30a3f4076fbbd0a66637df39f0d1a45b59ccd8642ade652ef1dbbe2

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

Case digest / 98f88fb58f4cf35cc9bed42fafa082b6f6ce2e42e21e20917136c6aeb698c853