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

N = 1
observations = []
def solve(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get(c['id']) for c in cols]
        lines.append('\t'.join(text(v) for v in values))
    return '\r\n'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get('_display',{}).get(c['id']) for c in cols]
        lines.append('\t'.join(text(v) for v in values))
    return '\r\n'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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:
The table display value choice result violates the stipulated table clipboard serialization contract.

Serialize selected rows in current table order and copyable visible columns in schema order. Optional labels precede records, display/raw selection is explicit, None is empty while zero is retained, TSV-special cells use doubled quotes, and records use CRLF without a trailing separator.

split: open-access


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

N = 1
observations = []
def solve(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get(c['id']) if raw else r.get('_display',{}).get(c['id'],r.get(c['id'])) for c in cols]
        lines.append('\t'.join(text(v) for v in reversed(values)))
    return '\r\n'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get(c['id']) if raw else r.get('_display',{}).get(c['id'],r.get(c['id'])) for c in cols]
        lines.append('\t'.join(text(v) for v in values if v is not None))
    return '\r\n'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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:
The table column cell order result violates the stipulated table clipboard serialization contract.

Serialize selected rows in current table order and copyable visible columns in schema order. Optional labels precede records, display/raw selection is explicit, None is empty while zero is retained, TSV-special cells use doubled quotes, and records use CRLF without a trailing separator.

split: open-access


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

N = 1
observations = []
def solve(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get(c['id']) if raw else r.get('_display',{}).get(c['id'],r.get(c['id'])) for c in cols]
        lines.append('\t'.join(text(v) for v in values))
    return '\n'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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(rows, columns, selected, hidden, include_headers, raw):
    cols=[c for c in columns if c['id'] not in hidden and c.get('copy',True)]
    rr=[r for r in rows if r['id'] in selected]
    def text(v):
        s='' if v is None else str(v)
        return '"'+s.replace('"','""')+'"' if any(x in s for x in ('\t','\n','"')) else s
    lines=[]
    if include_headers: lines.append('\t'.join(text(c['label']) for c in cols))
    for r in rr:
        values=[r.get(c['id']) if raw else r.get('_display',{}).get(c['id'],r.get(c['id'])) for c in cols]
        lines.append('\t'.join(text(v) for v in values))
    return '\t'.join(lines)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('display selected rows', solve([{'id':'r1','a':1,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 2:
    check('display selected rows', solve([{'id':'r1','a':2,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 3:
    check('display selected rows', solve([{'id':'r1','a':3,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 4:
    check('display selected rows', solve([{'id':'r1','a':4,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

if N == 5:
    check('display selected rows', solve([{'id':'r1','a':5,'b':0,'_display':{'a':'shown'}},{'id':'r2','a':None,'b':'x'}], [{'id':'a','label':'Alpha'},{'id':'b','label':'Beta'}], ['r2','r1'], [], True, False), 'Alpha\tBeta\r\nshown\t0\r\n\tx')
    check('quoted cells', solve([{'id':'r','a':'x"y','b':'line\nnext','c':'x\ty'}], [{'id':'a','label':'A'},{'id':'b','label':'B'},{'id':'c','label':'C'}], ['r'], [], False, True), '"x""y"\t"line\nnext"\t"x\ty"')
    check('hidden private', solve([{'id':'r','a':1,'b':2,'c':3}], [{'id':'a','label':'A'},{'id':'b','label':'B','copy':False},{'id':'c','label':'C'}], ['r'], ['a'], False, True), '3')
    check('raw mode', solve([{'id':'r','a':2,'b':None,'_display':{'a':'two'}}], [{'id':'a','label':'A'},{'id':'b','label':'B'}], ['r'], [], False, True), '2\t')
    check('header-only', solve([], [{'id':'a','label':'Alpha'}], [], [], True, True), 'Alpha')
    check('no selection', solve([{'id':'r','a':1}], [{'id':'a','label':'A'}], [], [], False, False), '')

check('variant formatted clipboard value', solve([{'id':'r','a':N,'_display':{'a':'value'+str(N)}}], [{'id':'a','label':'A'}], ['r'], [], False, False), 'value'+str(N))
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:
The table record separator result violates the stipulated table clipboard serialization contract.

Serialize selected rows in current table order and copyable visible columns in schema order. Optional labels precede records, display/raw selection is explicit, None is empty while zero is retained, TSV-special cells use doubled quotes, and records use CRLF without a trailing separator.

split: open-access


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

N = 1
observations = []
def solve(rows, cols, matrix, start, readonly, hidden, limit):
    targets=list(cols)
    ri=rows.index(start[0]); ci=targets.index(start[1])
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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(rows, cols, matrix, start, readonly, hidden, limit):
    targets=[c for c in cols if c not in hidden[:1]]
    ri=rows.index(start[0]); ci=targets.index(start[1])
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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:
The table hidden paste target result violates the stipulated table clipboard paste mapping contract.

Paste maps source offsets to visible table coordinates starting at a stable cell; source raggedness is retained, table edges clip, readonly holes consume coordinates but not patch capacity, raw values remain unchanged, and truncation means an additional writable patch was omitted.

split: open-access


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

N = 1
observations = []
def solve(rows, cols, matrix, start, readonly, hidden, limit):
    targets=[c for c in cols if c not in hidden]
    ri=0; ci=targets.index(start[1])
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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(rows, cols, matrix, start, readonly, hidden, limit):
    targets=[c for c in cols if c not in hidden]
    ri=max(0,rows.index(start[0])-1); ci=targets.index(start[1])
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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:
The table start row identity result violates the stipulated table clipboard paste mapping contract.

Paste maps source offsets to visible table coordinates starting at a stable cell; source raggedness is retained, table edges clip, readonly holes consume coordinates but not patch capacity, raw values remain unchanged, and truncation means an additional writable patch was omitted.

split: open-access


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

N = 1
observations = []
def solve(rows, cols, matrix, start, readonly, hidden, limit):
    targets=[c for c in cols if c not in hidden]
    ri=rows.index(start[0]); ci=0
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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(rows, cols, matrix, start, readonly, hidden, limit):
    targets=[c for c in cols if c not in hidden]
    ri=rows.index(start[0]); ci=max(0,targets.index(start[1])-1)
    patches=[]; rejected=[]
    for y,source in enumerate(matrix):
        if ri+y>=len(rows): break
        for x,value in enumerate(source):
            if ci+x>=len(targets): break
            cell=(rows[ri+y],targets[ci+x])
            if cell in readonly: rejected.append(cell); continue
            if len(patches)>=limit: return {'patches':patches,'rejected':rejected,'truncated':True}
            patches.append((cell[0],cell[1],value))
    return {'patches':patches,'rejected':rejected,'truncated':False}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 2:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[2,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 2), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 3:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[3,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 3), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 4:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[4,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 4), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

if N == 5:
    check('offset rectangular paste', solve(['r0','r1','r2','r3'], ['a','b','c','d'], [[5,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 5), ('r1', 'c', 2), ('r2', 'b', 3), ('r2', 'c', 4)], 'rejected': [], 'truncated': False})
    check('hidden targets', solve(['r0','r1'], ['a','b','c','d'], [[1,2,3]], ('r0','c'), [], ['a','b'], 9), {'patches': [('r0', 'c', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('readonly holes', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 9), {'patches': [('r0', 'b', 2), ('r1', 'a', 3), ('r1', 'b', 4)], 'rejected': [('r0', 'a')], 'truncated': False})
    check('bounded patches', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r0','a'), [('r0','a')], [], 2), {'patches': [('r0', 'b', 2), ('r1', 'a', 3)], 'rejected': [('r0', 'a')], 'truncated': True})
    check('ragged and whitespace', solve(['r0','r1'], ['a','b','c'], [[0,' x '],['']], ('r0','a'), [], [], 9), {'patches': [('r0', 'a', 0), ('r0', 'b', ' x '), ('r1', 'a', '')], 'rejected': [], 'truncated': False})
    check('clipped edges', solve(['r0','r1'], ['a','b'], [[1,2],[3,4]], ('r1','b'), [], [], 9), {'patches': [('r1', 'b', 1)], 'rejected': [], 'truncated': False})
    check('hidden internal', solve(['r0'], ['a','b','c','d'], [[1,2,3]], ('r0','a'), [], ['b','c'], 9), {'patches': [('r0', 'a', 1), ('r0', 'd', 2)], 'rejected': [], 'truncated': False})
    check('budget no locks', solve(['r0'], ['a','b'], [[1,2]], ('r0','a'), [], [], 1), {'patches': [('r0', 'a', 1)], 'rejected': [], 'truncated': True})
    check('empty input', solve(['r0'], ['a'], [], ('r0','a'), [], [], 0), {'patches': [], 'rejected': [], 'truncated': False})

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:
The table start column identity result violates the stipulated table clipboard paste mapping contract.

Paste maps source offsets to visible table coordinates starting at a stable cell; source raggedness is retained, table edges clip, readonly holes consume coordinates but not patch capacity, raw values remain unchanged, and truncation means an additional writable patch was omitted.

split: open-access