broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0 and handle in x['packs']: continue
        if logical<0 or physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-extent fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('empty-extent fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('empty-extent fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('empty-extent fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('empty-extent fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0 and handle in x['packs'] and logical>=0: continue
        if logical<0 or physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-extent fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('empty-extent fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('empty-extent fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('empty-extent fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('empty-extent fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('empty-extent fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

prompt:
A packed-object origin maps logical byte requests to immutable backing objects: zero-length map entries do not dereference backing handles.

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-logical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-logical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-logical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-logical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-logical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<-1 or physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-logical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-logical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-logical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-logical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-logical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-logical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

prompt:
A packed-object origin maps logical byte requests to immutable backing objects: negative logical mappings cannot create valid object positions.

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-physical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-physical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-physical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-physical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-physical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<-1 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-physical fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-physical fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-physical fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-physical fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-physical fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-physical fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

prompt:
A packed-object origin maps logical byte requests to immutable backing objects: Python negative indices cannot stand in for physical object offsets.

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-count fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-count fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-count fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-count fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-count fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-count fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-count fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<0 or count<-1: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative-count fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('negative-count fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('negative-count fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('negative-count fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('negative-count fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('negative-count fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('negative-count fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('negative-count fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('negative-count fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

prompt:
A packed-object origin maps logical byte requests to immutable backing objects: negative mapped counts are invalid rather than empty spans.

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical>=len(pack): return None
        count=min(count,len(pack)-physical)
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('declared-pack-span fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('declared-pack-span fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('declared-pack-span fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('declared-pack-span fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('declared-pack-span fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cells={}
    for logical,handle,physical,count in x['extents']:
        if count==0: continue
        if logical<0 or physical<0 or count<0: return None
        if handle not in x['packs']: return None
        pack=x['packs'][handle]
        if physical+count>len(pack)+1: return None
        count=min(count,len(pack)-physical)
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    if any(at not in cells for at in x['requested']): return None
    return ''.join(cells[at] for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('declared-pack-span fixture 0', json.loads(json.dumps(solve({'packs':{'a':'QabcZ','b':'RxyzS'},'extents':[[3,'b',1,3],[0,'a',1,3]],'requested':[0,3,1,4,2,5]}))), json.loads(json.dumps('axbycz')))
check('declared-pack-span fixture 1', json.loads(json.dumps(solve({'packs':{'a':'QabcZ'},'extents':[[0,'a',1,3]],'requested':[2,0,2]}))), json.loads(json.dumps('cac')))
check('declared-pack-span fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 3', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3],[1,'a',1,1]],'requested':[1]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 4', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'missing',0,0],[0,'a',0,3]],'requested':[0]}))), json.loads(json.dumps('a')))
check('declared-pack-span fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('declared-pack-span fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('declared-pack-span fixture 11', json.loads(json.dumps(solve({'packs':{'a':"p"*N},'extents':[[0,'a',0,N]],'requested':[0]}))), json.loads(json.dumps('p')))
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)

prompt:
A packed-object origin maps logical byte requests to immutable backing objects: a short backing object invalidates even a requested prefix that exists.

x has pack strings keyed by handle, extent rows [logical-start,handle,physical-start,count], and explicit requested logical offsets. Extents may arrive unordered. Empty extents ignored. Reject negative mapping coordinates, missing handles, out-of-pack spans, or overlapping logical ownership. Return requested characters in request order, retaining repeated requested offsets; unavailable requested offsets yield None. This is a bounded storage adapter underlying HTTP range delivery, not interval normalization.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if False: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('begin-exclusion fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('begin-exclusion fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('begin-exclusion fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('begin-exclusion fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('begin-exclusion fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('begin-exclusion fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('begin-exclusion fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('begin-exclusion fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('begin-exclusion fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None and event[1]==pending[0]: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('begin-exclusion fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('begin-exclusion fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('begin-exclusion fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('begin-exclusion fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('begin-exclusion fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('begin-exclusion fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('begin-exclusion fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('begin-exclusion fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('begin-exclusion fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: a second range admission cannot replace an active writer.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('put-transaction-id fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('put-transaction-id fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('put-transaction-id fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('put-transaction-id fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('put-transaction-id fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('put-transaction-id fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('put-transaction-id fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('put-transaction-id fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('put-transaction-id fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]=='': continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('put-transaction-id fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('put-transaction-id fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('put-transaction-id fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('put-transaction-id fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('put-transaction-id fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('put-transaction-id fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('put-transaction-id fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('put-transaction-id fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('put-transaction-id fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: a stale subrequest cannot contribute to a different admission.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if False: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('requested-membership fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('requested-membership fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('requested-membership fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('requested-membership fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('requested-membership fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('requested-membership fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('requested-membership fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('requested-membership fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('requested-membership fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: pending[1].add(at)
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('requested-membership fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('requested-membership fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('requested-membership fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('requested-membership fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('requested-membership fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('requested-membership fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('requested-membership fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('requested-membership fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('requested-membership fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: unexpected origin bytes do not count as admitted requested cells.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate-conflict fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('duplicate-conflict fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('duplicate-conflict fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('duplicate-conflict fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('duplicate-conflict fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('duplicate-conflict fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('duplicate-conflict fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('duplicate-conflict fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('duplicate-conflict fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending[2][at]=char
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate-conflict fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('duplicate-conflict fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('duplicate-conflict fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('duplicate-conflict fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('duplicate-conflict fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('duplicate-conflict fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('duplicate-conflict fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('duplicate-conflict fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('duplicate-conflict fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: a contradicting duplicate fragment invalidates admission.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-id fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-id fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-id fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-id fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-id fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-id fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-id fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-id fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-id fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or not event[1]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-id fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-id fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-id fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-id fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-id fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-id fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-id fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-id fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-id fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: a completion signal must belong to the active range admission.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if not pending[2] and pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-completeness fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-completeness fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-completeness fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-completeness fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-completeness fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-completeness fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-completeness fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-completeness fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-completeness fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if not set(pending[2]).issubset(pending[1]): continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-completeness fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-completeness fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-completeness fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-completeness fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-completeness fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-completeness fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-completeness fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-completeness fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-completeness fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: a prefix does not prove every promised range cell arrived.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible.update(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('generation-replacement fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('generation-replacement fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('generation-replacement fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('generation-replacement fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('generation-replacement fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('generation-replacement fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('generation-replacement fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('generation-replacement fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('generation-replacement fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible.update(pending[2])
            visible={k:v for k,v in visible.items() if k<=max(visible,default=0)}
            pending=None
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('generation-replacement fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('generation-replacement fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('generation-replacement fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('generation-replacement fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('generation-replacement fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('generation-replacement fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('generation-replacement fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('generation-replacement fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('generation-replacement fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: commit removes old-generation cells outside the new sparse object.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-release fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-release fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-release fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-release fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-release fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-release fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-release fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-release fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-release fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None if pending[2] else pending
        elif op=='abort':
            if pending is not None and event[1]==pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-release fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('commit-release fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-release fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('commit-release fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-release fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('commit-release fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('commit-release fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('commit-release fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('commit-release fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: successful admission releases the active transaction slot.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('abort-identity fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('abort-identity fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('abort-identity fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('abort-identity fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('abort-identity fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('abort-identity fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('abort-identity fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('abort-identity fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('abort-identity fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    visible=dict(x[0])
    pending=None
    reads=[]
    for event in x[1]:
        op=event[0]
        if op=='begin':
            if pending is not None: continue
            pending=[event[1],set(event[2]),{}]
        elif op=='put':
            if pending is None or event[1]!=pending[0]: continue
            at,char=event[2:]
            if at not in pending[1]: continue
            if at in pending[2] and pending[2][at]!=char:
                pending=None
                continue
            pending[2][at]=char
        elif op=='commit':
            if pending is None or event[1]!=pending[0]: continue
            if set(pending[2])!=pending[1]: continue
            visible=dict(pending[2])
            pending=None
        elif op=='abort':
            if pending is not None and event[1]!=pending[0]: pending=None
        elif op=='read':
            reads.append(sorted(visible.items()))
    return [reads,sorted(visible.items()),pending[0] if pending is not None else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('abort-identity fixture 0', json.loads(json.dumps(solve([[[0,'o'],[9,'z']],[['begin','a',[0,1]],['put','a',1,'b'],['read'],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[[0,'o'],[9,'z']],[[0,'a'],[1,'b']]],[[0,'a'],[1,'b']],None])))
check('abort-identity fixture 1', json.loads(json.dumps(solve([[],[['begin','a',[0,1]],['put','a',0,'a'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('abort-identity fixture 2', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','wrong',0,'x'],['put','a',1,'y'],['commit','a'],['read']]]))), json.loads(json.dumps([[[]],[],'a'])))
check('abort-identity fixture 3', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',1,'b'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('abort-identity fixture 4', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'b'],['commit','a']]]))), json.loads(json.dumps([[],[],None])))
check('abort-identity fixture 5', json.loads(json.dumps(solve([[],[['begin','a',[0]],['begin','b',[]],['abort','b'],['put','a',0,'a'],['commit','a']]]))), json.loads(json.dumps([[],[[0,'a']],None])))
check('abort-identity fixture 6', json.loads(json.dumps(solve([[],[['begin','a',[0]],['put','a',0,'a'],['put','a',0,'a'],['commit','wrong'],['read'],['commit','a']]]))), json.loads(json.dumps([[[]],[[0,'a']],None])))
check('abort-identity fixture 7', json.loads(json.dumps(solve([[],[['begin','a',[]],['commit','a'],['begin','b',[N]],['put','b',N,'p'],['commit','b']]]))), json.loads(json.dumps([[],[[N,'p']],None])))
check('abort-identity fixture 8', json.loads(json.dumps(solve([[[0,'o']],[['begin','a',[0]],['put','a',0,'a'],['abort','a'],['read']]]))), json.loads(json.dumps([[[[0,'o']]],[[0,'o']],None])))
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)

prompt:
Partial cache admission publishes complete requested fragments atomically: an old subrequest abort cannot cancel a newer admission.

x is [old-visible-cells,events]. Events begin(id,expected-offsets), put(id,offset,char), commit(id), abort(id), read. One transaction at a time; unknown or mismatching ids ignored. A conflicting duplicate byte invalidates the active transaction. Commit succeeds only when every expected cell is present and replaces the old generation. Readers see committed cells sorted by offset. Return [read-snapshots,final-cells,pending-id].

split: open-access