broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age < r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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 holdover.

Clock quality state is determined from oscillator validity, acquisition lock count, elapsed time since last sync, max holdover, phase jump and lock threshold. Unknown oscillator is invalid; otherwise large phase jump requires reacquisition, recent sufficient lock is synchronized, old but bounded history is holdover, and missing/expired history is unsynchronized. Return usability and conservative uncertainty growth for holdover only.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'locked' if recent and locked else ('holdover' if holdover else 'unsynced')
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced'))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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 state.

Clock quality state is determined from oscillator validity, acquisition lock count, elapsed time since last sync, max holdover, phase jump and lock threshold. Unknown oscillator is invalid; otherwise large phase jump requires reacquisition, recent sufficient lock is synchronized, old but bounded history is holdover, and missing/expired history is unsynchronized. Return usability and conservative uncertainty growth for holdover only.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = age * r['drift'] // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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 growth.

Clock quality state is determined from oscillator validity, acquisition lock count, elapsed time since last sync, max holdover, phase jump and lock threshold. Unknown oscillator is invalid; otherwise large phase jump requires reacquisition, recent sufficient lock is synchronized, old but bounded history is holdover, and missing/expired history is unsynchronized. Return usability and conservative uncertainty growth for holdover only.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] if state in ('locked','holdover') else None
    usable = state in ('locked','holdover') and error <= r['error_limit']
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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 error.

Clock quality state is determined from oscillator validity, acquisition lock count, elapsed time since last sync, max holdover, phase jump and lock threshold. Unknown oscillator is invalid; otherwise large phase jump requires reacquisition, recent sufficient lock is synchronized, old but bounded history is holdover, and missing/expired history is unsynchronized. Return usability and conservative uncertainty growth for holdover only.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state in ('locked','holdover')
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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):
    age = r['now'] - r['last_sync']
    history = r['has_sync'] and age >= 0
    jumped = abs(r['phase_jump']) > r['jump_limit']
    locked = r['lock_count'] >= r['required']
    recent = history and age <= r['fresh_window']
    holdover = history and age <= r['max_holdover']
    state = 'invalid' if not r['oscillator'] else ('acquire' if jumped else ('locked' if recent and locked else ('holdover' if holdover else 'unsynced')))
    growth = (age * r['drift'] + 999) // 1000 if state == 'holdover' else 0
    error = r['base_error'] + growth if state in ('locked','holdover') else None
    usable = state == 'locked'
    return [state,error,usable]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['locked', 2, True])
check('fixture 2', solve({'now': 105, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 3}), ['locked', 2, True])
check('fixture 3', solve({'now': 106, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 2}), ['holdover', 3, False])
check('fixture 4', solve({'now': 120, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 4, True])
check('fixture 5', solve({'now': 121, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 6', solve({'now': 99, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 7', solve({'now': 100, 'last_sync': 100, 'has_sync': False, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['unsynced', None, False])
check('fixture 8', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': -6, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['acquire', None, False])
check('fixture 9', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 5, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['locked', 2, True])
check('fixture 10', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 1, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 2, True])
check('fixture 11', solve({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': False, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['invalid', None, False])
check('fixture 12', solve({'now': 110, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 2, 'error_limit': 5}), ['holdover', 3, True])
variant = [({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 3, 'error_limit': 2}, ['locked', 3, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 4, 'error_limit': 2}, ['locked', 4, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 5, 'error_limit': 2}, ['locked', 5, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 6, 'error_limit': 2}, ['locked', 6, False]), ({'now': 100, 'last_sync': 100, 'has_sync': True, 'phase_jump': 0, 'jump_limit': 5, 'lock_count': 3, 'required': 3, 'fresh_window': 5, 'max_holdover': 20, 'oscillator': True, 'drift': 100, 'base_error': 7, 'error_limit': 2}, ['locked', 7, 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 usable.

Clock quality state is determined from oscillator validity, acquisition lock count, elapsed time since last sync, max holdover, phase jump and lock threshold. Unknown oscillator is invalid; otherwise large phase jump requires reacquisition, recent sufficient lock is synchronized, old but bounded history is holdover, and missing/expired history is unsynchronized. Return usability and conservative uncertainty growth for holdover only.

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):
    low = r['deadline'] - r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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):
    low = r['deadline'] + r['offset_high']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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.

A deadline in source clock D maps to target clock with uncertain target-minus-source offset [lo,hi]. Use earliest target deadline for no-late policy, latest for no-early. Account for known transport time in target units and clamp remaining budget at zero. Relative waits are capped by platform maximum and flag rearming. Return target bounds, chosen deadline, wait, rearm and expired status.

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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] - r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_low']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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.

A deadline in source clock D maps to target clock with uncertain target-minus-source offset [lo,hi]. Use earliest target deadline for no-late policy, latest for no-early. Account for known transport time in target units and clamp remaining budget at zero. Relative waits are capped by platform maximum and flag rearming. Return target bounds, chosen deadline, wait, rearm and expired status.

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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = high if r['policy'] == 'no-late' else low
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = (low+high)//2
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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 chosen.

A deadline in source clock D maps to target clock with uncertain target-minus-source offset [lo,hi]. Use earliest target deadline for no-late policy, latest for no-early. Account for known transport time in target units and clamp remaining budget at zero. Relative waits are capped by platform maximum and flag rearming. Return target bounds, chosen deadline, wait, rearm and expired status.

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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] - r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
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 arrival.

A deadline in source clock D maps to target clock with uncertain target-minus-source offset [lo,hi]. Use earliest target deadline for no-late policy, latest for no-early. Account for known transport time in target units and clamp remaining budget at zero. Relative waits are capped by platform maximum and flag rearming. Return target bounds, chosen deadline, wait, rearm and expired status.

split: open-access