broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = chosen - arrival
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = abs(chosen-arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = remaining
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining >= r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = wait == 0
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen < arrival
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = remaining > 0
    absolute_wake = arrival + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = r['target_now'] + wait
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = chosen
    slack = high - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = high + low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    low = r['deadline'] + r['offset_low']
    high = r['deadline'] + r['offset_high']
    chosen = low if r['policy'] == 'no-late' else high
    arrival = r['target_now'] + r['transport']
    remaining = max(0,chosen - arrival)
    wait = min(remaining,r['max_wait'])
    rearm = remaining > r['max_wait']
    expired = chosen <= arrival
    absolute_wake = arrival + wait
    slack = chosen - low
    return [[low,high],chosen,wait,rearm,expired,absolute_wake,slack]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 22, 10, False, False, 22, 3])
check('fixture 2', solve({'deadline': 20, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': 10, 'transport': 2, 'max_wait': 100}), [[22, 25], 25, 13, False, False, 25, 3])
check('fixture 3', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-late', 'target_now': 15, 'transport': 0, 'max_wait': 20}), [[15, 18], 15, 0, False, True, 15, 3])
check('fixture 4', solve({'deadline': 20, 'offset_low': -5, 'offset_high': -2, 'policy': 'no-early', 'target_now': 20, 'transport': 1, 'max_wait': 20}), [[15, 18], 18, 0, False, True, 21, 3])
check('fixture 5', solve({'deadline': 100, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 10}), [[100, 100], 100, 10, True, False, 10, 0])
check('fixture 6', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 10, 'transport': 0, 'max_wait': 10}), [[20, 20], 20, 10, False, False, 20, 0])
check('fixture 7', solve({'deadline': 0, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-late', 'target_now': 0, 'transport': 0, 'max_wait': 1}), [[0, 0], 0, 0, False, True, 0, 0])
check('fixture 8', solve({'deadline': -10, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-early', 'target_now': -20, 'transport': 2, 'max_wait': 4}), [[-8, -5], -5, 4, True, False, -14, 3])
check('fixture 9', solve({'deadline': 20, 'offset_low': 0, 'offset_high': 0, 'policy': 'no-early', 'target_now': 19, 'transport': 0, 'max_wait': 2}), [[20, 20], 20, 1, False, False, 20, 0])
check('fixture 10', solve({'deadline': 10, 'offset_low': 2, 'offset_high': 8, 'policy': 'no-late', 'target_now': 10, 'transport': 4, 'max_wait': 10}), [[12, 18], 12, 0, False, True, 14, 6])
variant = [({'deadline': 21, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[23, 26], 23, 11, False, False, 23, 3]), ({'deadline': 22, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[24, 27], 24, 12, False, False, 24, 3]), ({'deadline': 23, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[25, 28], 25, 13, False, False, 25, 3]), ({'deadline': 24, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[26, 29], 26, 14, False, False, 26, 3]), ({'deadline': 25, 'offset_low': 2, 'offset_high': 5, 'policy': 'no-late', 'target_now': 10, 'transport': 2, 'max_wait': 100}, [[27, 30], 27, 15, False, False, 27, 3])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access


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

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

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

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

split: open-access