FAILURE MAP
← Case archive

FA-10531 / Raster compositing / Open access

Straight alpha source over channel · case 01

A straight source channel is treated as already premultiplied.

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

ROOT CAUSE

A straight source channel is treated as already premultiplied.

VERIFIED REPAIR

Use the stage contract: Return a normalized straight source channel composited over an opaque destination channel. All three inputs lie in [0,1].

Unsuccessful approach: Attenuating the source without attenuating the destination double-counts covered background.

Case contract

Return a normalized straight source channel composited over an opaque destination channel. All three inputs lie in [0,1].

Why this case matters

A deterministic software graphics stage with explicit channel and coordinate conventions; no hardware, device profile or API behavior is inferred.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(source, alpha, destination):
    return source+destination*(1-alpha)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(0.8, 0.5, 0.2)), 0.5)
check('fixture 2', solve(*(1, 0, 0.25)), 0.25)
check('fixture 3', solve(*(0.25, 1, 0.8)), 0.25)
check('fixture 4', solve(*(0, 0.5, 1)), 0.5)
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
fixture 10.90.5Failed
fixture 21.250.25Failed
fixture 30.250.25Passed
fixture 40.50.5Passed

SHA-256 / 0973a9f51c4d44832e114951374ec010f4725a512eaf130dc9f9639b1b4f645e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(source, alpha, destination):
    return source*alpha+destination
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(0.8, 0.5, 0.2)), 0.5)
check('fixture 2', solve(*(1, 0, 0.25)), 0.25)
check('fixture 3', solve(*(0.25, 1, 0.8)), 0.25)
check('fixture 4', solve(*(0, 0.5, 1)), 0.5)
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
fixture 10.60000000000000010.5Failed
fixture 20.250.25Passed
fixture 31.050.25Failed
fixture 41.00.5Failed

SHA-256 / 20ddbe3cf3262a0d018d670d6b08eef08b60dd8476c78bdf89d7f0fe97828f03

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(source, alpha, destination):
    return source*alpha+destination*(1-alpha)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(0.8, 0.5, 0.2)), 0.5)
check('fixture 2', solve(*(1, 0, 0.25)), 0.25)
check('fixture 3', solve(*(0.25, 1, 0.8)), 0.25)
check('fixture 4', solve(*(0, 0.5, 1)), 0.5)
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
fixture 10.50.5Passed
fixture 20.250.25Passed
fixture 30.250.25Passed
fixture 40.50.5Passed

SHA-256 / d64e0fc59f1c154fdfbb72cc53cefb716307862f26742a3920eb6122094c26a2

Verification & scope

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

Case digest / 67d7ae6732fc1c5efc8a6bbaa9b98feac51d36a97c12522c24e69adc8283dfb9