FAILURE MAP
← Case archive

FA-92121 / PLC ladder logic scan cycles / Open access

Shift register shifts every scan while the encoder input is high · case 01

Tracking runs ahead of the conveyor when the encoder pulse spans several scans.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The shift condition tests the clock level instead of its rising edge.

VERIFIED REPAIR

Shift only on a false-to-true clock transition.

Unsuccessful approach: Shifting on any clock change doubles the shift rate.

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)
        if clock:
            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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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]]],
  ['regression: 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]]],
  ['regression: 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 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]]]],
 [['regression: 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]]],
  ['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: 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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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 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 4',
   [2,
    [[False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 0],
     [True, 0]]],
   [['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['01', 0],
    ['01', 0],
    ['00', 1]]]],
 [['regression: scenario 3',
   [6, [[False, 1], [False, 0], [True, 0], [True, 1], [True, 0], [False, 0], [True, 0], [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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 4',
   [2,
    [[False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [True, 1],
     [True, 0],
     [True, 0],
     [True, 0]]],
   [['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0]]]],
 [['regression: scenario 3',
   [3,
    [[False, 1],
     [False, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [True, 0],
     [True, 1],
     [False, 0]]],
   [['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['010', 0],
    ['010', 0],
    ['010', 0]]],
  ['regression: 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: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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 4',
   [1,
    [[True, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [False, 1],
     [False, 1],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 1],
     [False, 0],
     [True, 0],
     [False, 1]]],
   [['1', 0],
    ['1', 0],
    ['1', 0],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['0', 1],
    ['0', 1],
    ['0', 1],
    ['0', 0],
    ['0', 0]]]],
 [['regression: scenario 5',
   [6,
    [[True, 0],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['010000', 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]]],
  ['regression: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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]]],
  ['control: scenario 3',
   [5,
    [[False, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [False, 1],
     [False, 1],
     [True, 0]]],
   [['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 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 fixtureActualExpectedOutcome
regression: clock held high[['10', 0], ['01', 0], ['10', 1], ['10', 1], ['01', 0]][['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]Failed
regression: 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
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: 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
regression: 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], ['011000', 0], ['011000', 0], ['011000', 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]]Failed
regression: 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
regression: scenario 3[['00000', 0], ['10000', 0], ['10000', 0], ['11000', 0], ['11000', 0], ['11000', 0], ['01100', 0], ['10110', 0], ['01011', 0], ['10101', 1], ['01010', 1]][['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]]Failed
regression: scenario 4[['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['1', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1], ['0', 1], ['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

SHA-256 / ad0dd306671f57fbce623afca11cf77a9ceefe0f68c42ee23c41d3245ed8e807

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 clock != 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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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]]],
  ['regression: 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]]],
  ['regression: 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 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]]]],
 [['regression: 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]]],
  ['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: 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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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 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 4',
   [2,
    [[False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 0],
     [True, 0]]],
   [['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['01', 0],
    ['01', 0],
    ['00', 1]]]],
 [['regression: scenario 3',
   [6, [[False, 1], [False, 0], [True, 0], [True, 1], [True, 0], [False, 0], [True, 0], [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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 4',
   [2,
    [[False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [True, 1],
     [True, 0],
     [True, 0],
     [True, 0]]],
   [['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0]]]],
 [['regression: scenario 3',
   [3,
    [[False, 1],
     [False, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [True, 0],
     [True, 1],
     [False, 0]]],
   [['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['010', 0],
    ['010', 0],
    ['010', 0]]],
  ['regression: 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: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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 4',
   [1,
    [[True, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [False, 1],
     [False, 1],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 1],
     [False, 0],
     [True, 0],
     [False, 1]]],
   [['1', 0],
    ['1', 0],
    ['1', 0],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['0', 1],
    ['0', 1],
    ['0', 1],
    ['0', 0],
    ['0', 0]]]],
 [['regression: scenario 5',
   [6,
    [[True, 0],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['010000', 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]]],
  ['regression: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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]]],
  ['control: scenario 3',
   [5,
    [[False, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [False, 1],
     [False, 1],
     [True, 0]]],
   [['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 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 fixtureActualExpectedOutcome
regression: clock held high[['10', 0], ['10', 0], ['10', 0], ['01', 0], ['00', 1]][['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]Failed
regression: three stage track[['100', 0], ['010', 0], ['001', 0], ['000', 1], ['100', 0], ['010', 0], ['001', 0]][['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]Failed
regression: single stage[['1', 0], ['0', 1], ['0', 0], ['1', 0], ['1', 1]][['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]Failed
regression: sensor changes on edge scan[['000', 0], ['000', 0], ['000', 0], ['100', 0], ['010', 0]][['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]Failed
regression: scenario 1[['000000', 0], ['000000', 0], ['100000', 0], ['100000', 0], ['010000', 0], ['010000', 0], ['001000', 0], ['100100', 0], ['110010', 0], ['110010', 0], ['110010', 0], ['111001', 0], ['111001', 0], ['111100', 1], ['111100', 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]]Failed
regression: scenario 2[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['01', 0], ['00', 1]][['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['10', 0], ['10', 0], ['01', 0]]Failed
regression: scenario 3[['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['00100', 0], ['00100', 0], ['00100', 0], ['00100', 0], ['00100', 0]][['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0], ['01000', 0]]Failed
regression: scenario 4[['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 1], ['0', 1], ['0', 1], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0], ['1', 0], ['0', 1], ['0', 1]][['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

SHA-256 / 5a48ffa428e556e22fb6846acd6ea5c6149a4a1e73fc302b8dc3a4675f98a53b

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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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]]],
  ['regression: 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]]],
  ['regression: 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 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]]]],
 [['regression: 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]]],
  ['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: 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: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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 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 4',
   [2,
    [[False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 0],
     [True, 0]]],
   [['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['01', 0],
    ['01', 0],
    ['00', 1]]]],
 [['regression: scenario 3',
   [6, [[False, 1], [False, 0], [True, 0], [True, 1], [True, 0], [False, 0], [True, 0], [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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',
   [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 4',
   [2,
    [[False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [True, 1],
     [True, 0],
     [True, 0],
     [True, 0]]],
   [['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['00', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0],
    ['10', 0]]]],
 [['regression: scenario 3',
   [3,
    [[False, 1],
     [False, 1],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 0],
     [True, 0],
     [True, 1],
     [False, 0]]],
   [['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['000', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['100', 0],
    ['010', 0],
    ['010', 0],
    ['010', 0]]],
  ['regression: 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: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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]]],
  ['regression: 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 4',
   [1,
    [[True, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [False, 1],
     [False, 1],
     [False, 0],
     [False, 1],
     [True, 0],
     [False, 1],
     [False, 0],
     [True, 0],
     [False, 1]]],
   [['1', 0],
    ['1', 0],
    ['1', 0],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['1', 1],
    ['0', 1],
    ['0', 1],
    ['0', 1],
    ['0', 0],
    ['0', 0]]]],
 [['regression: scenario 5',
   [6,
    [[True, 0],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 1],
     [False, 0],
     [False, 1],
     [False, 0],
     [True, 0]]],
   [['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['000000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['100000', 0],
    ['010000', 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]]],
  ['regression: 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]]],
  ['regression: clock held high',
   [2, [[True, 1], [True, 0], [True, 1], [False, 0], [True, 0]]],
   [['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]],
  ['regression: 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 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]]],
  ['control: scenario 3',
   [5,
    [[False, 0],
     [False, 0],
     [True, 0],
     [False, 0],
     [False, 0],
     [True, 0],
     [True, 0],
     [False, 0],
     [False, 1],
     [False, 1],
     [True, 0]]],
   [['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 0],
    ['00000', 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 fixtureActualExpectedOutcome
regression: clock held high[['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]][['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]Passed
regression: 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
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: 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
regression: 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
regression: 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
regression: 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
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

SHA-256 / 50c0b316e9d8606b1b24cbebd880683c73760f8ec9920dc207141e0f8512cbf0

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.585296+00:00.

Case digest / 33b042bfb2c5778627298741a6cf64c71c0ad70cc70b1da2b6d657cb1fb1b0b7