FA-92946 / EV charging session scheduling / Open access
Charging profile stack resolution: relative schedule origin · case 01
Relative profiles step through their periods on the wall clock instead of session elapsed time.
ROOT CAUSE
Relative profiles are anchored at their validity start rather than the session start.
THE FAILURE
Relative profiles are anchored at their validity start rather than the session start.
Unsuccessful approach: Taking the later of session start and validity start still misanchors sessions that began later than validity.
Case contract
Each profile has purpose max/default/tx, stack level, validity [valid_from, valid_to) (valid_to None = open), kind absolute (origin valid_from) or relative (origin session_start; skipped when no session) and periods [[offset, amps]] in any order. A profile yields the amps of the last period with offset <= t-origin, or nothing before its first period. Per purpose the highest stack wins (ties: earlier profile). tx replaces default. Effective limit is the minimum of max, tx-or-default and hw_max, ties resolved in that order. Return [amps, source].
Why this case matters
Depot, workplace and public EV chargers schedule sessions against prices, circuit limits and departure deadlines; a wrong decision silently strands a driver or overloads a feeder.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(profiles, t, session_start, hw_max):
best = {}
for p in profiles:
if not (p['valid_from'] <= t and (p['valid_to'] is None or t < p['valid_to'])):
continue
if p['kind'] == 'relative':
if session_start is None:
continue
origin = p['valid_from']
else:
origin = p['valid_from']
el = t - origin
lim = None
for off, val in sorted(p['periods']):
if off <= el:
lim = val
if lim is None:
continue
cur = best.get(p['purpose'])
if cur is None or p['stack'] > cur[0]:
best[p['purpose']] = [p['stack'], lim]
cands = []
if 'max' in best:
cands.append(['max', best['max'][1]])
if 'tx' in best:
cands.append(['tx', best['tx'][1]])
elif 'default' in best:
cands.append(['default', best['default'][1]])
cands.append(['hw', hw_max])
win = cands[0]
for c in cands[1:]:
if c[1] < win[1]:
win = c
return [win[1], win[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 6,
'valid_to': 42,
'kind': 'relative',
'periods': [[0, 20], [10, 16]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 59,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 32], [0, 6]]}],
12, 0, 24],
[16, 'tx']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 49,
'valid_to': 55,
'kind': 'relative',
'periods': [[30, 20], [10, 10], [0, 20]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 51,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 32], [0, 6], [0, 10]]}],
59, 20, 16],
[16, 'hw']],
['control 1',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 10], [0, 10], [5, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 7,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [30, 20]]}],
3, None, 24],
[24, 'hw']],
['control 2',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 11,
'valid_to': 21,
'kind': 'relative',
'periods': [[30, 32], [10, 20], [45, 6]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 14,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 19,
'valid_to': 56,
'kind': 'absolute',
'periods': [[0, 6], [45, 10], [20, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 53,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [0, 32], [0, 20]]}],
97, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 60,
'valid_to': 79,
'kind': 'relative',
'periods': [[0, 6], [30, 32], [5, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 21,
'valid_to': 94,
'kind': 'relative',
'periods': [[5, 6], [30, 16], [0, 20]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 56,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32], [10, 6]]}],
30, 58, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 39,
'valid_to': 113,
'kind': 'relative',
'periods': [[30, 10], [20, 32]]}],
54, 7, 16],
[10, 'max']],
['control 1',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 20,
'valid_to': 56,
'kind': 'relative',
'periods': [[20, 10], [10, 20]]}],
53, 38, 24],
[20, 'default']],
['control 2',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 30,
'valid_to': 93,
'kind': 'absolute',
'periods': [[20, 6], [45, 10]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 14,
'valid_to': 89,
'kind': 'relative',
'periods': [[10, 16], [45, 20]]}],
43, 36, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 22,
'valid_to': 86,
'kind': 'relative',
'periods': [[30, 10], [10, 20], [45, 32]]}],
51, 2, 24],
[24, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': 52,
'kind': 'absolute',
'periods': [[30, 16], [45, 32], [0, 16]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [0, 10], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 58,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 16]]}],
74, None, 24],
[16, 'max']],
['control 2',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 6], [20, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 59,
'valid_to': 85,
'kind': 'absolute',
'periods': [[5, 6], [5, 20], [30, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 10], [30, 10]]}],
15, 48, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 34,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 16], [0, 32]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 25,
'valid_to': 27,
'kind': 'relative',
'periods': [[20, 32], [0, 20], [45, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 19,
'valid_to': 59,
'kind': 'relative',
'periods': [[45, 16], [45, 32], [0, 6]]}],
23, 45, 24],
[24, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 0,
'valid_from': 9,
'valid_to': 26,
'kind': 'absolute',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 36,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 32], [10, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 54,
'valid_to': 130,
'kind': 'relative',
'periods': [[30, 32], [10, 10], [30, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [20, 20], [5, 32]]}],
81, 13, 32],
[32, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 22,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 34,
'valid_to': 106,
'kind': 'absolute',
'periods': [[30, 16], [30, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 11,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6], [30, 20]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 6], [5, 6], [45, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 12,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32], [20, 6]]}],
77, None, 24],
[20, 'tx']],
['control 2',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 55,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [30, 10]]}],
25, 14, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 16], [10, 20]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 12,
'valid_to': 24,
'kind': 'relative',
'periods': [[0, 10]]}],
30, 54, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 24,
'valid_to': 74,
'kind': 'relative',
'periods': [[45, 10]]},
{'purpose': 'max',
'stack': 2,
'valid_from': 43,
'valid_to': 81,
'kind': 'relative',
'periods': [[20, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 3,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 16], [20, 20]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 20,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 20], [5, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 5,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 32], [30, 16], [0, 20]]}],
56, 8, 16],
[10, 'max']],
['control 1',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6]]}],
71, 15, 16],
[6, 'tx']],
['control 2',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 39,
'valid_to': 108,
'kind': 'absolute',
'periods': [[20, 16], [30, 32], [20, 20]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 45,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 20]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 21,
'valid_to': 46,
'kind': 'absolute',
'periods': [[5, 20]]}],
34, None, 24],
[20, 'default']]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: profile expires at t | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: relative profile without session | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: tx overrides lower default | [20, 'tx'] | [20, 'tx'] | Passed |
| regression: relative schedule origin | [20, 'tx'] | [16, 'tx'] | Failed |
| regression: relative schedule origin (partial repair) | [10, 'tx'] | [16, 'hw'] | Failed |
| control 1 | [24, 'hw'] | [24, 'hw'] | Passed |
| control 2 | [16, 'hw'] | [16, 'hw'] | Passed |
SHA-256 / 893b0e57aa79d8119d4b937965459372be38c4edde0a4febd3ffdc547b444615
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(profiles, t, session_start, hw_max):
best = {}
for p in profiles:
if not (p['valid_from'] <= t and (p['valid_to'] is None or t < p['valid_to'])):
continue
if p['kind'] == 'relative':
if session_start is None:
continue
origin = max(session_start, p['valid_from'])
else:
origin = p['valid_from']
el = t - origin
lim = None
for off, val in sorted(p['periods']):
if off <= el:
lim = val
if lim is None:
continue
cur = best.get(p['purpose'])
if cur is None or p['stack'] > cur[0]:
best[p['purpose']] = [p['stack'], lim]
cands = []
if 'max' in best:
cands.append(['max', best['max'][1]])
if 'tx' in best:
cands.append(['tx', best['tx'][1]])
elif 'default' in best:
cands.append(['default', best['default'][1]])
cands.append(['hw', hw_max])
win = cands[0]
for c in cands[1:]:
if c[1] < win[1]:
win = c
return [win[1], win[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 6,
'valid_to': 42,
'kind': 'relative',
'periods': [[0, 20], [10, 16]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 59,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 32], [0, 6]]}],
12, 0, 24],
[16, 'tx']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 49,
'valid_to': 55,
'kind': 'relative',
'periods': [[30, 20], [10, 10], [0, 20]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 51,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 32], [0, 6], [0, 10]]}],
59, 20, 16],
[16, 'hw']],
['control 1',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 10], [0, 10], [5, 10]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 7,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [30, 20]]}],
3, None, 24],
[24, 'hw']],
['control 2',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 11,
'valid_to': 21,
'kind': 'relative',
'periods': [[30, 32], [10, 20], [45, 6]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 14,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 19,
'valid_to': 56,
'kind': 'absolute',
'periods': [[0, 6], [45, 10], [20, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 53,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 10], [0, 32], [0, 20]]}],
97, None, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 60,
'valid_to': 79,
'kind': 'relative',
'periods': [[0, 6], [30, 32], [5, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 21,
'valid_to': 94,
'kind': 'relative',
'periods': [[5, 6], [30, 16], [0, 20]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 56,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32], [10, 6]]}],
30, 58, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 39,
'valid_to': 113,
'kind': 'relative',
'periods': [[30, 10], [20, 32]]}],
54, 7, 16],
[10, 'max']],
['control 1',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 20,
'valid_to': 56,
'kind': 'relative',
'periods': [[20, 10], [10, 20]]}],
53, 38, 24],
[20, 'default']],
['control 2',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 43,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 44,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 32], [45, 6], [20, 20]]}],
88, 57, 24],
[24, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 30,
'valid_to': 93,
'kind': 'absolute',
'periods': [[20, 6], [45, 10]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 14,
'valid_to': 89,
'kind': 'relative',
'periods': [[10, 16], [45, 20]]}],
43, 36, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 22,
'valid_to': 86,
'kind': 'relative',
'periods': [[30, 10], [10, 20], [45, 32]]}],
51, 2, 24],
[24, 'hw']],
['control 1',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': 52,
'kind': 'absolute',
'periods': [[30, 16], [45, 32], [0, 16]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 13,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [0, 10], [45, 16]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 58,
'valid_to': None,
'kind': 'relative',
'periods': [[10, 16]]}],
74, None, 24],
[16, 'max']],
['control 2',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 6], [20, 32]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 59,
'valid_to': 85,
'kind': 'absolute',
'periods': [[5, 6], [5, 20], [30, 20]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 10], [30, 10]]}],
15, 48, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 34,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 16], [0, 32]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 25,
'valid_to': 27,
'kind': 'relative',
'periods': [[20, 32], [0, 20], [45, 16]]},
{'purpose': 'max',
'stack': 1,
'valid_from': 19,
'valid_to': 59,
'kind': 'relative',
'periods': [[45, 16], [45, 32], [0, 6]]}],
23, 45, 24],
[24, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 0,
'valid_from': 9,
'valid_to': 26,
'kind': 'absolute',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 36,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6], [10, 32], [10, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 54,
'valid_to': 130,
'kind': 'relative',
'periods': [[30, 32], [10, 10], [30, 6]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 29,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6], [20, 20], [5, 32]]}],
81, 13, 32],
[32, 'tx']],
['control 1',
[[{'purpose': 'max',
'stack': 2,
'valid_from': 22,
'valid_to': None,
'kind': 'relative',
'periods': [[30, 6]]},
{'purpose': 'default',
'stack': 0,
'valid_from': 34,
'valid_to': 106,
'kind': 'absolute',
'periods': [[30, 16], [30, 10]]},
{'purpose': 'tx',
'stack': 2,
'valid_from': 11,
'valid_to': None,
'kind': 'absolute',
'periods': [[10, 6], [30, 20]]},
{'purpose': 'default',
'stack': 2,
'valid_from': 26,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 6], [5, 6], [45, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 12,
'valid_to': None,
'kind': 'absolute',
'periods': [[20, 32], [20, 6]]}],
77, None, 24],
[20, 'tx']],
['control 2',
[[{'purpose': 'default',
'stack': 2,
'valid_from': 55,
'valid_to': None,
'kind': 'absolute',
'periods': [[5, 10], [30, 10]]}],
25, 14, 16],
[16, 'hw']]],
[['boundary: profile expires at t',
[[{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': 30,
'kind': 'absolute',
'periods': [[0, 10]]}],
30, None, 32],
[32, 'hw']],
['boundary: relative profile without session',
[[{'purpose': 'default',
'stack': 1,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 8]]}],
20, None, 32],
[32, 'hw']],
['boundary: tx overrides lower default',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 6]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'absolute',
'periods': [[0, 20]]}],
5, 0, 32],
[20, 'tx']],
['regression: relative schedule origin',
[[{'purpose': 'default',
'stack': 0,
'valid_from': 0,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 16], [10, 20]]},
{'purpose': 'tx',
'stack': 0,
'valid_from': 12,
'valid_to': 24,
'kind': 'relative',
'periods': [[0, 10]]}],
30, 54, 32],
[32, 'hw']],
['regression: relative schedule origin (partial repair)',
[[{'purpose': 'max',
'stack': 1,
'valid_from': 24,
'valid_to': 74,
'kind': 'relative',
'periods': [[45, 10]]},
{'purpose': 'max',
'stack': 2,
'valid_from': 43,
'valid_to': 81,
'kind': 'relative',
'periods': [[20, 10]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 3,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 16], [20, 20]]},
{'purpose': 'tx',
'stack': 1,
'valid_from': 20,
'valid_to': None,
'kind': 'relative',
'periods': [[45, 20], [5, 32]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 5,
'valid_to': None,
'kind': 'relative',
'periods': [[0, 32], [30, 16], [0, 20]]}],
56, 8, 16],
[10, 'max']],
['control 1',
[[{'purpose': 'tx',
'stack': 1,
'valid_from': 8,
'valid_to': None,
'kind': 'absolute',
'periods': [[30, 6]]}],
71, 15, 16],
[6, 'tx']],
['control 2',
[[{'purpose': 'tx',
'stack': 2,
'valid_from': 39,
'valid_to': 108,
'kind': 'absolute',
'periods': [[20, 16], [30, 32], [20, 20]]},
{'purpose': 'max',
'stack': 0,
'valid_from': 45,
'valid_to': None,
'kind': 'relative',
'periods': [[5, 20]]},
{'purpose': 'default',
'stack': 1,
'valid_from': 21,
'valid_to': 46,
'kind': 'absolute',
'periods': [[5, 20]]}],
34, None, 24],
[20, 'default']]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary: profile expires at t | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: relative profile without session | [32, 'hw'] | [32, 'hw'] | Passed |
| boundary: tx overrides lower default | [20, 'tx'] | [20, 'tx'] | Passed |
| regression: relative schedule origin | [20, 'tx'] | [16, 'tx'] | Failed |
| regression: relative schedule origin (partial repair) | [10, 'tx'] | [16, 'hw'] | Failed |
| control 1 | [24, 'hw'] | [24, 'hw'] | Passed |
| control 2 | [16, 'hw'] | [16, 'hw'] | Passed |
SHA-256 / abcda29735b1bf60ce772ffa4c314ec219d1a092d392633f2fe8e1aaac63f493
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:51:50.563740+00:00.
Case digest / 56429235b0a288e5fda953682a1dc98d1556b34b410fac1f16de71abebeda542