FAILURE MAP
← Case archive

FA-89206 / Digital logic simulation / Open access

Transitions through unknown counted as full toggles · case 01

Energy is overestimated for nets that pass through x.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Transitions to or from x fall through to the full 0<->1 cost.

THE FAILURE

Transitions to or from x fall through to the full 0<->1 cost.

Unsuccessful approach: Handling only transitions out of x still overcharges transitions into x.

Case contract

Input [init, waves, cap]: waves[net] is a list of cycles, each a list of sub-cycle values ('0','1','x'). A 0<->1 change costs 2 half-toggles, a change to or from x costs 1, no change 0. Total energy sums half-toggles times cap over every event, comparing each event with the previous event on that net (across cycle boundaries). Functional energy compares only the last value of each non-empty cycle with the previous such value. Nets without a cap entry are unloaded (cap 0). Return [functional, total].

Why this case matters

Power estimation from simulation activity separates functional toggles from glitch toggles; mis-counting either skews dynamic power reports.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(*args):
    init, waves, cap = args
    def ht(a, b):
        if a == b: return 0
        return 2
    func = tot = 0
    for net in sorted(waves):
        c = cap.get(net, 0)
        ref = fref = init[net]
        for cyc in waves[net]:
            for v in cyc:
                tot += ht(ref, v) * c
                ref = v
            if cyc:
                func += ht(fref, cyc[-1]) * c
                fref = cyc[-1]
    return [func, tot]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0']]}, {'h': 1}], [2, 6]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 1}], [3, 5])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [6, 10]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 2}], [6, 10])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [10, 14]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 3}], [9, 15])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [14, 18]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 4}], [12, 20])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [18, 22]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 5}], [15, 25])]]
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 fixtureActualExpectedOutcome
full toggles and unknown transitions[24, 24][15, 15]Failed
glitch inside a cycle[4, 20][4, 20]Passed
cross-cycle glitch reference[2, 6][2, 6]Passed
unloaded net[20, 20][20, 20]Passed
empty cycles keep reference[16, 32][16, 32]Passed
from unknown initial value[4, 8][3, 5]Failed

SHA-256 / 2ce53a87cd451a4721dfac0adedac1201a049e8638560040efc9de7095ba4a68

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(*args):
    init, waves, cap = args
    def ht(a, b):
        if a == b: return 0
        if a == 'x': return 1
        return 2
    func = tot = 0
    for net in sorted(waves):
        c = cap.get(net, 0)
        ref = fref = init[net]
        for cyc in waves[net]:
            for v in cyc:
                tot += ht(ref, v) * c
                ref = v
            if cyc:
                func += ht(fref, cyc[-1]) * c
                fref = cyc[-1]
    return [func, tot]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0']]}, {'h': 1}], [2, 6]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 1}], [3, 5])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [6, 10]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 2}], [6, 10])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [10, 14]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 3}], [9, 15])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [14, 18]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 4}], [12, 20])], [('full toggles and unknown transitions', [{'a': '0'}, {'a': [['1'], ['x'], ['0'], ['x']]}, {'a': 3}], [15, 15]), ('glitch inside a cycle', [{'g': '0'}, {'g': [['1', '0'], ['1', '0', '1'], ['1'], ['1'], ['1'], ['1'], ['1']]}, {'g': 2}], [4, 20]), ('cross-cycle glitch reference', [{'h': '1'}, {'h': [['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0'], ['0', '1'], ['0']]}, {'h': 1}], [18, 22]), ('unloaded net', [{'a': '0', 'u': '0'}, {'a': [['1'], ['0']], 'u': [['1'], ['0'], ['1']]}, {'a': 5}], [20, 20]), ('empty cycles keep reference', [{'e': '0'}, {'e': [['1'], [], ['0', '1'], [], ['0'], ['0'], ['0'], ['0'], ['0']]}, {'e': 4}], [16, 32]), ('from unknown initial value', [{'k': 'x'}, {'k': [['0'], ['1', 'x', '1']]}, {'k': 5}], [15, 25])]]
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 fixtureActualExpectedOutcome
full toggles and unknown transitions[21, 21][15, 15]Failed
glitch inside a cycle[4, 20][4, 20]Passed
cross-cycle glitch reference[2, 6][2, 6]Passed
unloaded net[20, 20][20, 20]Passed
empty cycles keep reference[16, 32][16, 32]Passed
from unknown initial value[3, 6][3, 5]Failed

SHA-256 / 271eb41c09daf10e7372e0f6caf263babbbd964e5157da47ea4266e0c71b89ce

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:15.397870+00:00.

Case digest / cc863af55fc4200f2f6d1f8c634c252e259a59ec9475bb291f58a01d81eff131