broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(w, h):
    return w*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 14)
check('fixture 2: (0, 5)', solve(*(0, 5)), 10)
check('fixture 3: (2, 2)', solve(*(2, 2)), 8)
check('fixture 4: (0, 0)', solve(*(0, 0)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(w, h):
    return w+h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 14)
check('fixture 2: (0, 5)', solve(*(0, 5)), 10)
check('fixture 3: (2, 2)', solve(*(2, 2)), 8)
check('fixture 4: (0, 0)', solve(*(0, 0)), 0)
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:
Area is returned instead of perimeter.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Rectangle perimeter. Exact operational definition: 2*(w+h)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(n):
    return 180*n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 180)
check('fixture 2: (4,)', solve(*(4,)), 360)
check('fixture 3: (5,)', solve(*(5,)), 540)
check('fixture 4: (8,)', solve(*(8,)), 1080)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(n):
    return 360
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 180)
check('fixture 2: (4,)', solve(*(4,)), 360)
check('fixture 3: (5,)', solve(*(5,)), 540)
check('fixture 4: (8,)', solve(*(8,)), 1080)
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 triangulation has n minus two triangles, not n.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Regular polygon interior angle sum. Exact operational definition: 180*(n-2)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(n):
    return 180*(n-2)/n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 120)
check('fixture 2: (4,)', solve(*(4,)), 90)
check('fixture 3: (6,)', solve(*(6,)), 60)
check('fixture 4: (8,)', solve(*(8,)), 45)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(n):
    return 180/n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 120)
check('fixture 2: (4,)', solve(*(4,)), 90)
check('fixture 3: (6,)', solve(*(6,)), 60)
check('fixture 4: (8,)', solve(*(8,)), 45)
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 interior angle is returned instead of its exterior turn.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Regular polygon exterior angle. Exact operational definition: 360/n

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(degrees):
    return degrees%360
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (180,)', solve(*(180,)), -180)
check('fixture 2: (370,)', solve(*(370,)), 10)
check('fixture 3: (-190,)', solve(*(-190,)), 170)
check('fixture 4: (0,)', solve(*(0,)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(degrees):
    return math.fmod(degrees,360)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (180,)', solve(*(180,)), -180)
check('fixture 2: (370,)', solve(*(370,)), 10)
check('fixture 3: (-190,)', solve(*(-190,)), 170)
check('fixture 4: (0,)', solve(*(0,)), 0)
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:
Unsigned normalization violates the signed half-open interval.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Degree normalization signed. Exact operational definition: (degrees+180)%360-180

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(start, end):
    return end-start
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (350, 10)', solve(*(350, 10)), 20)
check('fixture 2: (10, 350)', solve(*(10, 350)), -20)
check('fixture 3: (0, 180)', solve(*(0, 180)), -180)
check('fixture 4: (30, 30)', solve(*(30, 30)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(start, end):
    return (end-start)%360
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (350, 10)', solve(*(350, 10)), 20)
check('fixture 2: (10, 350)', solve(*(10, 350)), -20)
check('fixture 3: (0, 180)', solve(*(0, 180)), -180)
check('fixture 4: (30, 30)', solve(*(30, 30)), 0)
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:
Raw subtraction takes long turns across the wrap point.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Degree shortest signed turn. Exact operational definition: (end-start+180)%360-180

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point):
    return (-point[1],point[0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3),)', solve(*((2, 3),)), (3, -2))
check('fixture 2: ((0, 1),)', solve(*((0, 1),)), (1, 0))
check('fixture 3: ((-2, 0),)', solve(*((-2, 0),)), (0, 2))
check('fixture 4: ((0, 0),)', solve(*((0, 0),)), (0, 0))
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point):
    return (point[1],point[0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3),)', solve(*((2, 3),)), (3, -2))
check('fixture 2: ((0, 1),)', solve(*((0, 1),)), (1, 0))
check('fixture 3: ((-2, 0),)', solve(*((-2, 0),)), (0, 2))
check('fixture 4: ((0, 0),)', solve(*((0, 0),)), (0, 0))
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 rotation sign implements a counterclockwise turn.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Clockwise quarter turn. Exact operational definition: (point[1],-point[0])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point):
    return (point[1],-point[0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3),)', solve(*((2, 3),)), (-3, 2))
check('fixture 2: ((0, 1),)', solve(*((0, 1),)), (-1, 0))
check('fixture 3: ((-2, 0),)', solve(*((-2, 0),)), (0, -2))
check('fixture 4: ((0, 0),)', solve(*((0, 0),)), (0, 0))
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point):
    return (-point[0],-point[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3),)', solve(*((2, 3),)), (-3, 2))
check('fixture 2: ((0, 1),)', solve(*((0, 1),)), (-1, 0))
check('fixture 3: ((-2, 0),)', solve(*((-2, 0),)), (0, -2))
check('fixture 4: ((0, 0),)', solve(*((0, 0),)), (0, 0))
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 rotation direction is reversed.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Counterclockwise quarter turn. Exact operational definition: (-point[1],point[0])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point, y):
    return (point[0],-point[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), 1)', solve(*((2, 3), 1)), (2, -1))
check('fixture 2: ((0, 0), 2)', solve(*((0, 0), 2)), (0, 4))
check('fixture 3: ((1, 4), 4)', solve(*((1, 4), 4)), (1, 4))
check('fixture 4: ((-2, -3), -1)', solve(*((-2, -3), -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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point, y):
    return (point[0],y-point[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), 1)', solve(*((2, 3), 1)), (2, -1))
check('fixture 2: ((0, 0), 2)', solve(*((0, 0), 2)), (0, 4))
check('fixture 3: ((1, 4), 4)', solve(*((1, 4), 4)), (1, 4))
check('fixture 4: ((-2, -3), -1)', solve(*((-2, -3), -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:
Reflection is performed about the origin rather than the specified line.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Reflection across horizontal line. Exact operational definition: (point[0],2*y-point[1])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point, x):
    return (-point[0],point[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), 1)', solve(*((2, 3), 1)), (0, 3))
check('fixture 2: ((0, 0), 2)', solve(*((0, 0), 2)), (4, 0))
check('fixture 3: ((4, 1), 4)', solve(*((4, 1), 4)), (4, 1))
check('fixture 4: ((-3, -2), -1)', solve(*((-3, -2), -1)), (1, -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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(point, x):
    return (x-point[0],point[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), 1)', solve(*((2, 3), 1)), (0, 3))
check('fixture 2: ((0, 0), 2)', solve(*((0, 0), 2)), (4, 0))
check('fixture 3: ((4, 1), 4)', solve(*((4, 1), 4)), (4, 1))
check('fixture 4: ((-3, -2), -1)', solve(*((-3, -2), -1)), (1, -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 reflection axis is forced to x equals zero.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Reflection across vertical line. Exact operational definition: (2*x-point[0],point[1])

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, v):
    return [str(Fraction(sum(a*b for a,b in zip(p,v))*x,sum(abs(x) for x in v))) for x in v]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), (1, 0))', solve(*((2, 3), (1, 0))), ['2', '0'])
check('fixture 2: ((2, 3), (1, 1))', solve(*((2, 3), (1, 1))), ['5/2', '5/2'])
check('fixture 3: ((1, 0), (2, 0))', solve(*((1, 0), (2, 0))), ['1', '0'])
check('fixture 4: ((0, 0), (1, 2))', solve(*((0, 0), (1, 2))), ['0', '0'])
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, v):
    return [str(Fraction(sum(a*b for a,b in zip(p,v)),sum(x*x for x in v))) for x in v]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((2, 3), (1, 0))', solve(*((2, 3), (1, 0))), ['2', '0'])
check('fixture 2: ((2, 3), (1, 1))', solve(*((2, 3), (1, 1))), ['5/2', '5/2'])
check('fixture 3: ((1, 0), (2, 0))', solve(*((1, 0), (2, 0))), ['1', '0'])
check('fixture 4: ((0, 0), (1, 2))', solve(*((0, 0), (1, 2))), ['0', '0'])
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:
Projection divides by vector magnitude in the wrong norm.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. p and v are same-length integer vectors and v is nonzero. Return reduced Fraction strings for the orthogonal projection onto span(v). Exact operational definition: [str(Fraction(sum(a*b for a,b in zip(p,v))*x,sum(x*x for x in v))) for x in v]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, a, b):
    return str((p[0]-a[0])**2+(p[1]-a[1])**2)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((1, 2), (0, 0), (2, 0))', solve(*((1, 2), (0, 0), (2, 0))), '4')
check('fixture 2: ((1, 1), (0, 0), (2, 2))', solve(*((1, 1), (0, 0), (2, 2))), '0')
check('fixture 3: ((0, 2), (0, 0), (1, 1))', solve(*((0, 2), (0, 0), (1, 1))), '2')
check('fixture 4: ((3, 0), (0, 0), (1, 0))', solve(*((3, 0), (0, 0), (1, 0))), '0')
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, a, b):
    return str(Fraction(abs((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1])),(b[0]-a[0])**2+(b[1]-a[1])**2))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((1, 2), (0, 0), (2, 0))', solve(*((1, 2), (0, 0), (2, 0))), '4')
check('fixture 2: ((1, 1), (0, 0), (2, 2))', solve(*((1, 1), (0, 0), (2, 2))), '0')
check('fixture 3: ((0, 2), (0, 0), (1, 1))', solve(*((0, 2), (0, 0), (1, 1))), '2')
check('fixture 4: ((3, 0), (0, 0), (1, 0))', solve(*((3, 0), (0, 0), (1, 0))), '0')
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:
Distance to an endpoint replaces perpendicular distance to the infinite line.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. p,a,b are integer planar points with a!=b; return reduced Fraction string for distance squared to the infinite line through a and b. Exact operational definition: str(Fraction(((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1]))**2,(b[0]-a[0])**2+(b[1]-a[1])**2))

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, box):
    return box[0]<p[0]<box[2] and box[1]<p[1]<box[3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (0, 0, 2, 2))', solve(*((0, 0), (0, 0, 2, 2))), True)
check('fixture 2: ((1, 1), (0, 0, 2, 2))', solve(*((1, 1), (0, 0, 2, 2))), True)
check('fixture 3: ((3, 1), (0, 0, 2, 2))', solve(*((3, 1), (0, 0, 2, 2))), False)
check('fixture 4: ((2, 2), (0, 0, 2, 2))', solve(*((2, 2), (0, 0, 2, 2))), 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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(p, box):
    return box[0]<=p[0]<=box[2] or box[1]<=p[1]<=box[3]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (0, 0, 2, 2))', solve(*((0, 0), (0, 0, 2, 2))), True)
check('fixture 2: ((1, 1), (0, 0, 2, 2))', solve(*((1, 1), (0, 0, 2, 2))), True)
check('fixture 3: ((3, 1), (0, 0, 2, 2))', solve(*((3, 1), (0, 0, 2, 2))), False)
check('fixture 4: ((2, 2), (0, 0, 2, 2))', solve(*((2, 2), (0, 0, 2, 2))), 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:
Strict comparisons exclude the closed boundary.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Axis aligned point containment closed. Exact operational definition: box[0]<=p[0]<=box[2] and box[1]<=p[1]<=box[3]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a+b>=c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4, 5)', solve(*(3, 4, 5)), True)
check('fixture 2: (1, 2, 3)', solve(*(1, 2, 3)), False)
check('fixture 3: (5, 1, 1)', solve(*(5, 1, 1)), False)
check('fixture 4: (0, 1, 1)', solve(*(0, 1, 1)), 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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return min(a,b,c)>0 and 2*max(a,b,c)<=a+b+c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4, 5)', solve(*(3, 4, 5)), True)
check('fixture 2: (1, 2, 3)', solve(*(1, 2, 3)), False)
check('fixture 3: (5, 1, 1)', solve(*(5, 1, 1)), False)
check('fixture 4: (0, 1, 1)', solve(*(0, 1, 1)), 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:
Only one inequality is checked and degeneracy is accepted.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. a,b,c may include zero; return true only for positive sides forming a nondegenerate triangle. Exact operational definition: min(a,b,c)>0 and 2*max(a,b,c)<a+b+c

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return (a+b+c)*(a+b+c)*(a+b-c)*(a+b-c)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4, 5)', solve(*(3, 4, 5)), 576)
check('fixture 2: (2, 2, 2)', solve(*(2, 2, 2)), 48)
check('fixture 3: (1, 2, 3)', solve(*(1, 2, 3)), 0)
check('fixture 4: (5, 5, 6)', solve(*(5, 5, 6)), 2304)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return (a+b+c)*(-a+b+c)*(a-b+c)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4, 5)', solve(*(3, 4, 5)), 576)
check('fixture 2: (2, 2, 2)', solve(*(2, 2, 2)), 48)
check('fixture 3: (1, 2, 3)', solve(*(1, 2, 3)), 0)
check('fixture 4: (5, 5, 6)', solve(*(5, 5, 6)), 2304)
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:
Two Heron factors are duplicated instead of respecting all three sides.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. a,b,c satisfy the non-strict triangle inequality; return sixteen times triangle area squared. Exact operational definition: (a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points):
    return sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(1, 1), (3, 1), (1, 4)],)', solve(*([(1, 1), (3, 1), (1, 4)],)), 6)
check('fixture 2: ([(1, 4), (3, 1), (1, 1)],)', solve(*([(1, 4), (3, 1), (1, 1)],)), -6)
check('fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 4: ([],)', solve(*([],)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points):
    return abs(sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[:1])))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(1, 1), (3, 1), (1, 4)],)', solve(*([(1, 1), (3, 1), (1, 4)],)), 6)
check('fixture 2: ([(1, 4), (3, 1), (1, 1)],)', solve(*([(1, 4), (3, 1), (1, 1)],)), -6)
check('fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 4: ([],)', solve(*([],)), 0)
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 closing polygon edge is missing from the shoelace sum.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Vertices are ordered around a polygon; close the last edge to the first. The empty list returns zero. Exact operational definition: sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[:1]))

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points):
    return len(points)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 2: ([(0, 0), (1, 0), (0, 1)],)', solve(*([(0, 0), (1, 0), (0, 1)],)), 3)
check('fixture 3: ([(0, 0), (3, 0), (0, 3)],)', solve(*([(0, 0), (3, 0), (0, 3)],)), 9)
check('fixture 4: ([(1, 1), (4, 1), (4, 3), (1, 3)],)', solve(*([(1, 1), (4, 1), (4, 3), (1, 3)],)), 10)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points):
    return sum(math.gcd(abs(a[0]-b[0]),abs(a[1]-b[1]))+1 for a,b in zip(points,points[1:]+points[:1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 2: ([(0, 0), (1, 0), (0, 1)],)', solve(*([(0, 0), (1, 0), (0, 1)],)), 3)
check('fixture 3: ([(0, 0), (3, 0), (0, 3)],)', solve(*([(0, 0), (3, 0), (0, 3)],)), 9)
check('fixture 4: ([(1, 1), (4, 1), (4, 3), (1, 3)],)', solve(*([(1, 1), (4, 1), (4, 3), (1, 3)],)), 10)
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:
Only vertices are counted, excluding lattice points along edges.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Input is the ordered integer vertices of a simple nondegenerate lattice polygon, without a repeated closing vertex. Exact operational definition: sum(math.gcd(abs(a[0]-b[0]),abs(a[1]-b[1])) for a,b in zip(points,points[1:]+points[:1]))

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(double_area, boundary):
    return double_area//2-boundary+1
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (8, 8)', solve(*(8, 8)), 1)
check('fixture 2: (1, 3)', solve(*(1, 3)), 0)
check('fixture 3: (18, 12)', solve(*(18, 12)), 4)
check('fixture 4: (9, 9)', solve(*(9, 9)), 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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(double_area, boundary):
    return (double_area+boundary-2)//2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (8, 8)', solve(*(8, 8)), 1)
check('fixture 2: (1, 3)', solve(*(1, 3)), 0)
check('fixture 3: (18, 12)', solve(*(18, 12)), 4)
check('fixture 4: (9, 9)', solve(*(9, 9)), 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:
Boundary points are subtracted with full instead of half weight.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. double_area is twice the unsigned area and boundary is the lattice boundary-point count of a simple nondegenerate lattice polygon. Exact operational definition: (double_area-boundary+2)//2

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points, weights):
    return [sum(p[i]*w for p,w in zip(points,weights)) for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [1, 1, 1])), [2, 2])
check('fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [2, 1, 1])), [1.5, 1.5])
check('fixture 3: ([(1, 2)], [5])', solve(*([(1, 2)], [5])), [1, 2])
check('fixture 4: ([(0, 0), (4, 4)], [1, 3])', solve(*([(0, 0), (4, 4)], [1, 3])), [3, 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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(points, weights):
    return [sum(p[i] for p in points)/len(points) for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [1, 1, 1])), [2, 2])
check('fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [2, 1, 1])), [1.5, 1.5])
check('fixture 3: ([(1, 2)], [5])', solve(*([(1, 2)], [5])), [1, 2])
check('fixture 4: ([(0, 0), (4, 4)], [1, 3])', solve(*([(0, 0), (4, 4)], [1, 3])), [3, 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:
Homogeneous weights are not normalized.

Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. points are planar integer vectors; weights are matching nonnegative integers with positive total. Return a two-coordinate weighted affine point. Exact operational definition: [sum(p[i]*w for p,w in zip(points,weights))/sum(weights) for i in range(2)]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r):
    return 4*r*r/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (3,)', solve(*(3,)), 36)
check('fixture 3: (6,)', solve(*(6,)), 288)
check('fixture 4: (1,)', solve(*(1,)), 1.3333333333333333)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r):
    return r**3/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (3,)', solve(*(3,)), 36)
check('fixture 3: (6,)', solve(*(6,)), 288)
check('fixture 4: (1,)', solve(*(1,)), 1.3333333333333333)
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:
Radius is squared instead of cubed for volume.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Sphere volume divided by pi. Exact operational definition: 4*r**3/3

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r):
    return 4*r**3/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 4)
check('fixture 3: (3,)', solve(*(3,)), 36)
check('fixture 4: (5,)', solve(*(5,)), 100)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r):
    return r*r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 4)
check('fixture 3: (3,)', solve(*(3,)), 36)
check('fixture 4: (5,)', solve(*(5,)), 100)
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:
Volume scaling is used for surface area.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Sphere surface divided by pi. Exact operational definition: 4*r*r

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return 2*r*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 12)
check('fixture 2: (1, 4)', solve(*(1, 4)), 4)
check('fixture 3: (0, 8)', solve(*(0, 8)), 0)
check('fixture 4: (3, 0)', solve(*(3, 0)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return r*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 12)
check('fixture 2: (1, 4)', solve(*(1, 4)), 4)
check('fixture 3: (0, 8)', solve(*(0, 8)), 0)
check('fixture 4: (3, 0)', solve(*(3, 0)), 0)
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:
Circumference times height computes lateral area rather than volume.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cylinder volume divided by pi. Exact operational definition: r*r*h

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return r*r*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 12)
check('fixture 2: (1, 3)', solve(*(1, 3)), 1)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (2, 6)', solve(*(2, 6)), 8)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return r*h/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 12)
check('fixture 2: (1, 3)', solve(*(1, 3)), 1)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (2, 6)', solve(*(2, 6)), 8)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A cone is assigned the volume of its bounding cylinder.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cone volume divided by pi. Exact operational definition: r*r*h/3

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, R, h):
    return h*(R*R-r*r)/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 2, 3)', solve(*(1, 2, 3)), 7)
check('fixture 2: (2, 2, 3)', solve(*(2, 2, 3)), 12)
check('fixture 3: (0, 3, 4)', solve(*(0, 3, 4)), 12)
check('fixture 4: (1, 3, 0)', solve(*(1, 3, 0)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, R, h):
    return h*(r*r+R*R)/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 2, 3)', solve(*(1, 2, 3)), 7)
check('fixture 2: (2, 2, 3)', solve(*(2, 2, 3)), 12)
check('fixture 3: (0, 3, 4)', solve(*(0, 3, 4)), 12)
check('fixture 4: (1, 3, 0)', solve(*(1, 3, 0)), 0)
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:
Subtracting same-height cones omits the mixed-radius term.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Conical frustum volume divided by pi. Exact operational definition: h*(r*r+r*R+R*R)/3

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a*b*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 52)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 6)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 12)
check('fixture 4: (3, 3, 3)', solve(*(3, 3, 3)), 54)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return 2*(a+b+c)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 52)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 6)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 12)
check('fixture 4: (3, 3, 3)', solve(*(3, 3, 3)), 54)
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:
Volume replaces total face area.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cuboid surface area. Exact operational definition: 2*(a*b+b*c+c*a)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return (a+b+c)**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 6)', solve(*(2, 3, 6)), 49)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 3)
check('fixture 3: (0, 0, 0)', solve(*(0, 0, 0)), 0)
check('fixture 4: (0, 3, 4)', solve(*(0, 3, 4)), 25)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a*a+b*b
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 6)', solve(*(2, 3, 6)), 49)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 3)
check('fixture 3: (0, 0, 0)', solve(*(0, 0, 0)), 0)
check('fixture 4: (0, 3, 4)', solve(*(0, 3, 4)), 25)
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:
Squaring the sum introduces cross terms.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cuboid space diagonal squared. Exact operational definition: a*a+b*b+c*c

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return 4*(a+b+c)/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 2, 3)', solve(*(1, 2, 3)), 8)
check('fixture 2: (3, 3, 3)', solve(*(3, 3, 3)), 36)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 0)
check('fixture 4: (1, 1, 1)', solve(*(1, 1, 1)), 1.3333333333333333)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a*b*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 2, 3)', solve(*(1, 2, 3)), 8)
check('fixture 2: (3, 3, 3)', solve(*(3, 3, 3)), 36)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 0)
check('fixture 4: (1, 1, 1)', solve(*(1, 1, 1)), 1.3333333333333333)
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:
Semiaxes are added instead of multiplied.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Ellipsoid volume divided by pi. Exact operational definition: 4*a*b*c/3

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a*b*c/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 4)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 0.16666666666666666)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 0)
check('fixture 4: (6, 6, 6)', solve(*(6, 6, 6)), 36)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b, c):
    return a*b*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3, 4)', solve(*(2, 3, 4)), 4)
check('fixture 2: (1, 1, 1)', solve(*(1, 1, 1)), 0.16666666666666666)
check('fixture 3: (0, 2, 3)', solve(*(0, 2, 3)), 0)
check('fixture 4: (6, 6, 6)', solve(*(6, 6, 6)), 36)
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 triangular base factor of one half is omitted.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Tetrahedron axis intercept volume. Exact operational definition: a*b*c/6

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(base_area, h):
    return base_area*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (12, 3)', solve(*(12, 3)), 12)
check('fixture 2: (4, 6)', solve(*(4, 6)), 8)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (7, 0)', solve(*(7, 0)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(base_area, h):
    return base_area*h/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (12, 3)', solve(*(12, 3)), 12)
check('fixture 2: (4, 6)', solve(*(4, 6)), 8)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (7, 0)', solve(*(7, 0)), 0)
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:
Prismatic rather than pyramidal volume is returned.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Pyramid volume. Exact operational definition: base_area*h/3

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return 2*r*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 20)
check('fixture 2: (1, 0)', solve(*(1, 0)), 2)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (3, 4)', solve(*(3, 4)), 42)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return 2*r*r+r*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 20)
check('fixture 2: (1, 0)', solve(*(1, 0)), 2)
check('fixture 3: (0, 5)', solve(*(0, 5)), 0)
check('fixture 4: (3, 4)', solve(*(3, 4)), 42)
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 two end disks are omitted.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cylinder total surface divided by pi. Exact operational definition: 2*r*(r+h)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(R, h):
    return R*h*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 3)', solve(*(3, 3)), 18)
check('fixture 2: (3, 6)', solve(*(3, 6)), 36)
check('fixture 3: (4, 0)', solve(*(4, 0)), 0)
check('fixture 4: (2, 1)', solve(*(2, 1)), 1.6666666666666667)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(R, h):
    return h*h*(R-h)/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 3)', solve(*(3, 3)), 18)
check('fixture 2: (3, 6)', solve(*(3, 6)), 36)
check('fixture 3: (4, 0)', solve(*(4, 0)), 0)
check('fixture 4: (2, 1)', solve(*(2, 1)), 1.6666666666666667)
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 cap cubic correction is omitted.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. R>=0 and 0<=h<=2*R; the output is spherical-cap volume divided by pi. Exact operational definition: h*h*(R-h/3)

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(R, h):
    return h*h
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 6)
check('fixture 2: (3, 3)', solve(*(3, 3)), 18)
check('fixture 3: (4, 0)', solve(*(4, 0)), 0)
check('fixture 4: (2, 4)', solve(*(2, 4)), 16)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(R, h):
    return 2*R*R
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 6)
check('fixture 2: (3, 3)', solve(*(3, 3)), 18)
check('fixture 3: (4, 0)', solve(*(4, 0)), 0)
check('fixture 4: (2, 4)', solve(*(2, 4)), 16)
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 cap is mistaken for a flat disk based on cap height.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. R>=0 and 0<=h<=2*R; return curved cap surface area divided by pi, excluding the flat base. Exact operational definition: 2*R*h

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(major, minor):
    return 2*major*major*minor
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 6)
check('fixture 2: (4, 2)', solve(*(4, 2)), 32)
check('fixture 3: (5, 0)', solve(*(5, 0)), 0)
check('fixture 4: (6, 3)', solve(*(6, 3)), 108)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(major, minor):
    return major*minor*minor
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 6)
check('fixture 2: (4, 2)', solve(*(4, 2)), 32)
check('fixture 3: (5, 0)', solve(*(5, 0)), 0)
check('fixture 4: (6, 3)', solve(*(6, 3)), 108)
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 major radius is squared instead of the tube radius.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. major>=minor>=0; return ring-torus volume divided by pi squared. Exact operational definition: 2*major*minor*minor

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(major, minor):
    return 2*major*minor*minor
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 12)
check('fixture 2: (4, 2)', solve(*(4, 2)), 32)
check('fixture 3: (5, 0)', solve(*(5, 0)), 0)
check('fixture 4: (6, 3)', solve(*(6, 3)), 72)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(major, minor):
    return 2*(major+minor)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1)', solve(*(3, 1)), 12)
check('fixture 2: (4, 2)', solve(*(4, 2)), 32)
check('fixture 3: (5, 0)', solve(*(5, 0)), 0)
check('fixture 4: (6, 3)', solve(*(6, 3)), 72)
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 torus volume formula replaces surface area.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. major>=minor>=0; return ring-torus surface area divided by pi squared. Exact operational definition: 4*major*minor

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(diagonal_squared):
    return diagonal_squared**1.5
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 1)
check('fixture 2: (12,)', solve(*(12,)), 8)
check('fixture 3: (27,)', solve(*(27,)), 27)
check('fixture 4: (0,)', solve(*(0,)), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(diagonal_squared):
    return (diagonal_squared/2)**1.5
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3,)', solve(*(3,)), 1)
check('fixture 2: (12,)', solve(*(12,)), 8)
check('fixture 3: (27,)', solve(*(27,)), 27)
check('fixture 4: (0,)', solve(*(0,)), 0)
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 body diagonal is used as the cube side.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. diagonal_squared>=0; derive the volume of a cube from the squared body diagonal. Exact operational definition: (diagonal_squared/3)**1.5

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(base_area, perpendicular_height):
    return base_area+perpendicular_height
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3)', solve(*(4, 3)), 12)
check('fixture 2: (0, 5)', solve(*(0, 5)), 0)
check('fixture 3: (7, 0)', solve(*(7, 0)), 0)
check('fixture 4: (5, 5)', solve(*(5, 5)), 25)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(base_area, perpendicular_height):
    return base_area*perpendicular_height/3
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 3)', solve(*(4, 3)), 12)
check('fixture 2: (0, 5)', solve(*(0, 5)), 0)
check('fixture 3: (7, 0)', solve(*(7, 0)), 0)
check('fixture 4: (5, 5)', solve(*(5, 5)), 25)
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:
Area and height are added instead of multiplied.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Cavalieri prism volume. Exact operational definition: base_area*perpendicular_height

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return (r+h)**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 25)
check('fixture 2: (0, 5)', solve(*(0, 5)), 25)
check('fixture 3: (2, 0)', solve(*(2, 0)), 4)
check('fixture 4: (1, 1)', solve(*(1, 1)), 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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(r, h):
    return h*h-r*r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 4)', solve(*(3, 4)), 25)
check('fixture 2: (0, 5)', solve(*(0, 5)), 25)
check('fixture 3: (2, 0)', solve(*(2, 0)), 4)
check('fixture 4: (1, 1)', solve(*(1, 1)), 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 legs are added before squaring.

Nonnegative integer dimensions; exact products and ordinary Python real division. Quantities named divided by pi or pi-squared deliberately omit that factor from the returned result. Right cone slant length squared. Exact operational definition: r*r+h*h

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return sum(a)*sum(b)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4])', solve(*([1, 2], [3, 4])), 11)
check('fixture 2: ([1, -1], [1, 1])', solve(*([1, -1], [1, 1])), 0)
check('fixture 3: ([], [])', solve(*([], [])), 0)
check('fixture 4: ([0, 2], [5, 0])', solve(*([0, 2], [5, 0])), 0)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return sum(x+y for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4])', solve(*([1, 2], [3, 4])), 11)
check('fixture 2: ([1, -1], [1, 1])', solve(*([1, -1], [1, 1])), 0)
check('fixture 3: ([], [])', solve(*([], [])), 0)
check('fixture 4: ([0, 2], [5, 0])', solve(*([0, 2], [5, 0])), 0)
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 product of sums introduces cross-coordinate products.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Vector dot product. Exact operational definition: sum(x*y for x,y in zip(a,b))

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return [x+y for x,y in zip(a,b)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4])', solve(*([1, 2], [3, 4])), [3, 8])
check('fixture 2: ([1, -1], [1, 1])', solve(*([1, -1], [1, 1])), [1, -1])
check('fixture 3: ([], [])', solve(*([], [])), [])
check('fixture 4: ([0, 2], [5, 0])', solve(*([0, 2], [5, 0])), [0, 0])
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return [sum(x*y for x,y in zip(a,b))]*len(a)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], [3, 4])', solve(*([1, 2], [3, 4])), [3, 8])
check('fixture 2: ([1, -1], [1, 1])', solve(*([1, -1], [1, 1])), [1, -1])
check('fixture 3: ([], [])', solve(*([], [])), [])
check('fixture 4: ([0, 2], [5, 0])', solve(*([0, 2], [5, 0])), [0, 0])
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:
Elementwise addition replaces multiplication.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Vector hadamard product. Exact operational definition: [x*y for x,y in zip(a,b)]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return [a[1]*b[2]+a[2]*b[1],a[2]*b[0]+a[0]*b[2],a[0]*b[1]+a[1]*b[0]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0, 0], [0, 1, 0])', solve(*([1, 0, 0], [0, 1, 0])), [0, 0, 1])
check('fixture 2: ([1, 0, 0], [0, 0, 1])', solve(*([1, 0, 0], [0, 0, 1])), [0, -1, 0])
check('fixture 3: ([1, 2, 3], [1, 2, 3])', solve(*([1, 2, 3], [1, 2, 3])), [0, 0, 0])
check('fixture 4: ([0, 0, 1], [0, 1, 0])', solve(*([0, 0, 1], [0, 1, 0])), [-1, 0, 0])
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(a, b):
    return [a[1]*b[2]-a[2]*b[1],a[0]*b[2]-a[2]*b[0],a[0]*b[1]-a[1]*b[0]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 0, 0], [0, 1, 0])', solve(*([1, 0, 0], [0, 1, 0])), [0, 0, 1])
check('fixture 2: ([1, 0, 0], [0, 0, 1])', solve(*([1, 0, 0], [0, 0, 1])), [0, -1, 0])
check('fixture 3: ([1, 2, 3], [1, 2, 3])', solve(*([1, 2, 3], [1, 2, 3])), [0, 0, 0])
check('fixture 4: ([0, 0, 1], [0, 1, 0])', solve(*([0, 0, 1], [0, 1, 0])), [-1, 0, 0])
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:
Symmetric sums replace antisymmetric determinant terms.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Three dimensional cross product. Exact operational definition: [a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return m[0][0]*m[1][1]+m[0][1]*m[1][0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), -2)
check('fixture 2: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), 1)
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), 0)
check('fixture 4: ([[0, 1], [1, 0]],)', solve(*([[0, 1], [1, 0]],)), -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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return abs(m[0][0]*m[1][1]-m[0][1]*m[1][0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), -2)
check('fixture 2: ([[1, 0], [0, 1]],)', solve(*([[1, 0], [0, 1]],)), 1)
check('fixture 3: ([[1, 2], [2, 4]],)', solve(*([[1, 2], [2, 4]],)), 0)
check('fixture 4: ([[0, 1], [1, 0]],)', solve(*([[0, 1], [1, 0]],)), -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 off-diagonal product is added instead of subtracted.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Matrix two determinant. Exact operational definition: m[0][0]*m[1][1]-m[0][1]*m[1][0]

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return sum(map(sum,m))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), 5)
check('fixture 2: ([[1, 2, 3], [4, 5, 6], [7, 8, 10]],)', solve(*([[1, 2, 3], [4, 5, 6], [7, 8, 10]],)), 16)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[7]],)', solve(*([[7]],)), 7)
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return sum(m[i][-i-1] for i in range(len(m)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), 5)
check('fixture 2: ([[1, 2, 3], [4, 5, 6], [7, 8, 10]],)', solve(*([[1, 2, 3], [4, 5, 6], [7, 8, 10]],)), 16)
check('fixture 3: ([],)', solve(*([],)), 0)
check('fixture 4: ([[7]],)', solve(*([[7]],)), 7)
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:
Every matrix entry is summed rather than only the diagonal.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Matrix trace. Exact operational definition: sum(m[i][i] for i in range(len(m)))

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return [row[:] for row in m]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2, 3], [4, 5, 6]],)', solve(*([[1, 2, 3], [4, 5, 6]],)), [[1, 4], [2, 5], [3, 6]])
check('fixture 2: ([[1], [2]],)', solve(*([[1], [2]],)), [[1, 2]])
check('fixture 3: ([[7]],)', solve(*([[7]],)), [[7]])
check('fixture 4: ([],)', solve(*([],)), [])
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
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return [list(row) for row in zip(*m)][::-1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2, 3], [4, 5, 6]],)', solve(*([[1, 2, 3], [4, 5, 6]],)), [[1, 4], [2, 5], [3, 6]])
check('fixture 2: ([[1], [2]],)', solve(*([[1], [2]],)), [[1, 2]])
check('fixture 3: ([[7]],)', solve(*([[7]],)), [[7]])
check('fixture 4: ([],)', solve(*([],)), [])
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:
Copying rows leaves row and column axes unchanged.

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Matrix transpose rectangular. Exact operational definition: [list(row) for row in zip(*m)]

split: open-access