broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = delta <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) < r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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 supported.

Bridge two clock domains through one synchronization pair and exact positive rational rate p/q. A reading carries boot identity and calibration generation; reject stale identity, expiration, or unsupported extrapolation. Outputs admission, mapped rational coordinate, nearest interval endpoints expanded by calibration error, and remaining certificate age. Ages are monotonic and nonnegative. Negative target-domain calibration error is malformed; zero is a valid exact bound.

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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['q'],r['p']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction((delta + r['target_anchor']) * r['p'],r['q'])
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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 coordinate.

Bridge two clock domains through one synchronization pair and exact positive rational rate p/q. A reading carries boot identity and calibration generation; reject stale identity, expiration, or unsupported extrapolation. Outputs admission, mapped rational coordinate, nearest interval endpoints expanded by calibration error, and remaining certificate age. Ages are monotonic and nonnegative. Negative target-domain calibration error is malformed; zero is a valid exact bound.

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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate + r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - Fraction(r['error'] * r['p'],r['q'])
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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 low.

Bridge two clock domains through one synchronization pair and exact positive rational rate p/q. A reading carries boot identity and calibration generation; reject stale identity, expiration, or unsupported extrapolation. Outputs admission, mapped rational coordinate, nearest interval endpoints expanded by calibration error, and remaining certificate age. Ages are monotonic and nonnegative. Negative target-domain calibration error is malformed; zero is a valid exact bound.

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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate - r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + Fraction(r['error'] * r['p'],r['q'])
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] >= 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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 high.

Bridge two clock domains through one synchronization pair and exact positive rational rate p/q. A reading carries boot identity and calibration generation; reject stale identity, expiration, or unsupported extrapolation. Outputs admission, mapped rational coordinate, nearest interval endpoints expanded by calibration error, and remaining certificate age. Ages are monotonic and nonnegative. Negative target-domain calibration error is malformed; zero is a valid exact bound.

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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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):
    boot_ok = r['boot'] == r['cal_boot']
    generation_ok = r['generation'] == r['cal_generation']
    age = r['now'] - r['cal_time']
    fresh = 0 <= age < r['ttl']
    delta = r['reading'] - r['source_anchor']
    supported = abs(delta) <= r['radius']
    coordinate = Fraction(delta * r['p'],r['q']) + r['target_anchor']
    low = coordinate - r['error']
    high = coordinate + r['error']
    accepted = boot_ok and generation_ok and fresh and supported and r['error'] > 0
    return [accepted, str(coordinate) if accepted else None, [str(low),str(high)] if accepted else None,max(0,r['ttl']-age)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '503', ['501', '505'], 8])
check('fixture 2', solve({'boot': 'b', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 3', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 3, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 4', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 1, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 5', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 9, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 11])
check('fixture 6', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 20, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 0])
check('fixture 7', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 19, 'cal_time': 10, 'ttl': 10, 'reading': 110, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '515', ['513', '517'], 1])
check('fixture 8', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 89, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 9', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 111, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [False, None, None, 8])
check('fixture 10', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 10, 'cal_time': 10, 'ttl': 10, 'reading': 90, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}), [True, '485', ['483', '487'], 10])
check('fixture 11', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': -1}), [False, None, None, 8])
check('fixture 12', solve({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 102, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 0}), [True, '503', ['503', '503'], 8])
variant = [({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 103, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1009/2', ['1005/2', '1013/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 104, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '506', ['504', '508'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 105, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1015/2', ['1011/2', '1019/2'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 106, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '509', ['507', '511'], 8]), ({'boot': 'a', 'cal_boot': 'a', 'generation': 2, 'cal_generation': 2, 'now': 12, 'cal_time': 10, 'ttl': 10, 'reading': 107, 'source_anchor': 100, 'target_anchor': 500, 'p': 3, 'q': 2, 'radius': 10, 'error': 2}, [True, '1021/2', ['1017/2', '1025/2'], 8])]
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 accepted.

Bridge two clock domains through one synchronization pair and exact positive rational rate p/q. A reading carries boot identity and calibration generation; reject stale identity, expiration, or unsupported extrapolation. Outputs admission, mapped rational coordinate, nearest interval endpoints expanded by calibration error, and remaining certificate age. Ages are monotonic and nonnegative. Negative target-domain calibration error is malformed; zero is a valid exact bound.

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):
    awake = r['mono_now']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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):
    awake = r['boot_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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 awake.

A process exposes wall-independent monotonic ticks excluding system suspend and boot ticks including suspend. Snapshot pairs define awake and sleep elapsed. A timer chooses awake or boot basis, can pause independently, and carries expiration budget. Report elapsed selected, consumed active ticks, signed suspend delta, remaining, deadline in selected domain and validity of paired sample (boot elapsed must cover monotonic elapsed).

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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['mono_now'] - r['mono_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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 boot.

A process exposes wall-independent monotonic ticks excluding system suspend and boot ticks including suspend. Snapshot pairs define awake and sleep elapsed. A timer chooses awake or boot basis, can pause independently, and carries expiration budget. Report elapsed selected, consumed active ticks, signed suspend delta, remaining, deadline in selected domain and validity of paired sample (boot elapsed must cover monotonic elapsed).

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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = awake - boot
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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 sleep.

A process exposes wall-independent monotonic ticks excluding system suspend and boot ticks including suspend. Snapshot pairs define awake and sleep elapsed. A timer chooses awake or boot basis, can pause independently, and carries expiration budget. Report elapsed selected, consumed active ticks, signed suspend delta, remaining, deadline in selected domain and validity of paired sample (boot elapsed must cover monotonic elapsed).

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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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 valid.

A process exposes wall-independent monotonic ticks excluding system suspend and boot ticks including suspend. Snapshot pairs define awake and sleep elapsed. A timer chooses awake or boot basis, can pause independently, and carries expiration budget. Report elapsed selected, consumed active ticks, signed suspend delta, remaining, deadline in selected domain and validity of paired sample (boot elapsed must cover monotonic elapsed).

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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
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 selected.

A process exposes wall-independent monotonic ticks excluding system suspend and boot ticks including suspend. Snapshot pairs define awake and sleep elapsed. A timer chooses awake or boot basis, can pause independently, and carries expiration budget. Report elapsed selected, consumed active ticks, signed suspend delta, remaining, deadline in selected domain and validity of paired sample (boot elapsed must cover monotonic elapsed).

split: open-access