{"abstract":"The gated clock follows enable changes during the high phase.","category":"Digital logic simulation","checks":6,"contract":"Input [samples] of [clk, en, te]. The enable latch starts at 0 and is transparent while clk is 0 (q = en or te), holding while clk is 1. The gated clock is clk and q. Return [gated clock per sample, number of gated rising edges counting from an initial low].","contract_signature":"samples","evaluation_group":"w2-digital-logic-simulation-clock-gate","failed_approach":"Also opening it when enable falls reintroduces glitches.","family":"w2-digital-logic-simulation-clock-gate-latch-transparency-phase","id":"FA-89296","implementations":{"attempt":{"sha256":"41abeb603a258575048abe24c7c5b25a808d536bcf754a32be6431cdbb686c3d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(samples):\n    q = 0\n    g = []\n    for clk, en, te in samples:\n        if clk == 0 or en == 0:\n            q = int(en or te)\n        g.append(int(clk == 1 and q == 1))\n    edges = sum(1 for a, b in zip([0] + g, g) if a == 0 and b == 1)\n    return [g, edges]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1], 2]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1], 2])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1], 3]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 1], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1], 3])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1], 4]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1], 4])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 5]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 1], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 5])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 6]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 6])]]\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":"bc12afa7a92c47e2df9ea22f0bb97c87e93fc1066e8175ead119c19d11399cb4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(samples):\n    q = 0\n    g = []\n    for clk, en, te in samples:\n        if clk == 1:\n            q = int(en or te)\n        g.append(int(clk == 1 and q == 1))\n    edges = sum(1 for a, b in zip([0] + g, g) if a == 0 and b == 1)\n    return [g, edges]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1], 2]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1], 2])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1], 3]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 1], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1], 3])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1], 4]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1], 4])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 5]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 1], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 5])], [('enable drops while clock high', [[[0, 1, 0], [1, 1, 0], [1, 0, 0], [0, 0, 0], [1, 0, 0]]], [[0, 1, 1, 0, 0], 1]), ('enable rises while clock high', [[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 6]), ('test enable forces clock', [[[0, 0, 1], [1, 0, 1], [0, 0, 0], [1, 0, 0]]], [[0, 1, 0, 0], 1]), ('starts with clock high', [[[1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 0, 0], [1, 0, 0]]], [[0, 0, 1, 0, 0], 1]), ('test enable drops mid pulse', [[[0, 0, 1], [1, 0, 1], [1, 0, 0], [0, 0, 0]]], [[0, 1, 1, 0], 1]), ('steady enable', [[[0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0], [1, 1, 0]]], [[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1], 6])]]\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-clock-gate-latch-transparency-phase","generated_at":"2026-09-29T14:51:16.202109+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Integrated clock gating cells rely on a low-transparent latch to avoid glitches; simulation models that skip the latch show clock pulses that silicon never produces.","root_cause":"The latch opens on the wrong clock phase.","sha256":"8a8df28719ceaed45dbcb4d79544b32e3a7a51e4bb37df62f327e55543136d05","title":"Enable latch transparent during clock high · 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.356,"exit_code":1,"observations":[{"actual":[[0,1,0,0,0],1],"check":"enable drops while clock high","expected":[[0,1,1,0,0],1],"passed":false},{"actual":[[0,0,0,0,1,0,1],2],"check":"enable rises while clock high","expected":[[0,0,0,0,1,0,1],2],"passed":true},{"actual":[[0,1,0,0],1],"check":"test enable forces clock","expected":[[0,1,0,0],1],"passed":true},{"actual":[[0,0,1,0,0],1],"check":"starts with clock high","expected":[[0,0,1,0,0],1],"passed":true},{"actual":[[0,1,0,0],1],"check":"test enable drops mid pulse","expected":[[0,1,1,0],1],"passed":false},{"actual":[[0,1,0,1],2],"check":"steady enable","expected":[[0,1,0,1],2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"enable drops while clock high\", \"actual\": [[0, 1, 0, 0, 0], 1], \"expected\": [[0, 1, 1, 0, 0], 1], \"passed\": false}, {\"check\": \"enable rises while clock high\", \"actual\": [[0, 0, 0, 0, 1, 0, 1], 2], \"expected\": [[0, 0, 0, 0, 1, 0, 1], 2], \"passed\": true}, {\"check\": \"test enable forces clock\", \"actual\": [[0, 1, 0, 0], 1], \"expected\": [[0, 1, 0, 0], 1], \"passed\": true}, {\"check\": \"starts with clock high\", \"actual\": [[0, 0, 1, 0, 0], 1], \"expected\": [[0, 0, 1, 0, 0], 1], \"passed\": true}, {\"check\": \"test enable drops mid pulse\", \"actual\": [[0, 1, 0, 0], 1], \"expected\": [[0, 1, 1, 0], 1], \"passed\": false}, {\"check\": \"steady enable\", \"actual\": [[0, 1, 0, 1], 2], \"expected\": [[0, 1, 0, 1], 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.043,"exit_code":1,"observations":[{"actual":[[0,1,0,0,0],1],"check":"enable drops while clock high","expected":[[0,1,1,0,0],1],"passed":false},{"actual":[[0,0,1,0,1,0,1],3],"check":"enable rises while clock high","expected":[[0,0,0,0,1,0,1],2],"passed":false},{"actual":[[0,1,0,0],1],"check":"test enable forces clock","expected":[[0,1,0,0],1],"passed":true},{"actual":[[1,0,1,0,0],2],"check":"starts with clock high","expected":[[0,0,1,0,0],1],"passed":false},{"actual":[[0,1,0,0],1],"check":"test enable drops mid pulse","expected":[[0,1,1,0],1],"passed":false},{"actual":[[0,1,0,1],2],"check":"steady enable","expected":[[0,1,0,1],2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"enable drops while clock high\", \"actual\": [[0, 1, 0, 0, 0], 1], \"expected\": [[0, 1, 1, 0, 0], 1], \"passed\": false}, {\"check\": \"enable rises while clock high\", \"actual\": [[0, 0, 1, 0, 1, 0, 1], 3], \"expected\": [[0, 0, 0, 0, 1, 0, 1], 2], \"passed\": false}, {\"check\": \"test enable forces clock\", \"actual\": [[0, 1, 0, 0], 1], \"expected\": [[0, 1, 0, 0], 1], \"passed\": true}, {\"check\": \"starts with clock high\", \"actual\": [[1, 0, 1, 0, 0], 2], \"expected\": [[0, 0, 1, 0, 0], 1], \"passed\": false}, {\"check\": \"test enable drops mid pulse\", \"actual\": [[0, 1, 0, 0], 1], \"expected\": [[0, 1, 1, 0], 1], \"passed\": false}, {\"check\": \"steady enable\", \"actual\": [[0, 1, 0, 1], 2], \"expected\": [[0, 1, 0, 1], 2], \"passed\": true}], \"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."}}