FA-67086 / Railway interlocking logic / Open access
Movement authority end computation: scan start · case 01
The train is given no authority because its own section blocks the scan.
ROOT CAUSE
The scan starts at the train's own section, which is occupied by the train itself.
THE FAILURE
The scan starts at the train's own section, which is occupied by the train itself.
Unsuccessful approach: Starting two sections ahead skips a blocking section immediately in front of the train.
Case contract
Sections have lengths and states locked, occupied or unlocked; the train front is offset_m into section train_sec (which it occupies itself). Scan the following sections; the end of authority is the start of the first section that is not locked (reason = its state) or the end of the last section (end-of-route). If that exceeds max_ma_m ahead of the train front, the authority is cut to front + max_ma_m (reason max-length). The margin is subtracted from the end except for a max-length cut.
Why this case matters
Interlocking logic decides whether trains may be given authority; a wrong decision at this point either grants unsafe movements or strands traffic.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
secs = x['sections']
bounds = []
acc = 0
for s in secs:
bounds.append(acc)
acc += s['len']
k = x['train_sec']
eoa = acc
reason = 'end-of-route'
for j in range(k, len(secs)):
if secs[j]['state'] != 'locked':
eoa = bounds[j]
reason = secs[j]['state']
break
front = bounds[k] + x['offset_m']
if eoa - front > x['max_ma_m']:
eoa = front + x['max_ma_m']
reason = 'max-length'
if reason != 'max-length':
eoa -= x['margin_m']
return {'eoa_m': eoa, 'reason': reason}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: own section occupied', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 50, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 675, 'reason': 'end-of-route'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('sampled regression 1', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 69, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 150, 'reason': 'unlocked'}), ('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('sampled regression 4', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 206, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 1325, 'reason': 'end-of-route'}), ('sampled regression 7', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}, {'len': 500, 'state': 'unlocked'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 108, 'max_ma_m': 5000, 'margin_m': 0}, {'eoa_m': 550, 'reason': 'unlocked'}), ('sampled regression 10', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}], 'train_sec': 5, 'offset_m': 104, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1975, 'reason': 'occupied'})], [('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 4', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 206, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 1325, 'reason': 'end-of-route'}), ('sampled regression 10', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}], 'train_sec': 5, 'offset_m': 104, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1975, 'reason': 'occupied'}), ('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('sampled regression 12', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 350, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 34, 'max_ma_m': 300, 'margin_m': 50}, {'eoa_m': 884, 'reason': 'max-length'}), ('sampled regression 15', {'sections': [{'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 4, 'offset_m': 137, 'max_ma_m': 5000, 'margin_m': 0}, {'eoa_m': 2100, 'reason': 'end-of-route'}), ('sampled regression 18', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 3, 'offset_m': 181, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 1250, 'reason': 'occupied'})], [('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 11', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 239, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 500, 'reason': 'unlocked'}), ('sampled regression 34', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 222, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 850, 'reason': 'unlocked'}), ('regression: cap exactly at the obstacle', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 975, 'reason': 'occupied'}), ('regression: end of route with margin', {'sections': [{'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 0, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 150, 'reason': 'end-of-route'}), ('sampled regression 23', {'sections': [{'len': 350, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 0, 'offset_m': 20, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 1100, 'reason': 'unlocked'}), ('sampled regression 26', {'sections': [{'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 9, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 409, 'reason': 'max-length'}), ('sampled regression 29', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 288, 'max_ma_m': 600, 'margin_m': 50}, {'eoa_m': 1000, 'reason': 'occupied'})], [('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 18', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 3, 'offset_m': 181, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 1250, 'reason': 'occupied'}), ('sampled regression 40', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'unlocked'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 25, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 500, 'reason': 'unlocked'}), ('regression: unlocked section margin', {'sections': [{'len': 100, 'state': 'occupied'}, {'len': 150, 'state': 'locked'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 0, 'offset_m': 20, 'max_ma_m': 5000, 'margin_m': 30}, {'eoa_m': 220, 'reason': 'unlocked'}), ('sampled regression 34', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 222, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 850, 'reason': 'unlocked'}), ('sampled regression 37', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'unlocked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 2, 'max_ma_m': 600, 'margin_m': 50}, {'eoa_m': 602, 'reason': 'max-length'}), ('sampled regression 43', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 4, 'offset_m': 167, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 2017, 'reason': 'max-length'})], [('regression: cap exactly at the obstacle', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 975, 'reason': 'occupied'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 25', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 98, 'max_ma_m': 1000, 'margin_m': 25}, {'eoa_m': 1175, 'reason': 'end-of-route'}), ('sampled regression 57', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 37, 'max_ma_m': 300, 'margin_m': 50}, {'eoa_m': 500, 'reason': 'occupied'}), ('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('sampled regression 45', {'sections': [{'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 348, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 1198, 'reason': 'max-length'}), ('sampled regression 48', {'sections': [{'len': 500, 'state': 'unlocked'}, {'len': 200, 'state': 'unlocked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 200, 'max_ma_m': 1000, 'margin_m': 25}, {'eoa_m': 1725, 'reason': 'end-of-route'}), ('sampled regression 51', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 18, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 1100, 'reason': 'occupied'})]]
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 |
|---|---|---|---|
| regression: own section occupied | {'eoa_m': -25, 'reason': 'occupied'} | {'eoa_m': 675, 'reason': 'end-of-route'} | Failed |
| regression: unlocked section next | {'eoa_m': 175, 'reason': 'occupied'} | {'eoa_m': 375, 'reason': 'unlocked'} | Failed |
| regression: length cap from the front | {'eoa_m': -25, 'reason': 'occupied'} | {'eoa_m': 1000, 'reason': 'max-length'} | Failed |
| sampled regression 1 | {'eoa_m': -50, 'reason': 'occupied'} | {'eoa_m': 150, 'reason': 'unlocked'} | Failed |
| regression: occupied section two ahead | {'eoa_m': -25, 'reason': 'occupied'} | {'eoa_m': 375, 'reason': 'occupied'} | Failed |
| sampled regression 4 | {'eoa_m': -25, 'reason': 'occupied'} | {'eoa_m': 1325, 'reason': 'end-of-route'} | Failed |
| sampled regression 7 | {'eoa_m': 350, 'reason': 'occupied'} | {'eoa_m': 550, 'reason': 'unlocked'} | Failed |
| sampled regression 10 | {'eoa_m': 1775, 'reason': 'occupied'} | {'eoa_m': 1975, 'reason': 'occupied'} | Failed |
SHA-256 / c0bd4a404e83d74167ed49a5bb4650e219c68ba6f7e294285fb3077ab593ce5d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
secs = x['sections']
bounds = []
acc = 0
for s in secs:
bounds.append(acc)
acc += s['len']
k = x['train_sec']
eoa = acc
reason = 'end-of-route'
for j in range(k + 2, len(secs)):
if secs[j]['state'] != 'locked':
eoa = bounds[j]
reason = secs[j]['state']
break
front = bounds[k] + x['offset_m']
if eoa - front > x['max_ma_m']:
eoa = front + x['max_ma_m']
reason = 'max-length'
if reason != 'max-length':
eoa -= x['margin_m']
return {'eoa_m': eoa, 'reason': reason}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: own section occupied', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 50, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 675, 'reason': 'end-of-route'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('sampled regression 1', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 69, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 150, 'reason': 'unlocked'}), ('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('sampled regression 4', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 206, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 1325, 'reason': 'end-of-route'}), ('sampled regression 7', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}, {'len': 500, 'state': 'unlocked'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 108, 'max_ma_m': 5000, 'margin_m': 0}, {'eoa_m': 550, 'reason': 'unlocked'}), ('sampled regression 10', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}], 'train_sec': 5, 'offset_m': 104, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1975, 'reason': 'occupied'})], [('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 4', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 206, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 1325, 'reason': 'end-of-route'}), ('sampled regression 10', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}], 'train_sec': 5, 'offset_m': 104, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1975, 'reason': 'occupied'}), ('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('sampled regression 12', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 350, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 34, 'max_ma_m': 300, 'margin_m': 50}, {'eoa_m': 884, 'reason': 'max-length'}), ('sampled regression 15', {'sections': [{'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 4, 'offset_m': 137, 'max_ma_m': 5000, 'margin_m': 0}, {'eoa_m': 2100, 'reason': 'end-of-route'}), ('sampled regression 18', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 3, 'offset_m': 181, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 1250, 'reason': 'occupied'})], [('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 11', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 239, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 500, 'reason': 'unlocked'}), ('sampled regression 34', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 222, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 850, 'reason': 'unlocked'}), ('regression: cap exactly at the obstacle', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 975, 'reason': 'occupied'}), ('regression: end of route with margin', {'sections': [{'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 0, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 150, 'reason': 'end-of-route'}), ('sampled regression 23', {'sections': [{'len': 350, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 0, 'offset_m': 20, 'max_ma_m': 5000, 'margin_m': 50}, {'eoa_m': 1100, 'reason': 'unlocked'}), ('sampled regression 26', {'sections': [{'len': 100, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 9, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 409, 'reason': 'max-length'}), ('sampled regression 29', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 288, 'max_ma_m': 600, 'margin_m': 50}, {'eoa_m': 1000, 'reason': 'occupied'})], [('regression: length cap from the front', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 1000, 'reason': 'max-length'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 18', {'sections': [{'len': 200, 'state': 'unlocked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'occupied'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 3, 'offset_m': 181, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 1250, 'reason': 'occupied'}), ('sampled regression 40', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'unlocked'}, {'len': 100, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 25, 'max_ma_m': 1000, 'margin_m': 0}, {'eoa_m': 500, 'reason': 'unlocked'}), ('regression: unlocked section margin', {'sections': [{'len': 100, 'state': 'occupied'}, {'len': 150, 'state': 'locked'}, {'len': 100, 'state': 'unlocked'}], 'train_sec': 0, 'offset_m': 20, 'max_ma_m': 5000, 'margin_m': 30}, {'eoa_m': 220, 'reason': 'unlocked'}), ('sampled regression 34', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 222, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 850, 'reason': 'unlocked'}), ('sampled regression 37', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'unlocked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 2, 'max_ma_m': 600, 'margin_m': 50}, {'eoa_m': 602, 'reason': 'max-length'}), ('sampled regression 43', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 350, 'state': 'locked'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}, {'len': 100, 'state': 'locked'}], 'train_sec': 4, 'offset_m': 167, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 2017, 'reason': 'max-length'})], [('regression: cap exactly at the obstacle', {'sections': [{'len': 500, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 500, 'state': 'occupied'}], 'train_sec': 0, 'offset_m': 400, 'max_ma_m': 600, 'margin_m': 25}, {'eoa_m': 975, 'reason': 'occupied'}), ('regression: unlocked section next', {'sections': [{'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 300, 'state': 'unlocked'}], 'train_sec': 1, 'offset_m': 10, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'unlocked'}), ('sampled regression 25', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 98, 'max_ma_m': 1000, 'margin_m': 25}, {'eoa_m': 1175, 'reason': 'end-of-route'}), ('sampled regression 57', {'sections': [{'len': 350, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 500, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 37, 'max_ma_m': 300, 'margin_m': 50}, {'eoa_m': 500, 'reason': 'occupied'}), ('regression: occupied section two ahead', {'sections': [{'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}, {'len': 300, 'state': 'occupied'}, {'len': 100, 'state': 'locked'}], 'train_sec': 0, 'offset_m': 100, 'max_ma_m': 5000, 'margin_m': 25}, {'eoa_m': 375, 'reason': 'occupied'}), ('sampled regression 45', {'sections': [{'len': 350, 'state': 'unlocked'}, {'len': 200, 'state': 'locked'}, {'len': 350, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'locked'}, {'len': 200, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 348, 'max_ma_m': 300, 'margin_m': 25}, {'eoa_m': 1198, 'reason': 'max-length'}), ('sampled regression 48', {'sections': [{'len': 500, 'state': 'unlocked'}, {'len': 200, 'state': 'unlocked'}, {'len': 350, 'state': 'occupied'}, {'len': 350, 'state': 'locked'}, {'len': 350, 'state': 'locked'}], 'train_sec': 2, 'offset_m': 200, 'max_ma_m': 1000, 'margin_m': 25}, {'eoa_m': 1725, 'reason': 'end-of-route'}), ('sampled regression 51', {'sections': [{'len': 500, 'state': 'locked'}, {'len': 100, 'state': 'occupied'}, {'len': 500, 'state': 'locked'}, {'len': 200, 'state': 'occupied'}, {'len': 200, 'state': 'locked'}], 'train_sec': 1, 'offset_m': 18, 'max_ma_m': 600, 'margin_m': 0}, {'eoa_m': 1100, 'reason': 'occupied'})]]
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 |
|---|---|---|---|
| regression: own section occupied | {'eoa_m': 675, 'reason': 'end-of-route'} | {'eoa_m': 675, 'reason': 'end-of-route'} | Passed |
| regression: unlocked section next | {'eoa_m': 675, 'reason': 'end-of-route'} | {'eoa_m': 375, 'reason': 'unlocked'} | Failed |
| regression: length cap from the front | {'eoa_m': 1000, 'reason': 'max-length'} | {'eoa_m': 1000, 'reason': 'max-length'} | Passed |
| sampled regression 1 | {'eoa_m': 250, 'reason': 'occupied'} | {'eoa_m': 150, 'reason': 'unlocked'} | Failed |
| regression: occupied section two ahead | {'eoa_m': 375, 'reason': 'occupied'} | {'eoa_m': 375, 'reason': 'occupied'} | Passed |
| sampled regression 4 | {'eoa_m': 1325, 'reason': 'end-of-route'} | {'eoa_m': 1325, 'reason': 'end-of-route'} | Passed |
| sampled regression 7 | {'eoa_m': 900, 'reason': 'unlocked'} | {'eoa_m': 550, 'reason': 'unlocked'} | Failed |
| sampled regression 10 | {'eoa_m': 2175, 'reason': 'end-of-route'} | {'eoa_m': 1975, 'reason': 'occupied'} | Failed |
SHA-256 / 2a4fd1fe051947577873c8681508c2944ea130218dc0761070873986b5cdc0f7
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 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
Stipulated toy interlocking contract for a bounded teaching model; it makes no claim of conformance to any railway signalling standard and omits real safety cases. 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:47:49.610718+00:00.
Case digest / 87d0d4380459d0419267a242f674eb3bd7feddfbe0de5885d8a65fe1149998a4