FAILURE MAP
← Case archive

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

Shift register loads the sensor value from the previous scan · case 01

A part that arrives on the same scan as the encoder edge is not tracked.

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

ROOT CAUSE

The load bit uses a sensor value latched on the prior scan.

THE FAILURE

The load bit uses a sensor value latched on the prior scan.

Unsuccessful approach: ORing the current and previous sensor samples tracks phantom parts.

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
    last_sensor = 0
    out = []
    for clock, sensor in pulses:
        clock = bool(clock)
        if clock and not prev:
            unload = bits[length - 1]
            bits = [1 if last_sensor else 0] + bits[:length - 1]
        prev = clock
        last_sensor = sensor
        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: 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: 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: 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',
   [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]]],
  ['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: 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 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: 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: 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 6',
   [6,
    [[False, 1],
     [True, 0],
     [False, 0],
     [True, 0],
     [True, 0],
     [False, 1],
     [True, 0],
     [True, 0],
     [False, 1],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 1]]],
   [['000000', 0],
    ['000000', 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]]],
  ['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]]],
  ['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]]],
  ['control: 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: 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 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: 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 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: 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: scenario 9',
   [2, [[False, 1], [True, 0], [False, 1], [True, 0], [True, 1], [False, 0], [True, 0], [False, 1]]],
   [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 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]]],
  ['regression: 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: three stage track[['000', 0], ['000', 0], ['000', 0], ['000', 0], ['000', 0], ['000', 0], ['000', 0]][['100', 0], ['100', 0], ['010', 0], ['010', 0], ['101', 0], ['101', 0], ['010', 1]]Failed
regression: sensor changes on edge scan[['000', 0], ['100', 0], ['100', 0], ['010', 0], ['010', 0]][['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]Failed
regression: single stage[['0', 0], ['0', 0], ['0', 0], ['0', 0], ['1', 0]][['1', 0], ['1', 0], ['0', 1], ['0', 1], ['1', 0]]Failed
regression: clock held high[['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0]][['10', 0], ['10', 0], ['10', 0], ['10', 0], ['01', 0]]Failed
regression: scenario 1[['000000', 0], ['000000', 0], ['000000', 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]][['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
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
regression: scenario 3[['00000', 0], ['00000', 0], ['00000', 0], ['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['10000', 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], ['1', 0], ['1', 0], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 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 / ac7063f9eccbb8b9a99b0649b513b90f6945126392f74fb0d6fb3fa2c68a5ba4

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
    last_sensor = 0
    out = []
    for clock, sensor in pulses:
        clock = bool(clock)
        if clock and not prev:
            unload = bits[length - 1]
            bits = [1 if (sensor or last_sensor) else 0] + bits[:length - 1]
        prev = clock
        last_sensor = sensor
        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: 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: 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: 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',
   [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]]],
  ['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: 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 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: 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: 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 6',
   [6,
    [[False, 1],
     [True, 0],
     [False, 0],
     [True, 0],
     [True, 0],
     [False, 1],
     [True, 0],
     [True, 0],
     [False, 1],
     [False, 0],
     [True, 1],
     [True, 1],
     [True, 0],
     [False, 1]]],
   [['000000', 0],
    ['000000', 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]]],
  ['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]]],
  ['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]]],
  ['control: 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: 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 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: 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 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: 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: scenario 9',
   [2, [[False, 1], [True, 0], [False, 1], [True, 0], [True, 1], [False, 0], [True, 0], [False, 1]]],
   [['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 0], ['00', 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]]],
  ['regression: 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: 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: sensor changes on edge scan[['000', 0], ['100', 0], ['100', 0], ['110', 0], ['110', 0]][['000', 0], ['000', 0], ['000', 0], ['100', 0], ['100', 0]]Failed
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: 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: 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
regression: scenario 3[['00000', 0], ['00000', 0], ['00000', 0], ['10000', 0], ['10000', 0], ['10000', 0], ['11000', 0], ['11000', 0], ['11000', 0], ['11000', 0], ['11000', 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], ['1', 0], ['1', 0], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 1], ['1', 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 / a1c7befb2cb906c51fcae54b13c085efd182d620bd32aa8fdb0d102676cccb41

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

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

Case digest / de42543defc33e8ac542bdad53bf9b170916190d3609bbc60678712d42e3d974