FAILURE MAP
← Case archive

FA-10591 / Color encoding / Open access

Rgba byte channel reorder · case 01

An RGBA source buffer is uploaded unchanged to a BGRA consumer.

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

ROOT CAUSE

An RGBA source buffer is uploaded unchanged to a BGRA consumer.

VERIFIED REPAIR

Use the stage contract: Convert RGBA byte channel order into BGRA without changing channel values or alpha position.

Unsuccessful approach: Reversing all bytes moves alpha into the first color channel.

Case contract

Convert RGBA byte channel order into BGRA without changing channel values or alpha position.

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(rgba):
    return list(rgba)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([1, 2, 3, 4],)), [3, 2, 1, 4])
check('fixture 2', solve(*([255, 0, 0, 128],)), [0, 0, 255, 128])
check('fixture 3', solve(*([0, 0, 0, 0],)), [0, 0, 0, 0])
check('fixture 4', solve(*([7, 7, 7, 9],)), [7, 7, 7, 9])
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 1[1, 2, 3, 4][3, 2, 1, 4]Failed
fixture 2[255, 0, 0, 128][0, 0, 255, 128]Failed
fixture 3[0, 0, 0, 0][0, 0, 0, 0]Passed
fixture 4[7, 7, 7, 9][7, 7, 7, 9]Passed

SHA-256 / 1666a21e114999bf9ed5f98deecb56c89b7885bc98c24e599a13dbc26ef17116

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(rgba):
    return [rgba[3],rgba[2],rgba[1],rgba[0]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([1, 2, 3, 4],)), [3, 2, 1, 4])
check('fixture 2', solve(*([255, 0, 0, 128],)), [0, 0, 255, 128])
check('fixture 3', solve(*([0, 0, 0, 0],)), [0, 0, 0, 0])
check('fixture 4', solve(*([7, 7, 7, 9],)), [7, 7, 7, 9])
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 1[4, 3, 2, 1][3, 2, 1, 4]Failed
fixture 2[128, 0, 0, 255][0, 0, 255, 128]Failed
fixture 3[0, 0, 0, 0][0, 0, 0, 0]Passed
fixture 4[9, 7, 7, 7][7, 7, 7, 9]Failed

SHA-256 / ae13df7adc646220dd4f92cd152b213ee0feeca1b1931d51aef79e41e98a9e9c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(rgba):
    return [rgba[2],rgba[1],rgba[0],rgba[3]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([1, 2, 3, 4],)), [3, 2, 1, 4])
check('fixture 2', solve(*([255, 0, 0, 128],)), [0, 0, 255, 128])
check('fixture 3', solve(*([0, 0, 0, 0],)), [0, 0, 0, 0])
check('fixture 4', solve(*([7, 7, 7, 9],)), [7, 7, 7, 9])
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 1[3, 2, 1, 4][3, 2, 1, 4]Passed
fixture 2[0, 0, 255, 128][0, 0, 255, 128]Passed
fixture 3[0, 0, 0, 0][0, 0, 0, 0]Passed
fixture 4[7, 7, 7, 9][7, 7, 7, 9]Passed

SHA-256 / dddebf78a1a12bfc5153cdc208a5cd4e67caafc4108fc3eb5020287022d7e287

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

Case digest / 93364558fca85118e9ea9f992f7393b1f916ea781288f051541f36465976c620