FA-89281 / Digital logic simulation / Open access
Shift updates flops in place from the scan input · case 01
One shift fills the entire chain with the scan-in bit.
ROOT CAUSE
Each flop is overwritten before its successor reads the old value.
THE FAILURE
Each flop is overwritten before its successor reads the old value.
Unsuccessful approach: Copying from front to back still propagates the first flop through the whole chain.
Case contract
Input [chain, logic, state, ops]: chain lists flops from scan-in to scan-out. 'shift' with bit b: scan-out observes the last flop before the edge, then every flop takes its predecessor's old value and the first takes b. 'capture': every flop loads its functional next state logic[f] = [op, inputs] (and/xor/not) computed from the old state of all flops simultaneously. Return [scan-out bits, final chain values].
Why this case matters
Scan-based test simulation must shift and capture as simultaneous register updates.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(*args):
chain, logic, state, ops = args
state = dict(state)
sout = []
for op, bit in ops:
if op == 'shift':
sout.append(state[chain[-1]])
prev = bit
for f in chain:
state[f] = prev
prev = state[f]
else:
nxt = {}
for f in chain:
kind, ins = logic[f]
bits = [state[i] for i in ins]
nxt[f] = int(all(bits)) if kind == 'and' else (sum(bits) % 2 if kind == 'xor' else 1 - bits[0])
state.update(nxt)
return [sout, [state[f] for f in chain]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1], ['shift', 0]]], [[1, 1], [0, 1, 1, 0]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1]]], [[0], [1, 1, 0, 0]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1]]], [[1, 0], [1, 1, 0, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['shift', 1], ['shift', 0], ['shift', 1]]], [[0, 1, 0], [1, 0, 1, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[1, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1]]], [[1, 0], [1, 1, 1, 0]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1], [1, 1, 1, 0]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1]]], [[1], [1, 1, 0, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1]]], [[0, 0, 0], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0], [1, 1, 1, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['shift', 1], ['shift', 0]]], [[0, 1], [0, 1, 1, 0]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[1, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 0, 1], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0, 1], [1, 1, 1, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1], ['shift', 0], ['shift', 1]]], [[1, 1, 0], [1, 0, 1, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[0, 0, 0, 1, 1], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0, 1, 1], [1, 1, 1, 1]])]]
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 |
|---|---|---|---|
| shift in a pattern | [[1, 1], [0, 0, 0, 0]] | [[1, 1], [0, 1, 1, 0]] | Failed |
| capture then unload | [[0, 0, 0, 0], [0, 0, 0, 0]] | [[0, 0, 1, 1], [0, 0, 0, 0]] | Failed |
| load capture unload | [[0, 1, 0, 0], [0, 0, 0, 0]] | [[0, 0, 0, 0], [0, 0, 1, 0]] | Failed |
| double capture | [[0], [1, 1, 1, 1]] | [[0], [1, 1, 0, 0]] | Failed |
| short chain | [[0, 0], [1, 1]] | [[0, 1], [1, 0]] | Failed |
| flush ones | [[1, 1], [1, 1, 1, 1]] | [[1, 0], [1, 1, 0, 1]] | Failed |
SHA-256 / 1b84af50fc53e2d4bf48e79822210900d693f301f0a27eb586277ca52198ecd9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(*args):
chain, logic, state, ops = args
state = dict(state)
sout = []
for op, bit in ops:
if op == 'shift':
sout.append(state[chain[-1]])
for i in range(1, len(chain)):
state[chain[i]] = state[chain[i - 1]]
state[chain[0]] = bit
else:
nxt = {}
for f in chain:
kind, ins = logic[f]
bits = [state[i] for i in ins]
nxt[f] = int(all(bits)) if kind == 'and' else (sum(bits) % 2 if kind == 'xor' else 1 - bits[0])
state.update(nxt)
return [sout, [state[f] for f in chain]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1], ['shift', 0]]], [[1, 1], [0, 1, 1, 0]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1]]], [[0], [1, 1, 0, 0]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1]]], [[1, 0], [1, 1, 0, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['shift', 1], ['shift', 0], ['shift', 1]]], [[0, 1, 0], [1, 0, 1, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[1, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1]]], [[1, 0], [1, 1, 1, 0]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1], [1, 1, 1, 0]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1]]], [[1], [1, 1, 0, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1]]], [[0, 0, 0], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0], [1, 1, 1, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['shift', 1], ['shift', 0]]], [[0, 1], [0, 1, 1, 0]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[1, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 0}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 0, 1], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0, 1], [1, 1, 1, 1]])], [('shift in a pattern', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['shift', 1], ['shift', 0], ['shift', 1]]], [[1, 1, 0], [1, 0, 1, 1]]), ('capture then unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['shift', 0], ['shift', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 1, 1], [0, 0, 0, 0]]), ('load capture unload', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 0, 'f2': 0, 'f3': 0}, [['shift', 1], ['shift', 1], ['capture', 0], ['shift', 0], ['shift', 0]]], [[0, 0, 0, 0], [0, 0, 1, 0]]), ('double capture', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 1, 'f1': 0, 'f2': 1, 'f3': 1}, [['capture', 0], ['capture', 0], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[0, 0, 0, 1, 1], [1, 1, 1, 1]]), ('short chain', [['f0', 'f2'], {'f0': ['not', ['f2']], 'f2': ['xor', ['f0', 'f2']]}, {'f0': 1, 'f2': 0}, [['shift', 0], ['capture', 0], ['shift', 1]]], [[0, 1], [1, 0]]), ('flush ones', [['f0', 'f1', 'f2', 'f3'], {'f0': ['xor', ['f1', 'f2']], 'f1': ['and', ['f0', 'f2']], 'f2': ['not', ['f0']], 'f3': ['xor', ['f2', 'f3']]}, {'f0': 0, 'f1': 1, 'f2': 0, 'f3': 1}, [['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1], ['shift', 1]]], [[1, 0, 1, 0, 1, 1], [1, 1, 1, 1]])]]
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 |
|---|---|---|---|
| shift in a pattern | [[1, 1], [0, 1, 1, 1]] | [[1, 1], [0, 1, 1, 0]] | Failed |
| capture then unload | [[0, 1, 0, 0], [0, 0, 0, 0]] | [[0, 0, 1, 1], [0, 0, 0, 0]] | Failed |
| load capture unload | [[0, 0, 0, 0], [0, 0, 0, 0]] | [[0, 0, 0, 0], [0, 0, 1, 0]] | Failed |
| double capture | [[0], [1, 1, 1, 1]] | [[0], [1, 1, 0, 0]] | Failed |
| short chain | [[0, 1], [1, 0]] | [[0, 1], [1, 0]] | Passed |
| flush ones | [[1, 0], [1, 1, 1, 1]] | [[1, 0], [1, 1, 0, 1]] | Failed |
SHA-256 / 124caed0ab97719edfe444f0e2973a1458ba8245faaf1f18b5bffdc525429dde
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 6 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 simulator rule set; the contract is stipulated and is not a claim of conformance to any HDL standard or commercial simulator. 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:16.015525+00:00.
Case digest / 424cbdee7ce2831476e10a1682f8ba51cf982753c50a1dbb12c3f2326f9714f8