broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + logical
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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 normalized_p.

A bounded hybrid logical timestamp has physical integer p and logical integer l, cap 255. On receive, p=max(local p,remote p,wall). Increment max logical when both timestamps share p, increment owning side when only one shares p, otherwise reset logical to zero. Carry logical overflow into physical. Return canonical pair, physical source mask, ordering versus inputs and wall-advance flag.

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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = min(logical,255)
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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 normalized_l.

A bounded hybrid logical timestamp has physical integer p and logical integer l, cap 255. On receive, p=max(local p,remote p,wall). Increment max logical when both timestamps share p, increment owning side when only one shares p, otherwise reset logical to zero. Carry logical overflow into physical. Return canonical pair, physical source mask, ordering versus inputs and wall-advance flag.

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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + int(remote_owns) + int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns)
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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 mask.

A bounded hybrid logical timestamp has physical integer p and logical integer l, cap 255. On receive, p=max(local p,remote p,wall). Increment max logical when both timestamps share p, increment owning side when only one shares p, otherwise reset logical to zero. Carry logical overflow into physical. Return canonical pair, physical source mask, ordering versus inputs and wall-advance flag.

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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = normalized_p > r['local_p']
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = normalized_l > r['local_l']
    after_remote = (normalized_p,normalized_l) > (r['remote_p'],r['remote_l'])
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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 after_local.

A bounded hybrid logical timestamp has physical integer p and logical integer l, cap 255. On receive, p=max(local p,remote p,wall). Increment max logical when both timestamps share p, increment owning side when only one shares p, otherwise reset logical to zero. Carry logical overflow into physical. Return canonical pair, physical source mask, ordering versus inputs and wall-advance flag.

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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = normalized_p > r['remote_p']
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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):
    physical = max(r['local_p'],r['remote_p'],r['wall'])
    local_owns = physical == r['local_p']
    remote_owns = physical == r['remote_p']
    logical = max(r['local_l'],r['remote_l']) + 1 if local_owns and remote_owns else (r['local_l'] + 1 if local_owns else (r['remote_l'] + 1 if remote_owns else 0))
    carry = logical // 256
    normalized_p = physical + carry
    normalized_l = logical % 256
    mask = int(local_owns) + 2 * int(remote_owns) + 4 * int(physical == r['wall'])
    after_local = (normalized_p,normalized_l) > (r['local_p'],r['local_l'])
    after_remote = normalized_l > r['remote_l']
    return [[normalized_p,normalized_l],mask,after_local,after_remote,normalized_p > r['wall']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 9}), [[10, 5], 3, True, True, True])
check('fixture 2', solve({'local_p': 10, 'local_l': 5, 'remote_p': 9, 'remote_l': 8, 'wall': 8}), [[10, 6], 1, True, True, True])
check('fixture 3', solve({'local_p': 9, 'local_l': 7, 'remote_p': 10, 'remote_l': 2, 'wall': 8}), [[10, 3], 2, True, True, True])
check('fixture 4', solve({'local_p': 10, 'local_l': 5, 'remote_p': 10, 'remote_l': 7, 'wall': 11}), [[11, 0], 4, True, True, False])
check('fixture 5', solve({'local_p': 10, 'local_l': 255, 'remote_p': 10, 'remote_l': 2, 'wall': 10}), [[11, 0], 7, True, True, True])
check('fixture 6', solve({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 255, 'wall': 9}), [[11, 0], 3, True, True, True])
check('fixture 7', solve({'local_p': 10, 'local_l': 0, 'remote_p': 10, 'remote_l': 0, 'wall': 10}), [[10, 1], 7, True, True, False])
check('fixture 8', solve({'local_p': 1, 'local_l': 200, 'remote_p': 2, 'remote_l': 0, 'wall': 1}), [[2, 1], 2, True, True, True])
check('fixture 9', solve({'local_p': 2, 'local_l': 0, 'remote_p': 1, 'remote_l': 200, 'wall': 1}), [[2, 1], 1, True, True, True])
check('fixture 10', solve({'local_p': 0, 'local_l': 0, 'remote_p': 0, 'remote_l': 0, 'wall': 1}), [[1, 0], 4, True, True, False])
check('fixture 11', solve({'local_p': 10, 'local_l': 254, 'remote_p': 10, 'remote_l': 0, 'wall': 9}), [[10, 255], 3, True, True, True])
variant = [({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 10}, [[10, 5], 7, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 11}, [[11, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 12}, [[12, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 13}, [[13, 0], 4, True, True, False]), ({'local_p': 10, 'local_l': 2, 'remote_p': 10, 'remote_l': 4, 'wall': 14}, [[14, 0], 4, True, True, 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 after_remote.

A bounded hybrid logical timestamp has physical integer p and logical integer l, cap 255. On receive, p=max(local p,remote p,wall). Increment max logical when both timestamps share p, increment owning side when only one shares p, otherwise reset logical to zero. Carry logical overflow into physical. Return canonical pair, physical source mask, ordering versus inputs and wall-advance flag.

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access