broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = abs(r['elapsed'])
    early_growth = (age * r['early_rate'] + 999) // 1000
    late_growth = (age * r['late_rate'] + 999) // 1000
    center = r['anchor'] + r['elapsed']
    low = center - r['early'] - early_growth
    high = center + r['late'] + late_growth
    width = high - low
    contains_zero = low <= 0 <= high
    earliest = r['query'] - low
    latest = r['query'] - low
    return [[low,high],width,contains_zero,[earliest,latest],high < r['query']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 20}), [[8, 15], 7, False, [5, 12], True])
check('fixture 2', solve({'anchor': 0, 'elapsed': -5, 'early': 0, 'late': 1, 'early_rate': 200, 'late_rate': 1, 'query': 0}), [[-6, -3], 3, False, [3, 6], True])
check('fixture 3', solve({'anchor': -1, 'elapsed': 1, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': -3}), [[0, 0], 0, True, [-3, -3], False])
check('fixture 4', solve({'anchor': 20, 'elapsed': 1000, 'early': 3, 'late': 5, 'early_rate': 2, 'late_rate': 7, 'query': 100}), [[1015, 1032], 17, False, [-932, -915], False])
check('fixture 5', solve({'anchor': -10, 'elapsed': 0, 'early': 2, 'late': 3, 'early_rate': 0, 'late_rate': 0, 'query': -20}), [[-12, -7], 5, False, [-13, -8], False])
check('fixture 6', solve({'anchor': 0, 'elapsed': 2, 'early': 5, 'late': 0, 'early_rate': 1, 'late_rate': 2000, 'query': 0}), [[-4, 6], 10, True, [-6, 4], False])
check('fixture 7', solve({'anchor': 10, 'elapsed': -1001, 'early': 0, 'late': 1, 'early_rate': 2, 'late_rate': 1, 'query': 8}), [[-994, -988], 6, False, [996, 1002], True])
check('fixture 8', solve({'anchor': 0, 'elapsed': 0, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': 0}), [[0, 0], 0, True, [0, 0], False])
check('fixture 9', solve({'anchor': 2, 'elapsed': -1, 'early': 0, 'late': 0, 'early_rate': 1000, 'late_rate': 1000, 'query': 2}), [[0, 2], 2, True, [0, 2], False])
check('fixture 10', solve({'anchor': 0, 'elapsed': 10, 'early': 1, 'late': 10, 'early_rate': 90, 'late_rate': 150, 'query': 20}), [[8, 22], 14, False, [-2, 12], False])
variant = [({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 21}, [[8, 15], 7, False, [6, 13], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 22}, [[8, 15], 7, False, [7, 14], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 23}, [[8, 15], 7, False, [8, 15], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 24}, [[8, 15], 7, False, [9, 16], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 25}, [[8, 15], 7, False, [10, 17], True])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = abs(r['elapsed'])
    early_growth = (age * r['early_rate'] + 999) // 1000
    late_growth = (age * r['late_rate'] + 999) // 1000
    center = r['anchor'] + r['elapsed']
    low = center - r['early'] - early_growth
    high = center + r['late'] + late_growth
    width = high - low
    contains_zero = low <= 0 <= high
    earliest = max(0,r['query'] - high)
    latest = r['query'] - low
    return [[low,high],width,contains_zero,[earliest,latest],high < r['query']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 20}), [[8, 15], 7, False, [5, 12], True])
check('fixture 2', solve({'anchor': 0, 'elapsed': -5, 'early': 0, 'late': 1, 'early_rate': 200, 'late_rate': 1, 'query': 0}), [[-6, -3], 3, False, [3, 6], True])
check('fixture 3', solve({'anchor': -1, 'elapsed': 1, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': -3}), [[0, 0], 0, True, [-3, -3], False])
check('fixture 4', solve({'anchor': 20, 'elapsed': 1000, 'early': 3, 'late': 5, 'early_rate': 2, 'late_rate': 7, 'query': 100}), [[1015, 1032], 17, False, [-932, -915], False])
check('fixture 5', solve({'anchor': -10, 'elapsed': 0, 'early': 2, 'late': 3, 'early_rate': 0, 'late_rate': 0, 'query': -20}), [[-12, -7], 5, False, [-13, -8], False])
check('fixture 6', solve({'anchor': 0, 'elapsed': 2, 'early': 5, 'late': 0, 'early_rate': 1, 'late_rate': 2000, 'query': 0}), [[-4, 6], 10, True, [-6, 4], False])
check('fixture 7', solve({'anchor': 10, 'elapsed': -1001, 'early': 0, 'late': 1, 'early_rate': 2, 'late_rate': 1, 'query': 8}), [[-994, -988], 6, False, [996, 1002], True])
check('fixture 8', solve({'anchor': 0, 'elapsed': 0, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': 0}), [[0, 0], 0, True, [0, 0], False])
check('fixture 9', solve({'anchor': 2, 'elapsed': -1, 'early': 0, 'late': 0, 'early_rate': 1000, 'late_rate': 1000, 'query': 2}), [[0, 2], 2, True, [0, 2], False])
check('fixture 10', solve({'anchor': 0, 'elapsed': 10, 'early': 1, 'late': 10, 'early_rate': 90, 'late_rate': 150, 'query': 20}), [[8, 22], 14, False, [-2, 12], False])
variant = [({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 21}, [[8, 15], 7, False, [6, 13], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 22}, [[8, 15], 7, False, [7, 14], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 23}, [[8, 15], 7, False, [8, 15], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 24}, [[8, 15], 7, False, [9, 16], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 25}, [[8, 15], 7, False, [10, 17], True])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for earliest.

Project a center with asymmetric early/late error through signed elapsed ticks. Error growth uses elapsed magnitude and independent parts-per-thousand bounds rounded outward. Return projected [low,high], full width, zero containment, earliest/latest signed query duration and strict certainty of preceding query.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = abs(r['elapsed'])
    early_growth = (age * r['early_rate'] + 999) // 1000
    late_growth = (age * r['late_rate'] + 999) // 1000
    center = r['anchor'] + r['elapsed']
    low = center - r['early'] - early_growth
    high = center + r['late'] + late_growth
    width = high - low
    contains_zero = low <= 0 <= high
    earliest = r['query'] - high
    latest = r['query'] - high
    return [[low,high],width,contains_zero,[earliest,latest],high < r['query']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 20}), [[8, 15], 7, False, [5, 12], True])
check('fixture 2', solve({'anchor': 0, 'elapsed': -5, 'early': 0, 'late': 1, 'early_rate': 200, 'late_rate': 1, 'query': 0}), [[-6, -3], 3, False, [3, 6], True])
check('fixture 3', solve({'anchor': -1, 'elapsed': 1, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': -3}), [[0, 0], 0, True, [-3, -3], False])
check('fixture 4', solve({'anchor': 20, 'elapsed': 1000, 'early': 3, 'late': 5, 'early_rate': 2, 'late_rate': 7, 'query': 100}), [[1015, 1032], 17, False, [-932, -915], False])
check('fixture 5', solve({'anchor': -10, 'elapsed': 0, 'early': 2, 'late': 3, 'early_rate': 0, 'late_rate': 0, 'query': -20}), [[-12, -7], 5, False, [-13, -8], False])
check('fixture 6', solve({'anchor': 0, 'elapsed': 2, 'early': 5, 'late': 0, 'early_rate': 1, 'late_rate': 2000, 'query': 0}), [[-4, 6], 10, True, [-6, 4], False])
check('fixture 7', solve({'anchor': 10, 'elapsed': -1001, 'early': 0, 'late': 1, 'early_rate': 2, 'late_rate': 1, 'query': 8}), [[-994, -988], 6, False, [996, 1002], True])
check('fixture 8', solve({'anchor': 0, 'elapsed': 0, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': 0}), [[0, 0], 0, True, [0, 0], False])
check('fixture 9', solve({'anchor': 2, 'elapsed': -1, 'early': 0, 'late': 0, 'early_rate': 1000, 'late_rate': 1000, 'query': 2}), [[0, 2], 2, True, [0, 2], False])
check('fixture 10', solve({'anchor': 0, 'elapsed': 10, 'early': 1, 'late': 10, 'early_rate': 90, 'late_rate': 150, 'query': 20}), [[8, 22], 14, False, [-2, 12], False])
variant = [({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 21}, [[8, 15], 7, False, [6, 13], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 22}, [[8, 15], 7, False, [7, 14], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 23}, [[8, 15], 7, False, [8, 15], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 24}, [[8, 15], 7, False, [9, 16], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 25}, [[8, 15], 7, False, [10, 17], True])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = abs(r['elapsed'])
    early_growth = (age * r['early_rate'] + 999) // 1000
    late_growth = (age * r['late_rate'] + 999) // 1000
    center = r['anchor'] + r['elapsed']
    low = center - r['early'] - early_growth
    high = center + r['late'] + late_growth
    width = high - low
    contains_zero = low <= 0 <= high
    earliest = r['query'] - high
    latest = abs(r['query'] - low)
    return [[low,high],width,contains_zero,[earliest,latest],high < r['query']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 20}), [[8, 15], 7, False, [5, 12], True])
check('fixture 2', solve({'anchor': 0, 'elapsed': -5, 'early': 0, 'late': 1, 'early_rate': 200, 'late_rate': 1, 'query': 0}), [[-6, -3], 3, False, [3, 6], True])
check('fixture 3', solve({'anchor': -1, 'elapsed': 1, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': -3}), [[0, 0], 0, True, [-3, -3], False])
check('fixture 4', solve({'anchor': 20, 'elapsed': 1000, 'early': 3, 'late': 5, 'early_rate': 2, 'late_rate': 7, 'query': 100}), [[1015, 1032], 17, False, [-932, -915], False])
check('fixture 5', solve({'anchor': -10, 'elapsed': 0, 'early': 2, 'late': 3, 'early_rate': 0, 'late_rate': 0, 'query': -20}), [[-12, -7], 5, False, [-13, -8], False])
check('fixture 6', solve({'anchor': 0, 'elapsed': 2, 'early': 5, 'late': 0, 'early_rate': 1, 'late_rate': 2000, 'query': 0}), [[-4, 6], 10, True, [-6, 4], False])
check('fixture 7', solve({'anchor': 10, 'elapsed': -1001, 'early': 0, 'late': 1, 'early_rate': 2, 'late_rate': 1, 'query': 8}), [[-994, -988], 6, False, [996, 1002], True])
check('fixture 8', solve({'anchor': 0, 'elapsed': 0, 'early': 0, 'late': 0, 'early_rate': 0, 'late_rate': 0, 'query': 0}), [[0, 0], 0, True, [0, 0], False])
check('fixture 9', solve({'anchor': 2, 'elapsed': -1, 'early': 0, 'late': 0, 'early_rate': 1000, 'late_rate': 1000, 'query': 2}), [[0, 2], 2, True, [0, 2], False])
check('fixture 10', solve({'anchor': 0, 'elapsed': 10, 'early': 1, 'late': 10, 'early_rate': 90, 'late_rate': 150, 'query': 20}), [[8, 22], 14, False, [-2, 12], False])
variant = [({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 21}, [[8, 15], 7, False, [6, 13], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 22}, [[8, 15], 7, False, [7, 14], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 23}, [[8, 15], 7, False, [8, 15], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 24}, [[8, 15], 7, False, [9, 16], True]), ({'anchor': 10, 'elapsed': 1, 'early': 2, 'late': 3, 'early_rate': 1, 'late_rate': 500, 'query': 25}, [[8, 15], 7, False, [10, 17], True])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for latest.

Project a center with asymmetric early/late error through signed elapsed ticks. Error growth uses elapsed magnitude and independent parts-per-thousand bounds rounded outward. Return projected [low,high], full width, zero containment, earliest/latest signed query duration and strict certainty of preceding query.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = max(1, r['d1'] + r['d0'])
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = max(1, abs(r['d1']) - abs(r['d0']))
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for device_span.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = max(1,r['t1'] - r['d0'])
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = max(1,r['t1'])
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for reference_span.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(device_span, reference_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(max(1,reference_span // device_span))
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for slope.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = -1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for reciprocal.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] + slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = Fraction(r['t0'])
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for intercept.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * (r['reading'] + intercept)
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading']
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for mapped.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = mapped - r['observed']
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = abs(r['observed'] - mapped)
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for residual.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = r['observed'] * reciprocal - intercept
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] + intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for inverse.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'], device_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], reference_span)
    direction = -1 if fraction < 0 else (1 if fraction > 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for fraction.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = -1 if fraction <= 0 else (1 if fraction >= 1 else 0)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    device_span = r['d1'] - r['d0']
    reference_span = r['t1'] - r['t0']
    slope = Fraction(reference_span, device_span)
    reciprocal = 1 / slope
    intercept = r['t0'] - slope * r['d0']
    mapped = slope * r['reading'] + intercept
    residual = r['observed'] - mapped
    inverse = (r['observed'] - intercept) * reciprocal
    fraction = Fraction(r['reading'] - r['d0'], device_span)
    direction = int(fraction > 1)
    return [str(slope),str(intercept),str(mapped),str(residual),str(inverse),direction]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 14}), ['3/2', '7', '13', '1', '14/3', 0])
check('fixture 2', solve({'d0': -4, 'd1': 4, 't0': -10, 't1': 6, 'reading': -6, 'observed': -13}), ['2', '-2', '-14', '1', '-11/2', -1])
check('fixture 3', solve({'d0': 1, 'd1': 5, 't0': 2, 't1': 4, 'reading': 8, 'observed': 5}), ['1/2', '3/2', '11/2', '-1/2', '7', 1])
check('fixture 4', solve({'d0': 0, 'd1': 10, 't0': 5, 't1': 25, 'reading': 0, 'observed': 5}), ['2', '5', '5', '0', '0', 0])
check('fixture 5', solve({'d0': 2, 'd1': 8, 't0': -3, 't1': 0, 'reading': 8, 'observed': 1}), ['1/2', '-4', '0', '1', '10', 0])
check('fixture 6', solve({'d0': -8, 'd1': -2, 't0': 2, 't1': 14, 'reading': -5, 'observed': 7}), ['2', '18', '8', '-1', '-11/2', 0])
check('fixture 7', solve({'d0': 4, 'd1': 10, 't0': 30, 't1': 39, 'reading': 10, 'observed': 40}), ['3/2', '24', '39', '1', '32/3', 0])
check('fixture 8', solve({'d0': 2, 'd1': 5, 't0': 1, 't1': 2, 'reading': 3, 'observed': 1}), ['1/3', '1/3', '4/3', '-1/3', '2', 0])
check('fixture 9', solve({'d0': 3, 'd1': 9, 't0': 4, 't1': 16, 'reading': 3, 'observed': 4}), ['2', '-2', '4', '0', '3', 0])
check('fixture 10', solve({'d0': 1, 'd1': 2, 't0': 1, 't1': 3, 'reading': 2, 'observed': 3}), ['2', '-1', '3', '0', '2', 0])
variant = [({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 15}, ['3/2', '7', '13', '2', '16/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 16}, ['3/2', '7', '13', '3', '6', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 17}, ['3/2', '7', '13', '4', '20/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 18}, ['3/2', '7', '13', '5', '22/3', 0]), ({'d0': 2, 'd1': 6, 't0': 10, 't1': 16, 'reading': 4, 'observed': 19}, ['3/2', '7', '13', '6', '8', 0])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for direction.

Two increasing device/reference calibration pairs define a positive exact affine clock mapping. Return rational slope/intercept, mapped device reading, signed observation-minus-prediction residual, inverse-mapped observed reference, and extrapolation direction (-1 before support, 0 within including anchors, 1 after). Fractions serialize canonically as strings.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = r['debt']
    capacity = r['elapsed'] * r['rate']
    direction = (r['debt'] > 0) - (r['debt'] < 0)
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = max(0,r['debt'])
    capacity = r['elapsed'] * r['rate']
    direction = (r['debt'] > 0) - (r['debt'] < 0)
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for magnitude.

Slew signed phase debt at capacity elapsed*rate without changing ordinary elapsed advancement. Return signed remaining debt, new wall coordinate, completion flag, unused correction capacity and signed cumulative correction. Elapsed and rate are nonnegative integers; wall and debt may be signed.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = abs(r['debt'])
    capacity = r['rate']
    direction = (r['debt'] > 0) - (r['debt'] < 0)
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = abs(r['debt'])
    capacity = r['elapsed'] + r['rate']
    direction = (r['debt'] > 0) - (r['debt'] < 0)
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for capacity.

Slew signed phase debt at capacity elapsed*rate without changing ordinary elapsed advancement. Return signed remaining debt, new wall coordinate, completion flag, unused correction capacity and signed cumulative correction. Elapsed and rate are nonnegative integers; wall and debt may be signed.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = abs(r['debt'])
    capacity = r['elapsed'] * r['rate']
    direction = -1 if r['debt'] >= 0 else 1
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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
from fractions import Fraction
N = 1
observations = []
def solve(r):
    magnitude = abs(r['debt'])
    capacity = r['elapsed'] * r['rate']
    direction = 1
    applied = direction * min(magnitude,capacity)
    remaining = r['debt'] - applied
    advance = r['elapsed'] + applied
    wall = r['wall'] + advance
    complete = remaining == 0
    unused = capacity - abs(applied)
    cumulative = r['prior_correction'] + applied
    return [remaining,wall,complete,unused,cumulative]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 4}), [4, 109, False, 0, 10])
check('fixture 2', solve({'debt': -10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': -4}), [-4, 97, False, 0, -10])
check('fixture 3', solve({'debt': 4, 'elapsed': 2, 'rate': 2, 'wall': 20, 'prior_correction': 0}), [0, 26, True, 0, 4])
check('fixture 4', solve({'debt': 0, 'elapsed': 3, 'rate': 1, 'wall': 10, 'prior_correction': 8}), [0, 13, True, 3, 8])
check('fixture 5', solve({'debt': 3, 'elapsed': 0, 'rate': 2, 'wall': 50, 'prior_correction': 2}), [3, 50, False, 0, 2])
check('fixture 6', solve({'debt': -2, 'elapsed': 5, 'rate': 1, 'wall': -10, 'prior_correction': 7}), [0, -7, True, 3, 5])
check('fixture 7', solve({'debt': 20, 'elapsed': 4, 'rate': 0, 'wall': 100, 'prior_correction': 3}), [20, 104, False, 0, 3])
check('fixture 8', solve({'debt': 1, 'elapsed': 3, 'rate': 2, 'wall': 0, 'prior_correction': -1}), [0, 4, True, 5, 0])
check('fixture 9', solve({'debt': -3, 'elapsed': 2, 'rate': 2, 'wall': 4, 'prior_correction': -1}), [0, 3, True, 1, -4])
check('fixture 10', solve({'debt': 0, 'elapsed': 0, 'rate': 0, 'wall': 0, 'prior_correction': 0}), [0, 0, True, 0, 0])
variant = [({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 5}, [4, 109, False, 0, 11]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 6}, [4, 109, False, 0, 12]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 7}, [4, 109, False, 0, 13]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 8}, [4, 109, False, 0, 14]), ({'debt': 10, 'elapsed': 3, 'rate': 2, 'wall': 100, 'prior_correction': 9}, [4, 109, False, 0, 15])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][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 decoded time state disagrees with the explicit regression oracle for direction.

Slew signed phase debt at capacity elapsed*rate without changing ordinary elapsed advancement. Return signed remaining debt, new wall coordinate, completion flag, unused correction capacity and signed cumulative correction. Elapsed and rate are nonnegative integers; wall and debt may be signed.

split: open-access