broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = floor - r['wall']
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,r['wall']-floor)
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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 debt.

A presentation clock preserves monotonic output while exposing raw wall coordinate and rollback debt. It advances a floor by monotonic elapsed since previous sample; publish max(raw wall,floor) if continuity mode enabled, otherwise raw wall. On explicit reset, discard old floor. Output adjusted coordinate, added bias, rollback marker, debt, source mode and next checkpoint. Negative elapsed invalidates sample.

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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if rollback else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if r['continuous'] else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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 mode.

A presentation clock preserves monotonic output while exposing raw wall coordinate and rollback debt. It advances a floor by monotonic elapsed since previous sample; publish max(raw wall,floor) if continuity mode enabled, otherwise raw wall. On explicit reset, discard old floor. Output adjusted coordinate, added bias, rollback marker, debt, source mode and next checkpoint. Negative elapsed invalidates sample.

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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = output
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = r['wall'] if valid else r['last_output']
    checkpoint_mono = r['mono'] if valid else r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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 checkpoint_output.

A presentation clock preserves monotonic output while exposing raw wall coordinate and rollback debt. It advances a floor by monotonic elapsed since previous sample; publish max(raw wall,floor) if continuity mode enabled, otherwise raw wall. On explicit reset, discard old floor. Output adjusted coordinate, added bias, rollback marker, debt, source mode and next checkpoint. Negative elapsed invalidates sample.

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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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):
    elapsed = r['mono'] - r['last_mono']
    valid = elapsed >= 0
    floor = r['wall'] if r['reset'] else r['last_output'] + max(0,elapsed)
    rollback = r['wall'] < floor
    output = max(r['wall'],floor) if r['continuous'] else r['wall']
    bias = output - r['wall']
    debt = max(0,floor - r['wall'])
    mode = 'floor' if r['continuous'] and rollback else 'wall'
    checkpoint_output = output if valid else r['last_output']
    checkpoint_mono = r['last_mono']
    return [valid,output,bias,debt,mode,[checkpoint_output,checkpoint_mono],rollback]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 5, 5, 'floor', [110, 20], True])
check('fixture 2', solve({'mono': 20, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 120, 0, 0, 'wall', [120, 20], False])
check('fixture 3', solve({'mono': 20, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 2}), [True, 105, 0, 5, 'wall', [105, 20], True])
check('fixture 4', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': True, 'continuous': True, 'last_bias': 2}), [True, 90, 0, 0, 'wall', [90, 20], False])
check('fixture 5', solve({'mono': 10, 'last_mono': 10, 'wall': 100, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 100, 0, 0, 'wall', [100, 10], False])
check('fixture 6', solve({'mono': 9, 'last_mono': 10, 'wall': 101, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [False, 101, 0, 0, 'wall', [100, 10], False])
check('fixture 7', solve({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 0, 0, 'wall', [110, 20], False])
check('fixture 8', solve({'mono': 20, 'last_mono': 10, 'wall': 90, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}), [True, 110, 20, 20, 'floor', [110, 20], True])
check('fixture 9', solve({'mono': 30, 'last_mono': 10, 'wall': 105, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 5}), [True, 120, 15, 15, 'floor', [120, 30], True])
check('fixture 10', solve({'mono': 10, 'last_mono': 10, 'wall': 120, 'last_output': 100, 'reset': False, 'continuous': False, 'last_bias': 0}), [True, 120, 0, 0, 'wall', [120, 10], False])
variant = [({'mono': 20, 'last_mono': 10, 'wall': 106, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 4, 4, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 107, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 3, 3, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 108, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 2, 2, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 109, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 1, 1, 'floor', [110, 20], True]), ({'mono': 20, 'last_mono': 10, 'wall': 110, 'last_output': 100, 'reset': False, 'continuous': True, 'last_bias': 2}, [True, 110, 0, 0, 'wall', [110, 20], 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 checkpoint_mono.

A presentation clock preserves monotonic output while exposing raw wall coordinate and rollback debt. It advances a floor by monotonic elapsed since previous sample; publish max(raw wall,floor) if continuity mode enabled, otherwise raw wall. On explicit reset, discard old floor. Output adjusted coordinate, added bias, rollback marker, debt, source mode and next checkpoint. Negative elapsed invalidates sample.

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):
    base_era = int(Fraction(r['reference'],1024))
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1023
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 base_era.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [base_era * 1024 + r['week']]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era+k)*1024+r['week'] for k in (0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 candidates.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [x-r['reference'] for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x%1024-r['reference']%1024) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 distances.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = max(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = distances[1] if len(distances)>1 else distances[0]
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 nearest.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [candidates[distances.index(nearest)]]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [max(x for x,d in zip(candidates,distances) if d == nearest)]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 winners.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or nearest + r['reference_uncertainty'] > 512
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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 ambiguous.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] <= 1024 and 0 <= r['tick'] < 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
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):
    base_era = r['reference'] // 1024
    candidates = [(base_era + k) * 1024 + r['week'] for k in (-1,0,1)]
    distances = [abs(x-r['reference']) for x in candidates]
    nearest = min(distances)
    winners = [x for x,d in zip(candidates,distances) if d == nearest]
    ambiguous = len(winners) != 1 or (r['reference_uncertainty'] > 0 and nearest + r['reference_uncertainty'] >= 512)
    valid_fields = 0 <= r['week'] < 1024 and 0 <= r['tick'] <= 100
    trusted = nearest <= r['radius']
    chosen = winners[0] if not ambiguous and valid_fields and trusted else None
    absolute_tick = None if chosen is None else chosen * 100 + r['tick']
    return [chosen,absolute_tick,ambiguous,nearest,None if chosen is None else chosen//1024]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reference': 1023, 'week': 0, 'tick': 1, 'radius': 2, 'reference_uncertainty': 0}), [1024, 102401, False, 1, 1])
check('fixture 2', solve({'reference': 1024, 'week': 1023, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}), [1023, 102302, False, 1, 0])
check('fixture 3', solve({'reference': 512, 'week': 0, 'tick': 5, 'radius': 600, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 4', solve({'reference': 0, 'week': 512, 'tick': 1, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 5', solve({'reference': -1, 'week': 0, 'tick': 1, 'radius': 1, 'reference_uncertainty': 0}), [0, 1, False, 1, 0])
check('fixture 6', solve({'reference': -1025, 'week': 1023, 'tick': 2, 'radius': 1, 'reference_uncertainty': 0}), [-1025, -102498, False, 0, -2])
check('fixture 7', solve({'reference': 100, 'week': 100, 'tick': 99, 'radius': 0, 'reference_uncertainty': 0}), [100, 10099, False, 0, 0])
check('fixture 8', solve({'reference': 100, 'week': 100, 'tick': 100, 'radius': 1, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 9', solve({'reference': 1024, 'week': 1024, 'tick': 0, 'radius': 1024, 'reference_uncertainty': 0}), [None, None, False, 0, None])
check('fixture 10', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 99, 'reference_uncertainty': 0}), [None, None, False, 100, None])
check('fixture 11', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 100, 'reference_uncertainty': 0}), [200, 20001, False, 100, 0])
check('fixture 12', solve({'reference': 3072, 'week': 1, 'tick': 2, 'radius': 10, 'reference_uncertainty': 0}), [3073, 307302, False, 1, 3])
check('fixture 13', solve({'reference': -513, 'week': 1023, 'tick': 0, 'radius': 512, 'reference_uncertainty': 0}), [None, None, True, 512, None])
check('fixture 14', solve({'reference': 5120000, 'week': 0, 'tick': 0, 'radius': 1, 'reference_uncertainty': 0}), [5120000, 512000000, False, 0, 5000])
check('fixture 15', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 411}), [200, 20001, False, 100, 0])
check('fixture 16', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 412}), [None, None, True, 100, None])
check('fixture 17', solve({'reference': 100, 'week': 200, 'tick': 1, 'radius': 600, 'reference_uncertainty': 500}), [None, None, True, 100, None])
variant = [({'reference': 1023, 'week': 0, 'tick': 2, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102402, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 3, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102403, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 4, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102404, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 5, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102405, False, 1, 1]), ({'reference': 1023, 'week': 0, 'tick': 6, 'radius': 2, 'reference_uncertainty': 0}, [1024, 102406, False, 1, 1])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The decoded time state disagrees with the explicit regression oracle for valid_fields.

Controlled week counter has 1024-week eras. A received low week 0..1023 and tick-within-week 0..99 must resolve near trusted absolute reference week, considering neighboring eras. Pick minimum absolute week distance; ties are ambiguous and rejected. Also require distance within trust radius. Report accepted absolute week/tick plus ambiguity, distance and selected era. No GNSS standards compliance is claimed. A nonnegative reference uncertainty invalidates selection if nearest distance plus uncertainty reaches the 512-week half-era boundary.

split: open-access