FA-92131 / PLC ladder logic scan cycles / Open access
Shift register unload bit is cleared between shifts · case 01
The reject solenoid only sees the unloaded part for the single edge scan.
ROOT CAUSE
The unload bit is zeroed at the top of every scan.
VERIFIED REPAIR
Hold the unload bit until the next shift overwrites it.
Unsuccessful approach: Clearing the unload bit whenever the clock is low still drops it between encoder pulses.
Case contract
Bit shift left (BSL) register tracking parts on a conveyor. On each rising edge of the encoder clock the bit at the far end (index length-1) moves to the unload bit, every bit moves one position toward the far end, and bit 0 loads the part-present sensor sampled on that same scan. The unload bit holds its value until the next shift. pulses is a list of [clock, sensor]; return [register string index 0 first, unload] per scan.
Why this case matters
Ladder programs are executed as repeated scans; each defect here changes what a rung, timer, counter or data-table instruction reports on a particular scan, which is how commissioning and field faults are actually observed.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(length, pulses):
bits = [0] * length
prev = False
unload = 0
out = []
for clock, sensor in pulses:
clock = bool(clock)
unload = 0
if clock and not prev:
unload = bits[length - 1]
bits = [1 if sensor else 0] + bits[:length - 1]
prev = clock
out.append([''.join(str(b) for b in bits), unload])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['regression: scenario 4',
[1,
[[False, 1],
[False, 1],
[True, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[6,
[[True, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['110000', 0],
['110000', 0],
['110000', 0],
['110000', 0]]],
['control: scenario 2',
[2, [[False, 0], [False, 0], [False, 0], [False, 0], [False, 1], [True, 1], [False, 0], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: scenario 3',
[5,
[[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 0]]],
[['00000', 0],
['00000', 0],
['00000', 0],
['10000', 0],
['10000', 0],
['10000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0]]]],
[['regression: scenario 3',
[1,
[[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 1],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0]]],
['regression: scenario 11',
[1, [[True, 1], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [False, 0], [True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2,
[[False, 1],
[False, 0],
[True, 0],
[False, 0],
[True, 0],
[True, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 1]]],
[['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0]]],
['control: scenario 2',
[2,
[[True, 0], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [True, 0], [False, 1], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0]]]],
[['regression: scenario 9',
[2,
[[False, 0],
[False, 0],
[False, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['11', 0],
['11', 0],
['11', 0],
['11', 0],
['01', 1],
['01', 1],
['01', 1],
['01', 1],
['01', 1]]],
['regression: scenario 13',
[1,
[[True, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[4,
[[False, 0],
[False, 1],
[True, 1],
[True, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 1]]],
[['0000', 0],
['0000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1100', 0],
['1100', 0],
['1100', 0],
['1110', 0],
['1110', 0]]],
['regression: scenario 2',
[1,
[[True, 0],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['0', 1]]]],
[['regression: scenario 26',
[1,
[[False, 1],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['regression: scenario 29',
[2,
[[False, 0],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['01', 0],
['01', 0],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2, [[True, 0], [False, 1], [True, 0], [False, 0], [False, 1], [False, 1], [True, 1], [True, 1]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0]]],
['control: scenario 2',
[3,
[[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 0],
[False, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0],
[False, 0],
[True, 1]]],
[['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['101', 0]]]],
[['regression: scenario 11',
[3,
[[False, 0],
[True, 1],
[True, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['110', 1],
['110', 1]]],
['regression: scenario 14',
[1,
[[False, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 1]]],
[['0', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['regression: scenario 1',
[3,
[[False, 0],
[True, 1],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['010', 1],
['010', 1],
['010', 1],
['010', 1],
['001', 0]]],
['control: scenario 2',
[6,
[[True, 0],
[True, 0],
[False, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0]]]]]
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: single stage | [['1', 0], ['1', 0], ['0', 1], ['0', 0], ['1', 0]] | [['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]] | Failed |
| regression: scenario 4 | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | Failed |
| control: three stage track | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | Passed |
| control: clock held high | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: sensor changes on edge scan | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | Passed |
| control: scenario 1 | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | Passed |
| control: scenario 2 | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: scenario 3 | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | Passed |
SHA-256 / 82c8186809d55dc9cff8be21c1e430cf132f52fe6084c6cac162d4777518bfbe
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(length, pulses):
bits = [0] * length
prev = False
unload = 0
out = []
for clock, sensor in pulses:
clock = bool(clock)
if not clock:
unload = 0
if clock and not prev:
unload = bits[length - 1]
bits = [1 if sensor else 0] + bits[:length - 1]
prev = clock
out.append([''.join(str(b) for b in bits), unload])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['regression: scenario 4',
[1,
[[False, 1],
[False, 1],
[True, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[6,
[[True, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['110000', 0],
['110000', 0],
['110000', 0],
['110000', 0]]],
['control: scenario 2',
[2, [[False, 0], [False, 0], [False, 0], [False, 0], [False, 1], [True, 1], [False, 0], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: scenario 3',
[5,
[[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 0]]],
[['00000', 0],
['00000', 0],
['00000', 0],
['10000', 0],
['10000', 0],
['10000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0]]]],
[['regression: scenario 3',
[1,
[[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 1],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0]]],
['regression: scenario 11',
[1, [[True, 1], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [False, 0], [True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2,
[[False, 1],
[False, 0],
[True, 0],
[False, 0],
[True, 0],
[True, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 1]]],
[['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0]]],
['control: scenario 2',
[2,
[[True, 0], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [True, 0], [False, 1], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0]]]],
[['regression: scenario 9',
[2,
[[False, 0],
[False, 0],
[False, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['11', 0],
['11', 0],
['11', 0],
['11', 0],
['01', 1],
['01', 1],
['01', 1],
['01', 1],
['01', 1]]],
['regression: scenario 13',
[1,
[[True, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[4,
[[False, 0],
[False, 1],
[True, 1],
[True, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 1]]],
[['0000', 0],
['0000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1100', 0],
['1100', 0],
['1100', 0],
['1110', 0],
['1110', 0]]],
['regression: scenario 2',
[1,
[[True, 0],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['0', 1]]]],
[['regression: scenario 26',
[1,
[[False, 1],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['regression: scenario 29',
[2,
[[False, 0],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['01', 0],
['01', 0],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2, [[True, 0], [False, 1], [True, 0], [False, 0], [False, 1], [False, 1], [True, 1], [True, 1]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0]]],
['control: scenario 2',
[3,
[[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 0],
[False, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0],
[False, 0],
[True, 1]]],
[['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['101', 0]]]],
[['regression: scenario 11',
[3,
[[False, 0],
[True, 1],
[True, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['110', 1],
['110', 1]]],
['regression: scenario 14',
[1,
[[False, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 1]]],
[['0', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['regression: scenario 1',
[3,
[[False, 0],
[True, 1],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['010', 1],
['010', 1],
['010', 1],
['010', 1],
['001', 0]]],
['control: scenario 2',
[6,
[[True, 0],
[True, 0],
[False, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0]]]]]
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: single stage | [['1', 0], ['1', 0], ['0', 1], ['0', 0], ['1', 0]] | [['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]] | Failed |
| regression: scenario 4 | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | Failed |
| control: three stage track | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | Passed |
| control: clock held high | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: sensor changes on edge scan | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | Passed |
| control: scenario 1 | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | Passed |
| control: scenario 2 | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: scenario 3 | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | Passed |
SHA-256 / 6c1aa6d679fe7c84e084d6299a8ca0ac472fc2159e123d6678587afc31916e7c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(length, pulses):
bits = [0] * length
prev = False
unload = 0
out = []
for clock, sensor in pulses:
clock = bool(clock)
if clock and not prev:
unload = bits[length - 1]
bits = [1 if sensor else 0] + bits[:length - 1]
prev = clock
out.append([''.join(str(b) for b in bits), unload])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['regression: scenario 4',
[1,
[[False, 1],
[False, 1],
[True, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[6,
[[True, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['100000', 0],
['110000', 0],
['110000', 0],
['110000', 0],
['110000', 0]]],
['control: scenario 2',
[2, [[False, 0], [False, 0], [False, 0], [False, 0], [False, 1], [True, 1], [False, 0], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: scenario 3',
[5,
[[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 0]]],
[['00000', 0],
['00000', 0],
['00000', 0],
['10000', 0],
['10000', 0],
['10000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0],
['01000', 0]]]],
[['regression: scenario 3',
[1,
[[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 1],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0]]],
['regression: scenario 11',
[1, [[True, 1], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [False, 0], [True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2,
[[False, 1],
[False, 0],
[True, 0],
[False, 0],
[True, 0],
[True, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 1]]],
[['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0],
['00', 0]]],
['control: scenario 2',
[2,
[[True, 0], [False, 1], [False, 1], [True, 0], [False, 1], [False, 0], [True, 0], [False, 1], [True, 0]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0]]]],
[['regression: scenario 9',
[2,
[[False, 0],
[False, 0],
[False, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[False, 1],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['11', 0],
['11', 0],
['11', 0],
['11', 0],
['01', 1],
['01', 1],
['01', 1],
['01', 1],
['01', 1]]],
['regression: scenario 13',
[1,
[[True, 1],
[True, 1],
[False, 0],
[True, 0],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[True, 0]]],
[['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[4,
[[False, 0],
[False, 1],
[True, 1],
[True, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 1],
[True, 1]]],
[['0000', 0],
['0000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1000', 0],
['1100', 0],
['1100', 0],
['1100', 0],
['1110', 0],
['1110', 0]]],
['regression: scenario 2',
[1,
[[True, 0],
[False, 0],
[False, 1],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 1],
[True, 1],
[True, 1],
[False, 1],
[True, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['1', 1],
['0', 1]]]],
[['regression: scenario 26',
[1,
[[False, 1],
[False, 1],
[False, 0],
[True, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0]]],
[['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['0', 0],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['regression: scenario 29',
[2,
[[False, 0],
[False, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 1],
[True, 0],
[False, 0],
[False, 0],
[False, 0],
[False, 1],
[False, 0]]],
[['00', 0],
['00', 0],
['00', 0],
['10', 0],
['10', 0],
['10', 0],
['01', 0],
['01', 0],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1],
['00', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['control: scenario 1',
[2, [[True, 0], [False, 1], [True, 0], [False, 0], [False, 1], [False, 1], [True, 1], [True, 1]]],
[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0]]],
['control: scenario 2',
[3,
[[True, 0],
[False, 1],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[True, 0],
[False, 0],
[False, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0],
[False, 0],
[True, 1]]],
[['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['000', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['101', 0]]]],
[['regression: scenario 11',
[3,
[[False, 0],
[True, 1],
[True, 1],
[True, 0],
[True, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['110', 1],
['110', 1]]],
['regression: scenario 14',
[1,
[[False, 1],
[True, 1],
[False, 1],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 0],
[False, 0],
[True, 1],
[True, 0],
[False, 0],
[True, 0],
[True, 1],
[False, 1]]],
[['0', 0],
['1', 0],
['1', 0],
['1', 1],
['1', 1],
['1', 1],
['0', 1],
['0', 1],
['0', 1],
['0', 1],
['1', 0],
['1', 0],
['1', 0],
['0', 1],
['0', 1],
['0', 1]]],
['control: three stage track',
[3, [[True, 1], [False, 0], [True, 0], [False, 0], [True, 1], [False, 0], [True, 0]]],
[['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]],
['regression: single stage',
[1, [[True, 1], [False, 0], [True, 0], [False, 1], [True, 1]]],
[['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]],
['control: clock held high',
[2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
['control: sensor changes on edge scan',
[3, [[False, 1], [True, 0], [False, 0], [True, 1], [False, 0]]],
[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]],
['regression: scenario 1',
[3,
[[False, 0],
[True, 1],
[True, 0],
[False, 0],
[False, 1],
[True, 0],
[True, 1],
[False, 0],
[True, 1],
[False, 1],
[True, 0],
[True, 1],
[False, 1],
[False, 1],
[True, 0]]],
[['000', 0],
['100', 0],
['100', 0],
['100', 0],
['100', 0],
['010', 0],
['010', 0],
['010', 0],
['101', 0],
['101', 0],
['010', 1],
['010', 1],
['010', 1],
['010', 1],
['001', 0]]],
['control: scenario 2',
[6,
[[True, 0],
[True, 0],
[False, 0],
[True, 0],
[False, 1],
[False, 0],
[True, 0],
[False, 1],
[True, 0],
[True, 1],
[True, 1],
[False, 0]]],
[['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0],
['000000', 0]]]]]
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: single stage | [['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]] | [['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]] | Passed |
| regression: scenario 4 | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | [['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0]] | Passed |
| control: three stage track | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | [['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]] | Passed |
| control: clock held high | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: sensor changes on edge scan | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | [['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]] | Passed |
| control: scenario 1 | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | [['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['100000', 0], ['110000', 0], ['110000', 0], ['110000', 0], ['110000', 0]] | Passed |
| control: scenario 2 | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]] | Passed |
| control: scenario 3 | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | [['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]] | Passed |
SHA-256 / 38392b37778342e926280411151ce9d9e08e99dea0f3244350a0854e4e42d846
Verification & scope
A deterministic bounded teaching model of one PLC instruction or rung pattern evaluated scan by scan. The stated contract is a stipulated toy convention, not a claim of conformance to any vendor controller or IEC 61131-3 runtime. 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:42.927438+00:00.
Case digest / ecbb0bb6c0b12f973e10ef15dd869c7841fdf7a8a00d24d9ebdb4831f66c5a22