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

N = 1
observations = []
def solve(x, y=None):
    return [i for i,v in enumerate(x) if v not in x[:i]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [0])
check('two distinct elements', solve(['a', 'b']), [0, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [1, 2, 3])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return list(range(len(x)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [0])
check('two distinct elements', solve(['a', 'b']), [0, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [1, 2, 3])
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 operation returns a result or retained state that violates this contract: Return positions at which each distinct value last appears, ordered by position.

Return positions at which each distinct value last appears, ordered by position. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [x[:i+1].count(v) for i,v in enumerate(x)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [1])
check('two distinct elements', solve(['a', 'b']), [1, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [2, 1, 2, 1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(x, y=None):
    return [x.count(v) for v in dict.fromkeys(x)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [1])
check('two distinct elements', solve(['a', 'b']), [1, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [2, 1, 2, 1])
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 operation returns a result or retained state that violates this contract: Return the full-list occurrence count corresponding to each original element.

Return the full-list occurrence count corresponding to each original element. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [x.count(v) for v in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [1])
check('two distinct elements', solve(['a', 'b']), [1, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [1, 1, 2, 1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [x[:i].count(v) for i,v in enumerate(x)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty collection', solve([]), [])
check('singleton collection', solve(['a']), [1])
check('two distinct elements', solve(['a', 'b']), [1, 1])
check('nonadjacent duplicate and unsorted order', solve(['b', 'a', 'b', 'c']), [1, 1, 2, 1])
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 operation returns a result or retained state that violates this contract: Return each occurrence ordinal within its equal-value subsequence, starting at one.

Return each occurrence ordinal within its equal-value subsequence, starting at one. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return y+x
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'b', 'b', 'c', 'c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return list(dict.fromkeys(x+y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'b', 'b', 'c', 'c'])
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 operation returns a result or retained state that violates this contract: Concatenate left then right, retaining every occurrence.

Concatenate left then right, retaining every occurrence. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return sorted(set(x+y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return list(dict.fromkeys(y+x))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'a', 'c'])
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 operation returns a result or retained state that violates this contract: Return unique union values in first appearance order across left then right.

Return unique union values in first appearance order across left then right. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in x if v in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b'])
check('operand ordering differs', solve(['b','a'], ['a','b']), ['b','a'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in dict.fromkeys(y) if v in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b'])
check('operand ordering differs', solve(['b','a'], ['a','b']), ['b','a'])
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 operation returns a result or retained state that violates this contract: Return unique left values also present in right, preserving left first-appearance order.

Return unique left values also present in right, preserving left first-appearance order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return list(dict.fromkeys(v for v in x if v in y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in y if v in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'b'])
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 operation returns a result or retained state that violates this contract: Retain every left occurrence whose value occurs anywhere in right.

Retain every left occurrence whose value occurs anywhere in right. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in x if v not in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a'])
check('unmatched duplicate collapses', solve(['a','a'], []), ['a'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in dict.fromkeys(y) if v not in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a'])
check('unmatched duplicate collapses', solve(['a','a'], []), ['a'])
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 operation returns a result or retained state that violates this contract: Return distinct left values absent from right, preserving first appearance order.

Return distinct left values absent from right, preserving first appearance order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in dict.fromkeys(x) if v not in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a'])
check('unmatched duplicate remains', solve(['a','a'], []), ['a','a'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in y if v not in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a'])
check('unmatched duplicate remains', solve(['a','a'], []), ['a','a'])
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 operation returns a result or retained state that violates this contract: Retain all left occurrences with no equal value in right.

Retain all left occurrences with no equal value in right. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return list(dict.fromkeys(x+y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a', 'c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in dict.fromkeys(x) if v not in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['a', 'c'])
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 operation returns a result or retained state that violates this contract: Return left-only then right-only unique values in their respective first-appearance orders.

Return left-only then right-only unique values in their respective first-appearance orders. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [[a,b] for b in y for a in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [[a,b] for a,b in zip(x,y)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['b', 'c'], ['b', 'c'], ['a', 'b'], ['a', 'c'], ['a', 'c'], ['b', 'b'], ['b', 'c'], ['b', 'c']])
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 operation returns a result or retained state that violates this contract: Emit all ordered pairs in left-major, right-minor order, retaining duplicates.

Emit all ordered pairs in left-major, right-minor order, retaining duplicates. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [[a,y[0]] for a in x] if y else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['a', 'c'], ['b', 'c']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [[a,b] for a in x for b in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [])
check('empty left operand', solve([], ['b']), [])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['a', 'c'], ['b', 'c']])
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 operation returns a result or retained state that violates this contract: Zip corresponding positions and stop at the shorter operand.

Zip corresponding positions and stop at the shorter operand. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [[a,b] for a,b in zip(x,y)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [['a', None]])
check('empty left operand', solve([], ['b']), [[None, 'b']])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['a', 'c'], ['b', 'c']])
check('padding must not cycle shorter side', solve(['a'], ['b','c']), [['a','b'],[None,'c']])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [[x[i%len(x)] if x else None,y[i%len(y)] if y else None] for i in range(max(len(x),len(y)))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), [['a', None]])
check('empty left operand', solve([], ['b']), [[None, 'b']])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), [['b', 'b'], ['a', 'c'], ['b', 'c']])
check('padding must not cycle shorter side', solve(['a'], ['b','c']), [['a','b'],[None,'c']])
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 operation returns a result or retained state that violates this contract: Zip to the longer operand, using None for absent positions.

Zip to the longer operand, using None for absent positions. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [v for pair in zip(x,y) for v in pair]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'b', 'a', 'c', 'b', 'c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return x+y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), [])
check('empty right operand', solve(['a'], []), ['a'])
check('empty left operand', solve([], ['b']), ['b'])
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), ['b', 'b', 'a', 'c', 'b', 'c'])
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 operation returns a result or retained state that violates this contract: Alternate left and right elements and retain the longer trailing suffix.

Alternate left and right elements and retain the longer trailing suffix. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return all(v in x for v in y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gapped subsequence succeeds', solve(['a','b','c'], ['a','c']), True)
check('reusing occurrence is forbidden', solve(['a'], ['a','a']), 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(x, y=None):
    return any(x[i:i+len(y)]==y for i in range(len(x)+1))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gapped subsequence succeeds', solve(['a','b','c'], ['a','c']), True)
check('reusing occurrence is forbidden', solve(['a'], ['a','a']), 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 operation returns a result or retained state that violates this contract: Return whether right is an order-preserving, multiplicity-respecting subsequence of left.

Return whether right is an order-preserving, multiplicity-respecting subsequence of left. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return all(v in x for v in y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gaps are not contiguous', solve(['a','b','c'], ['a','c']), 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(x, y=None):
    return any(x[i:i+len(y)]==y for i in range(len(x)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('gaps are not contiguous', solve(['a','b','c'], ['a','c']), 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 operation returns a result or retained state that violates this contract: Return whether right occurs as a contiguous sublist of left; empty right is always present.

Return whether right occurs as a contiguous sublist of left; empty right is always present. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return all(v in x for v in y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('interior is not prefix', solve(['b','a'], ['a']), 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(x, y=None):
    return x[-len(y):]==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('interior is not prefix', solve(['b','a'], ['a']), 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 operation returns a result or retained state that violates this contract: Return whether right is a positional prefix of left.

Return whether right is a positional prefix of left. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return x[-len(y):]==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('nonprefix suffix matches', solve(['b','a'], ['a']), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return x[:len(y)]==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('nonprefix suffix matches', solve(['b','a'], ['a']), True)
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 operation returns a result or retained state that violates this contract: Return whether right is a positional suffix of left, with empty right always matching.

Return whether right is a positional suffix of left, with empty right always matching. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return x != y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), True)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('overlap at different positions', solve(['a','b'], ['b','c']), 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(x, y=None):
    return all(a != b for a,b in zip(x,y))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), True)
check('empty left operand', solve([], ['b']), True)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('overlap at different positions', solve(['a','b'], ['b','c']), 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 operation returns a result or retained state that violates this contract: Return true exactly when the operands share no value.

Return true exactly when the operands share no value. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return all(v in y for v in x)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), True)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('equal bags are contained', solve(['a'], ['a']), True)
check('membership does not imply enough copies', solve(['a','a'], ['a','b']), 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(x, y=None):
    return set(x)<set(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), True)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('equal bags are contained', solve(['a'], ['a']), True)
check('membership does not imply enough copies', solve(['a','a'], ['a','b']), 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 operation returns a result or retained state that violates this contract: Return whether every left occurrence can be matched to a distinct equal right occurrence.

Return whether every left occurrence can be matched to a distinct equal right occurrence. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return set(x)==set(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('permutation is unequal', solve(['a','b'], ['b','a']), 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(x, y=None):
    return sorted(x)==sorted(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('permutation is unequal', solve(['a','b'], ['b','a']), 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 operation returns a result or retained state that violates this contract: Return true only when both lists have the same values at the same positions.

Return true only when both lists have the same values at the same positions. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return x==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('permutation is equal bag', solve(['a','b'], ['b','a']), True)
check('count mismatch differs', solve(['a','a'], ['a']), 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(x, y=None):
    return set(x)==set(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('permutation is equal bag', solve(['a','b'], ['b','a']), True)
check('count mismatch differs', solve(['a','a'], ['a']), 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 operation returns a result or retained state that violates this contract: Return true for equal occurrence counts regardless of positional order.

Return true for equal occurrence counts regardless of positional order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return x==y
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('duplicate count ignored', solve(['a','a'], ['a']), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return sorted(x)==sorted(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('both empty', solve([], []), True)
check('empty right operand', solve(['a'], []), False)
check('empty left operand', solve([], ['b']), False)
check('overlap and multiplicity', solve(['b', 'a', 'b'], ['b', 'c', 'c']), False)
check('duplicate count ignored', solve(['a','a'], ['a']), True)
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 operation returns a result or retained state that violates this contract: Return true for equal member sets regardless of counts and order.

Return true for equal member sets regardless of counts and order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a.insert(max(0,y[0]),y[1]); return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('relative negative', solve(['a', 'b'], [-1, 'c']), ['a', 'c', 'b'])
check('underflow clamps', solve(['a', 'b'], [-9, 'c']), ['c', 'a', 'b'])
check('overflow appends', solve(['a', 'b'], [9, 'c']), ['a', 'b', 'c'])
check('empty accepts', solve([], [0, 'c']), ['c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a.insert(y[0]%len(a) if a else 0,y[1]); return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('relative negative', solve(['a', 'b'], [-1, 'c']), ['a', 'c', 'b'])
check('underflow clamps', solve(['a', 'b'], [-9, 'c']), ['c', 'a', 'b'])
check('overflow appends', solve(['a', 'b'], [9, 'c']), ['a', 'b', 'c'])
check('empty accepts', solve([], [0, 'c']), ['c'])
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 operation returns a result or retained state that violates this contract: Insert a value using Python positional insertion: negative offsets are relative to length and clamp at zero.

Insert a value using Python positional insertion: negative offsets are relative to length and clamp at zero. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [v for v in x if v != y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separated duplicates', solve(['a', 'b', 'a'], 'a'), ['b', 'a'])
check('missing', solve(['a'], 'z'), ['a'])
check('empty', solve([], 'z'), [])
check('only match', solve(['a'], 'a'), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x)
    if y in a: a.pop(len(a)-1-a[::-1].index(y))
    return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('separated duplicates', solve(['a', 'b', 'a'], 'a'), ['b', 'a'])
check('missing', solve(['a'], 'z'), ['a'])
check('empty', solve([], 'z'), [])
check('only match', solve(['a'], 'a'), [])
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 operation returns a result or retained state that violates this contract: Remove the first equal value, leaving later equal occurrences intact; missing value is a no-op.

Remove the first equal value, leaving later equal occurrences intact; missing value is a no-op. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [y[1] if v==x[y[0]] else v for v in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate identity', solve(['a', 'b', 'a'], [0, 'c']), ['c', 'b', 'a'])
check('negative index', solve(['a', 'b'], [-1, 'c']), ['a', 'c'])
check('singleton', solve(['a'], [0, 'c']), ['c'])
check('same replacement', solve(['a', 'b'], [1, 'b']), ['a', 'b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a.insert(y[0],y[1]); return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate identity', solve(['a', 'b', 'a'], [0, 'c']), ['c', 'b', 'a'])
check('negative index', solve(['a', 'b'], [-1, 'c']), ['a', 'c'])
check('singleton', solve(['a'], [0, 'c']), ['c'])
check('same replacement', solve(['a', 'b'], [1, 'b']), ['a', 'b'])
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 operation returns a result or retained state that violates this contract: Replace exactly the selected valid positional item, not every equal item.

Replace exactly the selected valid positional item, not every equal item. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a[y[0]:y[1]+1]=y[2]; return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('exclusive end', solve(['a', 'b', 'c'], [1, 2, ['d']]), ['a', 'd', 'c'])
check('insert empty range', solve(['a', 'b'], [1, 1, ['d']]), ['a', 'd', 'b'])
check('delete range', solve(['a', 'b'], [0, 2, []]), [])
check('empty splice', solve([], [0, 0, ['d']]), ['d'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a[y[0]:y[0]]=y[2]; return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('exclusive end', solve(['a', 'b', 'c'], [1, 2, ['d']]), ['a', 'd', 'c'])
check('insert empty range', solve(['a', 'b'], [1, 1, ['d']]), ['a', 'd', 'b'])
check('delete range', solve(['a', 'b'], [0, 2, []]), [])
check('empty splice', solve([], [0, 0, ['d']]), ['d'])
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 operation returns a result or retained state that violates this contract: Replace the half-open positional slice with all supplied elements, allowing length changes.

Replace the half-open positional slice with all supplied elements, allowing length changes. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); v=a[y]; a.remove(v); return [v,a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('pop second duplicate', solve(['a', 'b', 'a'], 2), ['a', ['a', 'b']])
check('pop front', solve(['a', 'b'], 0), ['a', ['b']])
check('negative index', solve(['a', 'b'], -1), ['b', ['a']])
check('singleton', solve(['a'], 0), ['a', []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); v=a.pop(); return [v,a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('pop second duplicate', solve(['a', 'b', 'a'], 2), ['a', ['a', 'b']])
check('pop front', solve(['a', 'b'], 0), ['a', ['b']])
check('negative index', solve(['a', 'b'], -1), ['b', ['a']])
check('singleton', solve(['a'], 0), ['a', []])
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 operation returns a result or retained state that violates this contract: Pop a valid index and return [removed value, remaining list].

Pop a valid index and return [removed value, remaining list]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a[:len(y[1])]=y[1]; return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('alternating positions', solve(['a', 'b', 'c', 'd'], [2, ['x', 'y']]), ['x', 'b', 'y', 'd'])
check('stride one', solve(['a', 'b'], [1, ['x', 'y']]), ['x', 'y'])
check('empty selection', solve([], [2, []]), [])
check('large stride', solve(['a', 'b'], [8, ['x']]), ['x', 'b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); a[1::y[0]]=y[1][:len(a[1::y[0]])]; return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('alternating positions', solve(['a', 'b', 'c', 'd'], [2, ['x', 'y']]), ['x', 'b', 'y', 'd'])
check('stride one', solve(['a', 'b'], [1, ['x', 'y']]), ['x', 'y'])
check('empty selection', solve([], [2, []]), [])
check('large stride', solve(['a', 'b'], [8, ['x']]), ['x', 'b'])
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 operation returns a result or retained state that violates this contract: Replace values at the selected positive stride positions; replacement length matches selected length.

Replace values at the selected positive stride positions; replacement length matches selected length. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x)
    for i in range(0,len(x),y):
        if i<len(a): a.pop(i)
    return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positions shift after pop', solve(['a', 'b', 'c', 'd', 'e'], 2), ['b', 'd'])
check('remove all', solve(['a', 'b'], 1), [])
check('empty', solve([], 2), [])
check('large step', solve(['a', 'b', 'c'], 8), ['b', 'c'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return x[1::y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positions shift after pop', solve(['a', 'b', 'c', 'd', 'e'], 2), ['b', 'd'])
check('remove all', solve(['a', 'b'], 1), [])
check('empty', solve([], 2), [])
check('large step', solve(['a', 'b', 'c'], 8), ['b', 'c'])
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 operation returns a result or retained state that violates this contract: Delete all original positions selected by a positive stride in one operation.

Delete all original positions selected by a positive stride in one operation. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return list(x)+list(y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested list', solve(['a'], ['b', 'c']), ['a', ['b', 'c']])
check('empty nested list', solve([], []), [[]])
check('string is one item', solve([], 'ab'), ['ab'])
check('empty string retained', solve(['a'], ''), ['a', ''])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return list(x)+([y] if y else [])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested list', solve(['a'], ['b', 'c']), ['a', ['b', 'c']])
check('empty nested list', solve([], []), [[]])
check('string is one item', solve([], 'ab'), ['ab'])
check('empty string retained', solve(['a'], ''), ['a', ''])
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 operation returns a result or retained state that violates this contract: Append the provided value as one item, even if it is a list.

Append the provided value as one item, even if it is a list. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return list(x)+[y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('flat extension', solve(['a'], ['b', 'c']), ['a', 'b', 'c'])
check('nested stays nested', solve([], [['a'], 'b']), [['a'], 'b'])
check('empty extension', solve(['a'], []), ['a'])
check('string iteration', solve([], 'ab'), ['a', 'b'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return list(x)+[z for v in y for z in (v if isinstance(v,list) else [v])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('flat extension', solve(['a'], ['b', 'c']), ['a', 'b', 'c'])
check('nested stays nested', solve([], [['a'], 'b']), [['a'], 'b'])
check('empty extension', solve(['a'], []), ['a'])
check('string iteration', solve([], 'ab'), ['a', 'b'])
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 operation returns a result or retained state that violates this contract: Extend by the iterable elements, without recursively flattening nested elements.

Extend by the iterable elements, without recursively flattening nested elements. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); alias=a; a=[]; return [a,alias]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('populated alias', solve(['a', 'b']), [[], []])
check('singleton alias', solve(['a']), [[], []])
check('already empty', solve([]), [[], []])
check('duplicates', solve(['a', 'a']), [[], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=list(x); alias=a; a=a[:0]; return [a,alias]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('populated alias', solve(['a', 'b']), [[], []])
check('singleton alias', solve(['a']), [[], []])
check('already empty', solve([]), [[], []])
check('duplicates', solve(['a', 'a']), [[], []])
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 operation returns a result or retained state that violates this contract: Clear the list in place so an existing alias observes an empty list; return [target,alias].

Clear the list in place so an existing alias observes an empty list; return [target,alias]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return x.get(y[0]) or y[1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero value', solve({'a': 0}, ['a', 'fallback']), 0)
check('None value', solve({'a': None}, ['a', 'fallback']), None)
check('false value', solve({'a': False}, ['a', 'fallback']), False)
check('missing key', solve({}, ['a', 'fallback']), 'fallback')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return x.get(y[0],y[1]) if x.get(y[0]) is not None else y[1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero value', solve({'a': 0}, ['a', 'fallback']), 0)
check('None value', solve({'a': None}, ['a', 'fallback']), None)
check('false value', solve({'a': False}, ['a', 'fallback']), False)
check('missing key', solve({}, ['a', 'fallback']), 'fallback')
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 operation returns a result or retained state that violates this contract: Look up a key and use the fallback only when absent; falsy present values are retained.

Look up a key and use the fallback only when absent; falsy present values are retained. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); a[y[0]]=y[1]; return [y[1],a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('existing None', solve({'a': None}, ['a', 'd']), [None, {'a': None}])
check('existing scalar', solve({'a': 'v'}, ['a', 'd']), ['v', {'a': 'v'}])
check('absent key', solve({}, ['a', 'd']), ['d', {'a': 'd'}])
check('existing false', solve({'a': False}, ['a', 'd']), [False, {'a': 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(x, y=None):
    a=dict(x)
    if a.get(y[0]) is None: a[y[0]]=y[1]
    return [a[y[0]],a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('existing None', solve({'a': None}, ['a', 'd']), [None, {'a': None}])
check('existing scalar', solve({'a': 'v'}, ['a', 'd']), ['v', {'a': 'v'}])
check('absent key', solve({}, ['a', 'd']), ['d', {'a': 'd'}])
check('existing false', solve({'a': False}, ['a', 'd']), [False, {'a': 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 operation returns a result or retained state that violates this contract: Insert the default only for an absent key; return [selected value,map].

Insert the default only for an absent key; return [selected value,map]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); v=a.get(y[0],y[1]); return [v,a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present value', solve({'a': 'v'}, ['a', 'd']), ['v', {}])
check('present zero', solve({'a': 0}, ['a', 'd']), [0, {}])
check('missing', solve({'b': 'v'}, ['a', 'd']), ['d', {'b': 'v'}])
check('present None', solve({'a': None}, ['a', 'd']), [None, {}])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); v=a.pop(y[0],y[1]); return [v or y[1],a]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('present value', solve({'a': 'v'}, ['a', 'd']), ['v', {}])
check('present zero', solve({'a': 0}, ['a', 'd']), [0, {}])
check('missing', solve({'b': 'v'}, ['a', 'd']), ['d', {'b': 'v'}])
check('present None', solve({'a': None}, ['a', 'd']), [None, {}])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The operation returns a result or retained state that violates this contract: Pop a key if present and return [value,remaining map], using fallback only when absent.

Pop a key if present and return [value,remaining map], using fallback only when absent. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(y); a.update(x); return list(map(list,a.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overwrite and insert', solve({'a': 1, 'b': 2}, {'a': 3, 'c': 4}), [['a', 3], ['b', 2], ['c', 4]])
check('empty left', solve({}, {'a': 1}), [['a', 1]])
check('empty right', solve({'a': 1}, {}), [['a', 1]])
check('None overwrite', solve({'a': 1}, {'a': None}), [['a', None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [[k,v] for k,v in x.items()]+[[k,v] for k,v in y.items() if k not in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('overwrite and insert', solve({'a': 1, 'b': 2}, {'a': 3, 'c': 4}), [['a', 3], ['b', 2], ['c', 4]])
check('empty left', solve({}, {'a': 1}), [['a', 1]])
check('empty right', solve({'a': 1}, {}), [['a', 1]])
check('None overwrite', solve({'a': 1}, {'a': None}), [['a', None]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The operation returns a result or retained state that violates this contract: Update existing keys from the right map while retaining left insertion positions and appending new right keys.

Update existing keys from the right map while retaining left insertion positions and appending new right keys. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); a[y[0]]=y[1]; return list(map(list,a.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('existing first moves', solve({'a': 1, 'b': 2}, ['a', 3]), [['b', 2], ['a', 3]])
check('absent appends', solve({'a': 1}, ['b', 2]), [['a', 1], ['b', 2]])
check('empty inserts', solve({}, ['a', 1]), [['a', 1]])
check('last replaces', solve({'a': 1}, ['a', 2]), [['a', 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); a.pop(y[0],None); return list(map(list,a.items()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('existing first moves', solve({'a': 1, 'b': 2}, ['a', 3]), [['b', 2], ['a', 3]])
check('absent appends', solve({'a': 1}, ['b', 2]), [['a', 1], ['b', 2]])
check('empty inserts', solve({}, ['a', 1]), [['a', 1]])
check('last replaces', solve({'a': 1}, ['a', 2]), [['a', 2]])
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 operation returns a result or retained state that violates this contract: Delete a key if present, then insert its new value at the end of insertion order.

Delete a key if present, then insert its new value at the end of insertion order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); v=list(a.popitem()) if a else None; return [v,list(map(list,a.items()))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('insertion beats lexical', solve({'b': 2, 'a': 1}), [['b', 2], [['a', 1]]])
check('empty', solve({}), [None, []])
check('singleton', solve({'a': 1}), [['a', 1], []])
check('three items', solve({'c': 3, 'a': 1, 'b': 2}), [['c', 3], [['a', 1], ['b', 2]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); k=min(a) if a else None; v=[k,a.pop(k)] if a else None; return [v,list(map(list,a.items()))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('insertion beats lexical', solve({'b': 2, 'a': 1}), [['b', 2], [['a', 1]]])
check('empty', solve({}), [None, []])
check('singleton', solve({'a': 1}), [['a', 1], []])
check('three items', solve({'c': 3, 'a': 1, 'b': 2}), [['c', 3], [['a', 1], ['b', 2]]])
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 operation returns a result or retained state that violates this contract: Remove and return the earliest inserted item, or None if empty; return [item,remainder items].

Remove and return the earliest inserted item, or None if empty; return [item,remainder items]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); k=next(iter(a)) if a else None; v=[k,a.pop(k)] if a else None; return [v,list(map(list,a.items()))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('insertion beats lexical', solve({'b': 2, 'a': 1}), [['a', 1], [['b', 2]]])
check('empty', solve({}), [None, []])
check('singleton', solve({'a': 1}), [['a', 1], []])
check('three items', solve({'c': 3, 'a': 1, 'b': 2}), [['b', 2], [['c', 3], ['a', 1]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a=dict(x); k=max(a) if a else None; v=[k,a.pop(k)] if a else None; return [v,list(map(list,a.items()))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('insertion beats lexical', solve({'b': 2, 'a': 1}), [['a', 1], [['b', 2]]])
check('empty', solve({}), [None, []])
check('singleton', solve({'a': 1}), [['a', 1], []])
check('three items', solve({'c': 3, 'a': 1, 'b': 2}), [['b', 2], [['c', 3], ['a', 1]]])
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 operation returns a result or retained state that violates this contract: Remove and return the most recently inserted item, or None if empty; return [item,remainder items].

Remove and return the most recently inserted item, or None if empty; return [item,remainder items]. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return {v:[k] for k,v in x.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collision preserves both', solve({'a': 'v', 'b': 'v'}), {'v': ['a', 'b']})
check('distinct values', solve({'a': 'v', 'b': 'w'}), {'v': ['a'], 'w': ['b']})
check('empty', solve({}), {})
check('three-way collision', solve({'c': 'v', 'a': 'v', 'b': 'v'}), {'v': ['c', 'a', 'b']})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    a={}
    for k,v in x.items(): a.setdefault(v,[]).insert(0,k)
    return a
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collision preserves both', solve({'a': 'v', 'b': 'v'}), {'v': ['a', 'b']})
check('distinct values', solve({'a': 'v', 'b': 'w'}), {'v': ['a'], 'w': ['b']})
check('empty', solve({}), {})
check('three-way collision', solve({'c': 'v', 'a': 'v', 'b': 'v'}), {'v': ['c', 'a', 'b']})
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 operation returns a result or retained state that violates this contract: Invert the map into value-to-key-lists, preserving all keys and their insertion order.

Invert the map into value-to-key-lists, preserving all keys and their insertion order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return [[k,v] for k,v in x.items() if v in y]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('key differs from value', solve({'a': 'b', 'b': 'c'}, ['a']), [['a', 'b']])
check('allowed order ignored', solve({'a': 1, 'b': 2}, ['b', 'a']), [['a', 1], ['b', 2]])
check('empty filter', solve({'a': 1}, []), [])
check('empty map', solve({}, ['a']), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [[k,x[k]] for k in y if k in x]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('key differs from value', solve({'a': 'b', 'b': 'c'}, ['a']), [['a', 'b']])
check('allowed order ignored', solve({'a': 1, 'b': 2}, ['b', 'a']), [['a', 1], ['b', 2]])
check('empty filter', solve({'a': 1}, []), [])
check('empty map', solve({}, ['a']), [])
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 operation returns a result or retained state that violates this contract: Keep entries whose keys occur in the supplied allowed-key list, retaining map insertion order.

Keep entries whose keys occur in the supplied allowed-key list, retaining map insertion order. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    return list(dict.fromkeys(x.values()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate values', solve({'a': 'v', 'b': 'v'}), ['v', 'v'])
check('nonlexical keys', solve({'b': 'v', 'a': 'w'}), ['v', 'w'])
check('empty', solve({}), [])
check('None value', solve({'a': None}), [None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    return [x[k] for k in sorted(x)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate values', solve({'a': 'v', 'b': 'v'}), ['v', 'v'])
check('nonlexical keys', solve({'b': 'v', 'a': 'w'}), ['v', 'w'])
check('empty', solve({}), [])
check('None value', solve({'a': None}), [None])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The operation returns a result or retained state that violates this contract: Return map values in key insertion order, retaining duplicate values.

Return map values in key insertion order, retaining duplicate values. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=arg in h and k not in h
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=h.get(arg)=='owner' and not destroyed
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
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 operation returns a result or retained state that violates this contract: A local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Cloning requires an owning source and a fresh destination handle.

A local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Cloning requires an owning source and a fresh destination handle. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access


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

N = 1
observations = []
def solve(x, y=None):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=arg in h and k not in h
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(x, y=None):
    h={'root':'owner'}; destroyed=False; out=[]
    for op,k,arg in x:
        owners=lambda: sum(v=='owner' for v in h.values())
        if op=='clone':
            ok=h.get(arg)=='owner' and k not in h and not destroyed
            if ok: h[k]='owner'
            out.append(ok)
        elif op=='borrow':
            ok=h.get(arg)=='owner' and not destroyed
            if ok: h[k]='borrow'
            out.append(ok)
        elif op=='weak':
            ok=k not in h
            if ok: h[k]='weak'
            out.append(ok)
        elif op=='upgrade':
            ok=h.get(k)=='weak' and owners()>0 and arg not in h and not destroyed
            if ok: h[arg]='owner'
            out.append(ok)
        elif op=='drop':
            existed=k in h
            kind=h.pop(k,None)
            if kind=='owner' and owners()==0: destroyed=True
            out.append(existed)
        elif op=='move':
            ok=k in h and arg not in h
            if ok:
                h[arg]=h[k]
                del h[k]
            out.append(ok)
        elif op=='use':
            out.append(h.get(k) in ('owner','borrow') and owners()>0 and not destroyed)
        elif op=='unique':
            out.append(h.get(k)=='owner' and owners()==1 and not destroyed)
        elif op=='inspect':
            out.append([owners(),destroyed,sorted(h)])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('borrow cannot clone or outlive resource', solve([['borrow', 'b', 'root'], ['clone', 'c', 'b'], ['weak', 'w', None], ['use', 'w', None], ['unique', 'root', None], ['unique', 'b', None], ['drop', 'root', None], ['use', 'b', None], ['upgrade', 'w', 'c'], ['inspect', None, None]]), [True, False, True, False, True, False, True, False, False, [0, True, ['b', 'w']]])
check('clones prevent premature destruction', solve([['clone', 'c', 'root'], ['drop', 'root', None], ['use', 'c', None], ['inspect', None, None], ['drop', 'c', None], ['inspect', None, None]]), [True, True, True, [1, False, ['c']], True, [0, True, []]])
check('destination collisions preserve all handles', solve([['clone', 'c', 'root'], ['borrow', 'b', 'root'], ['clone', 'b', 'root'], ['borrow', 'c', 'root'], ['weak', 'w', None], ['upgrade', 'w', 'b'], ['move', 'root', 'c'], ['move', 'root', 'root'], ['inspect', None, None]]), [True, True, False, False, True, False, False, False, [2, False, ['b', 'c', 'root', 'w']]])
check('move and borrower release preserve ownership', solve([['borrow', 'b', 'root'], ['drop', 'b', None], ['move', 'root', 'new'], ['use', 'root', None], ['borrow', 'b', 'new'], ['weak', 'w', None], ['upgrade', 'w', 'c'], ['borrow', 'z', 'b'], ['inspect', None, None]]), [True, True, True, False, True, True, True, False, [2, False, ['b', 'c', 'new', 'w']]])
check('weak collision cannot discard owner', solve([['weak','root',None],['inspect',None,None]]), [False,[1,False,['root']]])
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 operation returns a result or retained state that violates this contract: A local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Borrow creation requires an owning source and a fresh handle.

A local shared-ownership model executes [operation,handle,argument] commands. Only owners retain the resource. Output is one result per command; weak and borrowed handles do not retain it. Borrow creation requires an owning source and a fresh handle. Inputs are the finite Python values shown by the executable fixtures; no concurrent execution is assumed.

split: open-access