{"abstract":"A signal that starts at 1 or 0 reports an edge at index 0.","category":"Digital logic simulation","checks":7,"contract":"Input [seq]: a string of samples over '0','1','x','z'. Levels order 0 < {x,z} < 1 (x and z are the same middle level). A change to a higher level is a posedge (0->1, 0->x, 0->z, x->1, z->1), to a lower level a negedge; x<->z is no edge. The first sample has no predecessor. Return [posedge indices, negedge indices].","evaluation_group":"w2-digital-logic-simulation-edge-classification","failed_approach":"Seeding with '0' still reports a posedge when the signal starts high.","family":"w2-digital-logic-simulation-edge-classification-first-sample-predecessor","id":"FA-89071","implementations":{"attempt":{"sha256":"967045e47fe066c4f3dc59e9ff10f9f72ad7ab7ec281b37f44cb7b4351375ae3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    seq = args[0]\n    lvl = {'0': 0, '1': 2}\n    pos, neg = [], []\n    prev = '0'\n    for i, b in enumerate(seq):\n        a, prev = prev, b\n        if a is None or a == b:\n            continue\n        la, lb = lvl.get(a, 1), lvl.get(b, 1)\n        if la < lb:\n            pos.append(i)\n        elif la > lb:\n            neg.append(i)\n    return [pos, neg]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('plain binary toggles', ['010110'], [[1, 3], [2, 5]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xzx1z'], [[3], [4]]), ('floating rising and falling', ['z1z0z'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xz0'], [[], [1, 3]]), ('starts high without a predecessor', ['110'], [[], [2]]), ('low through unknown to high', ['0x1x0'], [[1, 2], [3, 4]])], [('plain binary toggles', ['0101110'], [[1, 3], [2, 6]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxzx1z'], [[4], [5]]), ('floating rising and falling', ['z1z0zz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxz0'], [[], [1, 4]]), ('starts high without a predecessor', ['1100'], [[], [2]]), ('low through unknown to high', ['00x1x0'], [[2, 3], [4, 5]])], [('plain binary toggles', ['01011110'], [[1, 3], [2, 7]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxzx1z'], [[5], [6]]), ('floating rising and falling', ['z1z0zzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxz0'], [[], [1, 5]]), ('starts high without a predecessor', ['11000'], [[], [2]]), ('low through unknown to high', ['000x1x0'], [[3, 4], [5, 6]])], [('plain binary toggles', ['010111110'], [[1, 3], [2, 8]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxzx1z'], [[6], [7]]), ('floating rising and falling', ['z1z0zzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxz0'], [[], [1, 6]]), ('starts high without a predecessor', ['110000'], [[], [2]]), ('low through unknown to high', ['0000x1x0'], [[4, 5], [6, 7]])], [('plain binary toggles', ['0101111110'], [[1, 3], [2, 9]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxxzx1z'], [[7], [8]]), ('floating rising and falling', ['z1z0zzzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxxz0'], [[], [1, 7]]), ('starts high without a predecessor', ['1100000'], [[], [2]]), ('low through unknown to high', ['00000x1x0'], [[5, 6], [7, 8]])]]\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":"ee818cda34da2c3e7a48f791eb109f1e3fb234933a414bc1211773603b02e486","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    seq = args[0]\n    lvl = {'0': 0, '1': 2}\n    pos, neg = [], []\n    prev = 'x'\n    for i, b in enumerate(seq):\n        a, prev = prev, b\n        if a is None or a == b:\n            continue\n        la, lb = lvl.get(a, 1), lvl.get(b, 1)\n        if la < lb:\n            pos.append(i)\n        elif la > lb:\n            neg.append(i)\n    return [pos, neg]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('plain binary toggles', ['010110'], [[1, 3], [2, 5]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xzx1z'], [[3], [4]]), ('floating rising and falling', ['z1z0z'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xz0'], [[], [1, 3]]), ('starts high without a predecessor', ['110'], [[], [2]]), ('low through unknown to high', ['0x1x0'], [[1, 2], [3, 4]])], [('plain binary toggles', ['0101110'], [[1, 3], [2, 6]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxzx1z'], [[4], [5]]), ('floating rising and falling', ['z1z0zz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxz0'], [[], [1, 4]]), ('starts high without a predecessor', ['1100'], [[], [2]]), ('low through unknown to high', ['00x1x0'], [[2, 3], [4, 5]])], [('plain binary toggles', ['01011110'], [[1, 3], [2, 7]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxzx1z'], [[5], [6]]), ('floating rising and falling', ['z1z0zzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxz0'], [[], [1, 5]]), ('starts high without a predecessor', ['11000'], [[], [2]]), ('low through unknown to high', ['000x1x0'], [[3, 4], [5, 6]])], [('plain binary toggles', ['010111110'], [[1, 3], [2, 8]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxzx1z'], [[6], [7]]), ('floating rising and falling', ['z1z0zzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxz0'], [[], [1, 6]]), ('starts high without a predecessor', ['110000'], [[], [2]]), ('low through unknown to high', ['0000x1x0'], [[4, 5], [6, 7]])], [('plain binary toggles', ['0101111110'], [[1, 3], [2, 9]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxxzx1z'], [[7], [8]]), ('floating rising and falling', ['z1z0zzzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxxz0'], [[], [1, 7]]), ('starts high without a predecessor', ['1100000'], [[], [2]]), ('low through unknown to high', ['00000x1x0'], [[5, 6], [7, 8]])]]\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"},"fixed":{"sha256":"346ada859aea2c3bdca6de35f6c1b39dc83946394b269fa1c49ee6e98fc2839a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(*args):\n    seq = args[0]\n    lvl = {'0': 0, '1': 2}\n    pos, neg = [], []\n    prev = None\n    for i, b in enumerate(seq):\n        a, prev = prev, b\n        if a is None or a == b:\n            continue\n        la, lb = lvl.get(a, 1), lvl.get(b, 1)\n        if la < lb:\n            pos.append(i)\n        elif la > lb:\n            neg.append(i)\n    return [pos, neg]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('plain binary toggles', ['010110'], [[1, 3], [2, 5]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xzx1z'], [[3], [4]]), ('floating rising and falling', ['z1z0z'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xz0'], [[], [1, 3]]), ('starts high without a predecessor', ['110'], [[], [2]]), ('low through unknown to high', ['0x1x0'], [[1, 2], [3, 4]])], [('plain binary toggles', ['0101110'], [[1, 3], [2, 6]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxzx1z'], [[4], [5]]), ('floating rising and falling', ['z1z0zz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxz0'], [[], [1, 4]]), ('starts high without a predecessor', ['1100'], [[], [2]]), ('low through unknown to high', ['00x1x0'], [[2, 3], [4, 5]])], [('plain binary toggles', ['01011110'], [[1, 3], [2, 7]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxzx1z'], [[5], [6]]), ('floating rising and falling', ['z1z0zzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxz0'], [[], [1, 5]]), ('starts high without a predecessor', ['11000'], [[], [2]]), ('low through unknown to high', ['000x1x0'], [[3, 4], [5, 6]])], [('plain binary toggles', ['010111110'], [[1, 3], [2, 8]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxzx1z'], [[6], [7]]), ('floating rising and falling', ['z1z0zzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxz0'], [[], [1, 6]]), ('starts high without a predecessor', ['110000'], [[], [2]]), ('low through unknown to high', ['0000x1x0'], [[4, 5], [6, 7]])], [('plain binary toggles', ['0101111110'], [[1, 3], [2, 9]]), ('edges through unknown and floating', ['0x1z0'], [[1, 2], [3, 4]]), ('unknown to floating is no edge', ['xxxxxzx1z'], [[7], [8]]), ('floating rising and falling', ['z1z0zzzzz'], [[1, 4], [2, 3]]), ('high to floating then low', ['1xxxxxz0'], [[], [1, 7]]), ('starts high without a predecessor', ['1100000'], [[], [2]]), ('low through unknown to high', ['00000x1x0'], [[5, 6], [7, 8]])]]\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-edge-classification-first-sample-predecessor","generated_at":"2026-09-29T14:51:14.043794+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Event controls on clocks and resets fire on unknown transitions; an edge classifier that only knows 0->1 misses or invents triggers.","repair":"Start without a predecessor so the first sample is never an edge.","root_cause":"The edge tracker seeds the previous sample with 'x' instead of no predecessor.","sha256":"d7d8a18f0d5963d8619b6381387faa5f551f3e1ad5594ce176224834edde08c9","title":"First sample treated as a transition from unknown · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.974,"exit_code":1,"observations":[{"actual":[[1,3],[2,5]],"check":"plain binary toggles","expected":[[1,3],[2,5]],"passed":true},{"actual":[[1,2],[3,4]],"check":"edges through unknown and floating","expected":[[1,2],[3,4]],"passed":true},{"actual":[[0,3],[4]],"check":"unknown to floating is no edge","expected":[[3],[4]],"passed":false},{"actual":[[0,1,4],[2,3]],"check":"floating rising and falling","expected":[[1,4],[2,3]],"passed":false},{"actual":[[0],[1,3]],"check":"high to floating then low","expected":[[],[1,3]],"passed":false},{"actual":[[0],[2]],"check":"starts high without a predecessor","expected":[[],[2]],"passed":false},{"actual":[[1,2],[3,4]],"check":"low through unknown to high","expected":[[1,2],[3,4]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain binary toggles\", \"actual\": [[1, 3], [2, 5]], \"expected\": [[1, 3], [2, 5]], \"passed\": true}, {\"check\": \"edges through unknown and floating\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}, {\"check\": \"unknown to floating is no edge\", \"actual\": [[0, 3], [4]], \"expected\": [[3], [4]], \"passed\": false}, {\"check\": \"floating rising and falling\", \"actual\": [[0, 1, 4], [2, 3]], \"expected\": [[1, 4], [2, 3]], \"passed\": false}, {\"check\": \"high to floating then low\", \"actual\": [[0], [1, 3]], \"expected\": [[], [1, 3]], \"passed\": false}, {\"check\": \"starts high without a predecessor\", \"actual\": [[0], [2]], \"expected\": [[], [2]], \"passed\": false}, {\"check\": \"low through unknown to high\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.271,"exit_code":1,"observations":[{"actual":[[1,3],[0,2,5]],"check":"plain binary toggles","expected":[[1,3],[2,5]],"passed":false},{"actual":[[1,2],[0,3,4]],"check":"edges through unknown and floating","expected":[[1,2],[3,4]],"passed":false},{"actual":[[3],[4]],"check":"unknown to floating is no edge","expected":[[3],[4]],"passed":true},{"actual":[[1,4],[2,3]],"check":"floating rising and falling","expected":[[1,4],[2,3]],"passed":true},{"actual":[[0],[1,3]],"check":"high to floating then low","expected":[[],[1,3]],"passed":false},{"actual":[[0],[2]],"check":"starts high without a predecessor","expected":[[],[2]],"passed":false},{"actual":[[1,2],[0,3,4]],"check":"low through unknown to high","expected":[[1,2],[3,4]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain binary toggles\", \"actual\": [[1, 3], [0, 2, 5]], \"expected\": [[1, 3], [2, 5]], \"passed\": false}, {\"check\": \"edges through unknown and floating\", \"actual\": [[1, 2], [0, 3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": false}, {\"check\": \"unknown to floating is no edge\", \"actual\": [[3], [4]], \"expected\": [[3], [4]], \"passed\": true}, {\"check\": \"floating rising and falling\", \"actual\": [[1, 4], [2, 3]], \"expected\": [[1, 4], [2, 3]], \"passed\": true}, {\"check\": \"high to floating then low\", \"actual\": [[0], [1, 3]], \"expected\": [[], [1, 3]], \"passed\": false}, {\"check\": \"starts high without a predecessor\", \"actual\": [[0], [2]], \"expected\": [[], [2]], \"passed\": false}, {\"check\": \"low through unknown to high\", \"actual\": [[1, 2], [0, 3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.648,"exit_code":0,"observations":[{"actual":[[1,3],[2,5]],"check":"plain binary toggles","expected":[[1,3],[2,5]],"passed":true},{"actual":[[1,2],[3,4]],"check":"edges through unknown and floating","expected":[[1,2],[3,4]],"passed":true},{"actual":[[3],[4]],"check":"unknown to floating is no edge","expected":[[3],[4]],"passed":true},{"actual":[[1,4],[2,3]],"check":"floating rising and falling","expected":[[1,4],[2,3]],"passed":true},{"actual":[[],[1,3]],"check":"high to floating then low","expected":[[],[1,3]],"passed":true},{"actual":[[],[2]],"check":"starts high without a predecessor","expected":[[],[2]],"passed":true},{"actual":[[1,2],[3,4]],"check":"low through unknown to high","expected":[[1,2],[3,4]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain binary toggles\", \"actual\": [[1, 3], [2, 5]], \"expected\": [[1, 3], [2, 5]], \"passed\": true}, {\"check\": \"edges through unknown and floating\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}, {\"check\": \"unknown to floating is no edge\", \"actual\": [[3], [4]], \"expected\": [[3], [4]], \"passed\": true}, {\"check\": \"floating rising and falling\", \"actual\": [[1, 4], [2, 3]], \"expected\": [[1, 4], [2, 3]], \"passed\": true}, {\"check\": \"high to floating then low\", \"actual\": [[], [1, 3]], \"expected\": [[], [1, 3]], \"passed\": true}, {\"check\": \"starts high without a predecessor\", \"actual\": [[], [2]], \"expected\": [[], [2]], \"passed\": true}, {\"check\": \"low through unknown to high\", \"actual\": [[1, 2], [3, 4]], \"expected\": [[1, 2], [3, 4]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}