{"abstract":"The unloaded bit stream is missing the first bit and one position late.","category":"Digital logic simulation","checks":6,"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].","contract_signature":"*args","evaluation_group":"w2-digital-logic-simulation-scan-chain","failed_approach":"Observing the first flop reads the wrong end of the chain.","family":"w2-digital-logic-simulation-scan-chain-scan-out-sampling-time","id":"FA-89276","implementations":{"attempt":{"sha256":"ff5f94a6f79e84f1df97ede1d6b6201e3ef0bf2f51be255aeead98318a5d0035","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    chain, logic, state, ops = args\n    state = dict(state)\n    sout = []\n    for op, bit in ops:\n        if op == 'shift':\n            sout.append(state[chain[0]])\n            vals = [bit] + [state[f] for f in chain[:-1]]\n            for f, v in zip(chain, vals):\n                state[f] = v\n        else:\n            nxt = {}\n            for f in chain:\n                kind, ins = logic[f]\n                bits = [state[i] for i in ins]\n                nxt[f] = int(all(bits)) if kind == 'and' else (sum(bits) % 2 if kind == 'xor' else 1 - bits[0])\n            state.update(nxt)\n    return [sout, [state[f] for f in chain]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('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]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"39868458646b5b5ce8310eb765c422dff8ee3d1ccd4c7ccd64240dc9777cf70b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    chain, logic, state, ops = args\n    state = dict(state)\n    sout = []\n    for op, bit in ops:\n        if op == 'shift':\n            vals = [bit] + [state[f] for f in chain[:-1]]\n            for f, v in zip(chain, vals):\n                state[f] = v\n            sout.append(state[chain[-1]])\n        else:\n            nxt = {}\n            for f in chain:\n                kind, ins = logic[f]\n                bits = [state[i] for i in ins]\n                nxt[f] = int(all(bits)) if kind == 'and' else (sum(bits) % 2 if kind == 'xor' else 1 - bits[0])\n            state.update(nxt)\n    return [sout, [state[f] for f in chain]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('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]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-digital-logic-simulation-scan-chain-scan-out-sampling-time","generated_at":"2026-09-29T14:51:16.015525+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Scan-based test simulation must shift and capture as simultaneous register updates.","root_cause":"Scan-out is read after the shift updated the chain.","sha256":"68ca8e5d24fb4601e4ceccc92fd83d5ea5c159927c32841ff3566a6fab9b6ba4","title":"Scan-out observed after the shift edge · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.756,"exit_code":1,"observations":[{"actual":[[1,1],[0,1,1,0]],"check":"shift in a pattern","expected":[[1,1],[0,1,1,0]],"passed":true},{"actual":[[1,0,0,0],[0,0,0,0]],"check":"capture then unload","expected":[[0,0,1,1],[0,0,0,0]],"passed":false},{"actual":[[0,1,1,0],[0,0,1,0]],"check":"load capture unload","expected":[[0,0,0,0],[0,0,1,0]],"passed":false},{"actual":[[1],[1,1,0,0]],"check":"double capture","expected":[[0],[1,1,0,0]],"passed":false},{"actual":[[1,0],[1,0]],"check":"short chain","expected":[[0,1],[1,0]],"passed":false},{"actual":[[0,1],[1,1,0,1]],"check":"flush ones","expected":[[1,0],[1,1,0,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"shift in a pattern\", \"actual\": [[1, 1], [0, 1, 1, 0]], \"expected\": [[1, 1], [0, 1, 1, 0]], \"passed\": true}, {\"check\": \"capture then unload\", \"actual\": [[1, 0, 0, 0], [0, 0, 0, 0]], \"expected\": [[0, 0, 1, 1], [0, 0, 0, 0]], \"passed\": false}, {\"check\": \"load capture unload\", \"actual\": [[0, 1, 1, 0], [0, 0, 1, 0]], \"expected\": [[0, 0, 0, 0], [0, 0, 1, 0]], \"passed\": false}, {\"check\": \"double capture\", \"actual\": [[1], [1, 1, 0, 0]], \"expected\": [[0], [1, 1, 0, 0]], \"passed\": false}, {\"check\": \"short chain\", \"actual\": [[1, 0], [1, 0]], \"expected\": [[0, 1], [1, 0]], \"passed\": false}, {\"check\": \"flush ones\", \"actual\": [[0, 1], [1, 1, 0, 1]], \"expected\": [[1, 0], [1, 1, 0, 1]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.555,"exit_code":1,"observations":[{"actual":[[1,0],[0,1,1,0]],"check":"shift in a pattern","expected":[[1,1],[0,1,1,0]],"passed":false},{"actual":[[0,1,1,0],[0,0,0,0]],"check":"capture then unload","expected":[[0,0,1,1],[0,0,0,0]],"passed":false},{"actual":[[0,0,0,0],[0,0,1,0]],"check":"load capture unload","expected":[[0,0,0,0],[0,0,1,0]],"passed":true},{"actual":[[0],[1,1,0,0]],"check":"double capture","expected":[[0],[1,1,0,0]],"passed":true},{"actual":[[1,0],[1,0]],"check":"short chain","expected":[[0,1],[1,0]],"passed":false},{"actual":[[0,1],[1,1,0,1]],"check":"flush ones","expected":[[1,0],[1,1,0,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"shift in a pattern\", \"actual\": [[1, 0], [0, 1, 1, 0]], \"expected\": [[1, 1], [0, 1, 1, 0]], \"passed\": false}, {\"check\": \"capture then unload\", \"actual\": [[0, 1, 1, 0], [0, 0, 0, 0]], \"expected\": [[0, 0, 1, 1], [0, 0, 0, 0]], \"passed\": false}, {\"check\": \"load capture unload\", \"actual\": [[0, 0, 0, 0], [0, 0, 1, 0]], \"expected\": [[0, 0, 0, 0], [0, 0, 1, 0]], \"passed\": true}, {\"check\": \"double capture\", \"actual\": [[0], [1, 1, 0, 0]], \"expected\": [[0], [1, 1, 0, 0]], \"passed\": true}, {\"check\": \"short chain\", \"actual\": [[1, 0], [1, 0]], \"expected\": [[0, 1], [1, 0]], \"passed\": false}, {\"check\": \"flush ones\", \"actual\": [[0, 1], [1, 1, 0, 1]], \"expected\": [[1, 0], [1, 1, 0, 1]], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}