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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=True
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quote-state fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quote-state fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quote-state fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quote-state fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quote-state fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quote-state fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quote-state fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quote-state fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quote-state fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quote-state fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quote-state fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quote-state fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quote-state fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quote-state fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quote-state fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quote-state fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quote-state fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quote-state fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted = not quoted if current.endswith('b') else True
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quote-state fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('quote-state fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('quote-state fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('quote-state fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('quote-state fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('quote-state fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('quote-state fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('quote-state fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('quote-state fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('quote-state fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('quote-state fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('quote-state fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('quote-state fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('quote-state fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('quote-state fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('quote-state fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('quote-state fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('quote-state fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: closing quotes exit quoted parameter state.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('incomplete-quote fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('incomplete-quote fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('incomplete-quote fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('incomplete-quote fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('incomplete-quote fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('incomplete-quote fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('incomplete-quote fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('incomplete-quote fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted and escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('incomplete-quote fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('incomplete-quote fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('incomplete-quote fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('incomplete-quote fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('incomplete-quote fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('incomplete-quote fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('incomplete-quote fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('incomplete-quote fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('incomplete-quote fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: incomplete quoted boundaries are rejected.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('parameter-name fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('parameter-name fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('parameter-name fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('parameter-name fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('parameter-name fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('parameter-name fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('parameter-name fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('parameter-name fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('parameter-name fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('parameter-name fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('parameter-name fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('parameter-name fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('parameter-name fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('parameter-name fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('parameter-name fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('parameter-name fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('parameter-name fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('parameter-name fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('parameter-name fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('parameter-name fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('parameter-name fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('parameter-name fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('parameter-name fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('parameter-name fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('parameter-name fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('parameter-name fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('parameter-name fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('parameter-name fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('parameter-name fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('parameter-name fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('parameter-name fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('parameter-name fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('parameter-name fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('parameter-name fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('parameter-name fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('parameter-name fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: boundary parameter names are normalized independently of values.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if not boundaries: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate-boundary fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('duplicate-boundary fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('duplicate-boundary fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('duplicate-boundary fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('duplicate-boundary fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('duplicate-boundary fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('duplicate-boundary fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('duplicate-boundary fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if not boundaries or len(set(boundaries))!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate-boundary fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('duplicate-boundary fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('duplicate-boundary fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('duplicate-boundary fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('duplicate-boundary fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('duplicate-boundary fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('duplicate-boundary fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('duplicate-boundary fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('duplicate-boundary fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: duplicate boundary declarations remain ambiguous even when identical.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if not parts[0].strip().lower().startswith('multipart/'): return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('media-type fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('media-type fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('media-type fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('media-type fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('media-type fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('media-type fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('media-type fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('media-type fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('media-type fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('media-type fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('media-type fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('media-type fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('media-type fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('media-type fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('media-type fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('media-type fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('media-type fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('media-type fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower() not in ('multipart/byteranges','multipart/mixed'): return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('media-type fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('media-type fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('media-type fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('media-type fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('media-type fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('media-type fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('media-type fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('media-type fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('media-type fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('media-type fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('media-type fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('media-type fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('media-type fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('media-type fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('media-type fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('media-type fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('media-type fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('media-type fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: a mixed multipart body is not accepted as a byte range body.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if len(value)>12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-boundary fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('empty-boundary fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('empty-boundary fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('empty-boundary fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('empty-boundary fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('empty-boundary fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('empty-boundary fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('empty-boundary fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('empty-boundary fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('empty-boundary fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 0<=len(value)<=12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty-boundary fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('empty-boundary fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('empty-boundary fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('empty-boundary fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('empty-boundary fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('empty-boundary fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('empty-boundary fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('empty-boundary fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('empty-boundary fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('empty-boundary fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('empty-boundary fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: zero-length boundary strings cannot delimit parts.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not value: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-size fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-size fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-size fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-size fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-size fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-size fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-size fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-size fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-size fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-size fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-size fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-size fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-size fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-size fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-size fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-size fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-size fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-size fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<12: return None
    if any(ord(c)<32 or ord(c)>126 for c in value): return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-size fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-size fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-size fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-size fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-size fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-size fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-size fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-size fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-size fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-size fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-size fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-size fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-size fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-size fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-size fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-size fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-size fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-size fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: the local boundary cap counts decoded delimiter characters.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

split: open-access


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

N = 1
observations = []
def solve(x):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if '\r' in value: return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-control fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-control fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-control fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-control fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-control fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-control fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-control fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-control fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-control fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-control fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-control fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-control fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-control fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-control fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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):
    parts=[]
    current=''
    quoted=False
    escaped=False
    for c in x:
        if escaped:
            current+=c
            escaped=False
        elif quoted and c=='\\':
            escaped=True
        elif c=='"':
            quoted=not quoted
        elif c==';' and not quoted:
            parts.append(current)
            current=''
        else:
            current+=c
    if quoted or escaped: return None
    parts.append(current)
    if parts[0].strip().lower()!='multipart/byteranges': return None
    boundaries=[]
    for part in parts[1:]:
        if '=' not in part: continue
        key,value=part.split('=',1)
        if key.strip().lower()=='boundary': boundaries.append(value.strip())
    if len(boundaries)!=1: return None
    value=boundaries[0]
    if not 1<=len(value)<=12: return None
    if '\r' in value or '\n' in value: return None
    return value
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-control fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-control fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-control fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-control fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-control fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-control fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-control fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-control fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-control fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-control fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-control fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-control fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-control fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-control fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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:
Multipart boundary parameter parsing: all control bytes are excluded from the delimiter.

Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.

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+count>len(pack): return None
        for i in range(count):
            at=physical+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('logical-origin 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('logical-origin 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('logical-origin fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('logical-origin 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('logical-origin 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('logical-origin fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('logical-origin 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): return None
        for i in range(count):
            at=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('logical-origin 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('logical-origin 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('logical-origin fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('logical-origin 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('logical-origin 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('logical-origin fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-origin fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('logical-origin 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: logical placement uses extent logical base rather than pack offset.

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+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[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('physical-origin 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('physical-origin 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('physical-origin fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('physical-origin 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('physical-origin 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('physical-origin fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('physical-origin 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): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[(logical+i)%len(pack)]
    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('physical-origin 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('physical-origin 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('physical-origin fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('physical-origin 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('physical-origin 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('physical-origin fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('physical-origin fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('physical-origin 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: backing reads include the physical prefix within each pack.

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+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 sorted(x['requested']))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('request-order 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('request-order 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('request-order fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('request-order 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('request-order 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('request-order fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('request-order fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('request-order fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('request-order 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): 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 sorted(set(x['requested'])))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('request-order 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('request-order 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('request-order fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('request-order 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('request-order 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('request-order fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('request-order fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('request-order fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('request-order fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('request-order 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: out-of-order ranges retain their requested byte order.

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+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    return ''.join(cells.get(at,'') for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-byte 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('missing-byte 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('missing-byte fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('missing-byte 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('missing-byte 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('missing-byte fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('missing-byte 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): return None
        for i in range(count):
            at=logical+i
            if at in cells: return None
            cells[at]=pack[physical+i]
    return ''.join(cells.get(at,'?') for at in x['requested'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-byte 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('missing-byte 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('missing-byte fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('missing-byte 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('missing-byte 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('missing-byte fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('missing-byte fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('missing-byte 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 hole cannot be silently dropped from a requested payload.

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+count>len(pack): return None
        for i in range(count):
            at=logical+i
            if False: 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('logical-ownership 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('logical-ownership 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('logical-ownership fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('logical-ownership 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('logical-ownership 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('logical-ownership fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('logical-ownership 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): return None
        for i in range(count):
            at=logical+i
            if at in cells and cells[at]!=pack[physical+i]: 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('logical-ownership 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('logical-ownership 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('logical-ownership fixture 2', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,3]],'requested':[0,3]}))), json.loads(json.dumps(None)))
check('logical-ownership 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('logical-ownership 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('logical-ownership fixture 5', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[-1,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 6', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',-1,1]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 7', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',0,-1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 8', json.loads(json.dumps(solve({'packs':{},'extents':[[0,'a',0,1]],'requested':[]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 9', json.loads(json.dumps(solve({'packs':{'a':'abc'},'extents':[[0,'a',2,2]],'requested':[0]}))), json.loads(json.dumps(None)))
check('logical-ownership fixture 10', json.loads(json.dumps(solve({'packs':{},'extents':[],'requested':[]}))), json.loads(json.dumps('')))
check('logical-ownership 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: overlapping extent ownership is rejected even for identical bytes.

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