{"abstract":"Outputs appear one cycle early, behaving like a Mealy machine.","category":"Digital logic simulation","checks":7,"contract":"Input [table, start, stream]: table[state] = {'out': o, 'next': {bit: state}}; stream items are [bit, rst] with bit 0/1/'x'. Each cycle outputs the current state's output (or 'x' in the unknown state 'X'), then clocks: rst==1 -> start (synchronous), else unknown input or state 'X' -> 'X', else follow next[bit], staying put if that transition is absent. Return [outputs, final state].","contract_signature":"*args","evaluation_group":"w2-digital-logic-simulation-moore-fsm","failed_approach":"Using the pre-edge output only on reset cycles leaves normal cycles a cycle early.","family":"w2-digital-logic-simulation-moore-fsm-output-timing","id":"FA-89086","implementations":{"attempt":{"sha256":"623441b2f7fc13e9129ec5da54885da3076cdbd165beb6f8b251ccbae2b3f3b1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    table, start, stream = args\n    state = start\n    outs = []\n    for bit, rst in stream:\n        o = 'x' if state == 'X' else table[state]['out']\n        if rst == 1:\n            state = start\n        elif state == 'X' or bit == 'x':\n            state = 'X'\n        else:\n            state = table[state]['next'].get(str(bit), state)\n        outs.append(o if rst else ('x' if state == 'X' else table[state]['out']))\n    return [outs, state]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0]]], [[0, 0, 1, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0]]], [[0, 'x', 0], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [0, 0], [1, 0]]], [[1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0]]], [[0, 'x', 0, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0]]], [[0, 0, 0], 'C']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0]]], [[0, 0, 0], 'C']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 1, 1, 0], 'B'])]]\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":"a4d1c3b9eb431600958d655bcc1d887f58ce6d9a89b5a49b8eca7d174a3bf4f3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    table, start, stream = args\n    state = start\n    outs = []\n    for bit, rst in stream:\n        o = 'x' if state == 'X' else table[state]['out']\n        if rst == 1:\n            state = start\n        elif state == 'X' or bit == 'x':\n            state = 'X'\n        else:\n            state = table[state]['next'].get(str(bit), state)\n        outs.append('x' if state == 'X' else table[state]['out'])\n    return [outs, state]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0]]], [[0, 0, 1, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0]]], [[0, 'x', 0], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [0, 0], [1, 0]]], [[1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0]]], [[0, 'x', 0, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0]]], [[0, 0, 0], 'C']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0]]], [[0, 0, 0], 'C']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 1, 0], 'B'])], [('detects two ones', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [0, 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]], [[0, 0, 1, 0, 0, 0, 0, 0, 0], 'A']), ('reset while in output state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 0, 1, 0, 0, 1, 1, 1, 1], 'C']), ('missing transition holds state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0]]], [[0, 0, 1, 1, 1, 1, 1, 1], 'A']), ('unknown input poisons state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 0], ['x', 0], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 1], [1, 0]]], [[0, 0, 'x', 'x', 'x', 'x', 'x', 'x', 'x', 0], 'B']), ('reset from unknown state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'B', [['x', 0], [0, 1], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0]]], [[0, 'x', 0, 1, 1, 1, 1], 'C']), ('reset asserted in first cycle', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'A', [[1, 1], [1, 0], [1, 0], [0, 0]]], [[0, 0, 0, 1], 'A']), ('start in accepting state', [{'A': {'out': 0, 'next': {'1': 'B'}}, 'B': {'out': 0, 'next': {'0': 'A', '1': 'C'}}, 'C': {'out': 1, 'next': {'0': 'A'}}}, 'C', [[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [0, 0], [1, 0]]], [[1, 1, 1, 1, 1, 1, 0], 'B'])]]\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-moore-fsm-output-timing","generated_at":"2026-09-29T14:51:14.259945+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Cycle-based simulators must emit Moore outputs from the pre-edge state and model unknown propagation through state registers.","root_cause":"The output is sampled from the next state instead of the current state.","sha256":"5a299198e8f25e90529cfc219dea3bb2207aaccb6474b1ea5f03ac0a6bcdace8","title":"Moore output taken after the state update · 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":39.911,"exit_code":1,"observations":[{"actual":[[0,1,0,0,0],"A"],"check":"detects two ones","expected":[[0,0,1,0,0],"A"],"passed":false},{"actual":[[0,1,1,0,1],"C"],"check":"reset while in output state","expected":[[0,0,1,0,0],"C"],"passed":false},{"actual":[[0,1,1,0],"A"],"check":"missing transition holds state","expected":[[0,0,1,1],"A"],"passed":false},{"actual":[[0,"x","x","x","x",0],"B"],"check":"unknown input poisons state","expected":[[0,0,"x","x","x",0],"B"],"passed":false},{"actual":[["x","x",1],"C"],"check":"reset from unknown state","expected":[[0,"x",0],"C"],"passed":false},{"actual":[[0,0,1,0],"A"],"check":"reset asserted in first cycle","expected":[[0,0,0,1],"A"],"passed":false},{"actual":[[1,0,0],"B"],"check":"start in accepting state","expected":[[1,1,0],"B"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"detects two ones\", \"actual\": [[0, 1, 0, 0, 0], \"A\"], \"expected\": [[0, 0, 1, 0, 0], \"A\"], \"passed\": false}, {\"check\": \"reset while in output state\", \"actual\": [[0, 1, 1, 0, 1], \"C\"], \"expected\": [[0, 0, 1, 0, 0], \"C\"], \"passed\": false}, {\"check\": \"missing transition holds state\", \"actual\": [[0, 1, 1, 0], \"A\"], \"expected\": [[0, 0, 1, 1], \"A\"], \"passed\": false}, {\"check\": \"unknown input poisons state\", \"actual\": [[0, \"x\", \"x\", \"x\", \"x\", 0], \"B\"], \"expected\": [[0, 0, \"x\", \"x\", \"x\", 0], \"B\"], \"passed\": false}, {\"check\": \"reset from unknown state\", \"actual\": [[\"x\", \"x\", 1], \"C\"], \"expected\": [[0, \"x\", 0], \"C\"], \"passed\": false}, {\"check\": \"reset asserted in first cycle\", \"actual\": [[0, 0, 1, 0], \"A\"], \"expected\": [[0, 0, 0, 1], \"A\"], \"passed\": false}, {\"check\": \"start in accepting state\", \"actual\": [[1, 0, 0], \"B\"], \"expected\": [[1, 1, 0], \"B\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.39,"exit_code":1,"observations":[{"actual":[[0,1,0,0,0],"A"],"check":"detects two ones","expected":[[0,0,1,0,0],"A"],"passed":false},{"actual":[[0,1,0,0,1],"C"],"check":"reset while in output state","expected":[[0,0,1,0,0],"C"],"passed":false},{"actual":[[0,1,1,0],"A"],"check":"missing transition holds state","expected":[[0,0,1,1],"A"],"passed":false},{"actual":[[0,"x","x","x",0,0],"B"],"check":"unknown input poisons state","expected":[[0,0,"x","x","x",0],"B"],"passed":false},{"actual":[["x",0,1],"C"],"check":"reset from unknown state","expected":[[0,"x",0],"C"],"passed":false},{"actual":[[0,0,1,0],"A"],"check":"reset asserted in first cycle","expected":[[0,0,0,1],"A"],"passed":false},{"actual":[[1,0,0],"B"],"check":"start in accepting state","expected":[[1,1,0],"B"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"detects two ones\", \"actual\": [[0, 1, 0, 0, 0], \"A\"], \"expected\": [[0, 0, 1, 0, 0], \"A\"], \"passed\": false}, {\"check\": \"reset while in output state\", \"actual\": [[0, 1, 0, 0, 1], \"C\"], \"expected\": [[0, 0, 1, 0, 0], \"C\"], \"passed\": false}, {\"check\": \"missing transition holds state\", \"actual\": [[0, 1, 1, 0], \"A\"], \"expected\": [[0, 0, 1, 1], \"A\"], \"passed\": false}, {\"check\": \"unknown input poisons state\", \"actual\": [[0, \"x\", \"x\", \"x\", 0, 0], \"B\"], \"expected\": [[0, 0, \"x\", \"x\", \"x\", 0], \"B\"], \"passed\": false}, {\"check\": \"reset from unknown state\", \"actual\": [[\"x\", 0, 1], \"C\"], \"expected\": [[0, \"x\", 0], \"C\"], \"passed\": false}, {\"check\": \"reset asserted in first cycle\", \"actual\": [[0, 0, 1, 0], \"A\"], \"expected\": [[0, 0, 0, 1], \"A\"], \"passed\": false}, {\"check\": \"start in accepting state\", \"actual\": [[1, 0, 0], \"B\"], \"expected\": [[1, 1, 0], \"B\"], \"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."}}