FAILURE MAP
← Case archive

FA-11966 / Discrete control systems / Open access

Duty modulation discards fractional pulse credit · case 01

Duty modulation discards fractional pulse credit.

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

ROOT CAUSE

A fractional command is rounded independently each tick.

VERIFIED REPAIR

Carry integer pulse credit across ticks and subtract a full scale for each emitted pulse.

Unsuccessful approach: Resetting credit to zero on a pulse discards overshoot.

Case contract

Given duty in [0,scale], positive scale and tick count, start credit zero; add duty each tick and emit 1 iff credit>=scale then subtract scale. Return the pulse list.

Why this case matters

An offline discrete controller model isolates this state or arithmetic fault; it makes no physical plant or safety claim.

1 / The failure

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

N = 1
observations = []
def solve(duty, scale, ticks):
    return [int(duty >= scale)]*ticks
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two thirds', solve(2*N, 3*N, 6), [0,1,1,0,1,1])
check('half duty', solve(N, 2*N, 6), [0,1,0,1,0,1])
check('off', solve(0, N, 4), [0,0,0,0])
check('full', solve(N, N, 4), [1,1,1,1])
check('no ticks', solve(N, 2*N, 0), [])
check('first credit', solve(N, 3*N, 2), [0,0])
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
two thirds[0, 0, 0, 0, 0, 0][0, 1, 1, 0, 1, 1]Failed
half duty[0, 0, 0, 0, 0, 0][0, 1, 0, 1, 0, 1]Failed
off[0, 0, 0, 0][0, 0, 0, 0]Passed
full[1, 1, 1, 1][1, 1, 1, 1]Passed
no ticks[][]Passed
first credit[0, 0][0, 0]Passed

SHA-256 / 99d0edbd6821807bd4688c1c9125a59bd4c57cda0d261d9ef443948e630da366

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(duty, scale, ticks):
    credit=0
    out=[]
    for _ in range(ticks):
        credit += duty
        pulse=int(credit>=scale)
        if pulse: credit=0
        out.append(pulse)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two thirds', solve(2*N, 3*N, 6), [0,1,1,0,1,1])
check('half duty', solve(N, 2*N, 6), [0,1,0,1,0,1])
check('off', solve(0, N, 4), [0,0,0,0])
check('full', solve(N, N, 4), [1,1,1,1])
check('no ticks', solve(N, 2*N, 0), [])
check('first credit', solve(N, 3*N, 2), [0,0])
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
two thirds[0, 1, 0, 1, 0, 1][0, 1, 1, 0, 1, 1]Failed
half duty[0, 1, 0, 1, 0, 1][0, 1, 0, 1, 0, 1]Passed
off[0, 0, 0, 0][0, 0, 0, 0]Passed
full[1, 1, 1, 1][1, 1, 1, 1]Passed
no ticks[][]Passed
first credit[0, 0][0, 0]Passed

SHA-256 / d3f981b184cd31b43a1f5e9f37583b4f0cc0c3ef6b85d39932b2f98a9ebac9f2

3 / The verified repair

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

N = 1
observations = []
def solve(duty, scale, ticks):
    credit=0
    out=[]
    for _ in range(ticks):
        credit += duty
        pulse=int(credit>=scale)
        credit -= pulse*scale
        out.append(pulse)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two thirds', solve(2*N, 3*N, 6), [0,1,1,0,1,1])
check('half duty', solve(N, 2*N, 6), [0,1,0,1,0,1])
check('off', solve(0, N, 4), [0,0,0,0])
check('full', solve(N, N, 4), [1,1,1,1])
check('no ticks', solve(N, 2*N, 0), [])
check('first credit', solve(N, 3*N, 2), [0,0])
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
two thirds[0, 1, 1, 0, 1, 1][0, 1, 1, 0, 1, 1]Passed
half duty[0, 1, 0, 1, 0, 1][0, 1, 0, 1, 0, 1]Passed
off[0, 0, 0, 0][0, 0, 0, 0]Passed
full[1, 1, 1, 1][1, 1, 1, 1]Passed
no ticks[][]Passed
first credit[0, 0][0, 0]Passed

SHA-256 / 1b3bf18a963be06f25af9ad6d223adc56c7a9a41f1ac073f88bae9be5d0b0225

Verification & scope

Integer-valued controlled examples only; no physical plant, stability guarantee, timing jitter, or hardware behavior is modeled. 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:38:52.616409+00:00.

Case digest / 67f9490a1a558d08320ad77e84e2c4d6c2f9837e5afd35272dee3d5c7f52a9c3