broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = selected
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = selected - r['paused_ticks']
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = r['budget'] - consumed
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now']
    deadline = clock_now + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now - remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = r['mono_start'] + remaining
    expired = valid and consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = consumed >= r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    awake = r['mono_now'] - r['mono_start']
    boot = r['boot_now'] - r['boot_start']
    sleep = boot - awake
    valid = awake >= 0 and sleep >= 0
    selected = boot if r['include_suspend'] else awake
    consumed = max(0,selected - r['paused_ticks'])
    remaining = max(0,r['budget'] - consumed)
    clock_now = r['boot_now'] if r['include_suspend'] else r['mono_now']
    deadline = clock_now + remaining
    expired = valid and consumed > r['budget']
    return [valid,consumed,sleep,remaining,deadline,expired]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 20}), [True, 20, 10, 0, 50, True])
check('fixture 2', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 20}), [True, 10, 10, 10, 30, False])
check('fixture 3', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 10}), [True, 10, 0, 0, 20, True])
check('fixture 4', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 35, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 0}), [False, 5, -5, 0, 35, False])
check('fixture 5', solve({'mono_now': 5, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [False, 0, 5, 0, 5, False])
check('fixture 6', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 25, 'budget': 10}), [True, 0, 10, 10, 60, False])
check('fixture 7', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 2, 'budget': 5}), [True, 8, 10, 0, 20, True])
check('fixture 8', solve({'mono_now': 10, 'mono_start': 10, 'boot_now': 30, 'boot_start': 30, 'include_suspend': False, 'paused_ticks': 0, 'budget': 0}), [True, 0, 0, 0, 10, True])
check('fixture 9', solve({'mono_now': 30, 'mono_start': 10, 'boot_now': 70, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 5, 'budget': 50}), [True, 35, 20, 15, 85, False])
check('fixture 10', solve({'mono_now': 20, 'mono_start': 10, 'boot_now': 40, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 5}), [True, 10, 0, 0, 40, True])
variant = [({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 21}, [True, 20, 10, 1, 51, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 22}, [True, 20, 10, 2, 52, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 23}, [True, 20, 10, 3, 53, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 24}, [True, 20, 10, 4, 54, False]), ({'mono_now': 20, 'mono_start': 10, 'boot_now': 50, 'boot_start': 30, 'include_suspend': True, 'paused_ticks': 0, 'budget': 25}, [True, 20, 10, 5, 55, False])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    present = bool(r['value'])
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present'] and r['value'] != 0
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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 present.

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

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):
    present = r['present']
    version_ok = r['version'] >= 1
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present']
    version_ok = r['version'] in (1,2,3)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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 version_ok.

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = True
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] <= 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = True
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] in (None,0)
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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 offset_ok.

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] > 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000000 + r['fraction']
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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):
    present = r['present']
    version_ok = r['version'] in (1,2)
    fraction_ok = r['version'] != 2 or 0 <= r['fraction'] < 1000000000
    offset_ok = r['offset'] is None
    valid = version_ok and fraction_ok and offset_ok and r['uncertainty'] >= 0
    nanoseconds = r['value'] * 1000000 if r['version'] == 1 else (r['value'] * 1000000000 - r['fraction'])
    uncertainty = r['uncertainty'] * (1000000 if r['version'] == 1 else 1)
    seconds = nanoseconds // 1000000000
    remainder = nanoseconds - seconds * 1000000000
    precision = 1000000 if r['version'] == 1 else 1
    return ['missing' if not present else ('invalid' if not valid else 'ok'), [seconds,remainder,uncertainty,precision] if present and valid else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'present': True, 'version': 1, 'value': 0, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [0, 0, 2000000, 1000000]])
check('fixture 2', solve({'present': False, 'version': 1, 'value': 20, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['missing', None])
check('fixture 3', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 0, 'offset': None, 'uncertainty': 3}), ['ok', [1, 234000000, 3000000, 1000000]])
check('fixture 4', solve({'present': True, 'version': 2, 'value': -1, 'fraction': 500000000, 'offset': None, 'uncertainty': 4}), ['ok', [-1, 500000000, 4, 1]])
check('fixture 5', solve({'present': True, 'version': 2, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [3, 0, 2, 1]])
check('fixture 6', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 1000000000, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 7', solve({'present': True, 'version': 2, 'value': 1, 'fraction': -1, 'offset': None, 'uncertainty': 2}), ['invalid', None])
check('fixture 8', solve({'present': True, 'version': 3, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 1}), ['invalid', None])
check('fixture 9', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': 0, 'uncertainty': 1}), ['invalid', None])
check('fixture 10', solve({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': 60, 'uncertainty': 1}), ['invalid', None])
check('fixture 11', solve({'present': True, 'version': 1, 'value': -1, 'fraction': 0, 'offset': None, 'uncertainty': 2}), ['ok', [-1, 999000000, 2000000, 1000000]])
check('fixture 12', solve({'present': True, 'version': 1, 'value': 1234, 'fraction': 500, 'offset': None, 'uncertainty': 2}), ['ok', [1, 234000000, 2000000, 1000000]])
check('fixture 13', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': -1}), ['invalid', None])
check('fixture 14', solve({'present': True, 'version': 2, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 0}), ['ok', [1, 0, 0, 1]])
variant = [({'present': True, 'version': 1, 'value': 1, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 1000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 2, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 2000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 3, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 3000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 4, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 4000000, 2000000, 1000000]]), ({'present': True, 'version': 1, 'value': 5, 'fraction': 0, 'offset': None, 'uncertainty': 2}, ['ok', [0, 5000000, 2000000, 1000000]])]
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 nanoseconds.

Controlled timestamp migration from version 1 milliseconds or version 2 split seconds/nanos into exact nanoseconds. A separate presence bit distinguishes missing from epoch zero. Version 2 fraction must be 0..999999999; timezone offsets are forbidden because payload is already UTC. Preserve uncertainty in matching units and emit canonical seconds/remainder with precision and provenance. Negative uncertainty is invalid; zero means exact.

split: open-access