FAILURE MAP
← Case archive

FA-10596 / Color encoding / Open access

Pack rgba big endian word · case 01

Packing assumes little-endian channel significance instead of the stated integer layout.

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

ROOT CAUSE

Packing assumes little-endian channel significance instead of the stated integer layout.

VERIFIED REPAIR

Use the stage contract: Pack four integer bytes RGBA into an unsigned word with red as most significant byte and alpha as least significant byte.

Unsuccessful approach: Correcting RGB byte order still discards alpha.

Case contract

Pack four integer bytes RGBA into an unsigned word with red as most significant byte and alpha as least significant byte.

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 (rgba[3]<<24)|(rgba[2]<<16)|(rgba[1]<<8)|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],)), 16909060)
check('fixture 2', solve(*([0, 0, 0, 255],)), 255)
check('fixture 3', solve(*([255, 0, 0, 0],)), 4278190080)
check('fixture 4', solve(*([0, 0, 0, 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
fixture 16730598516909060Failed
fixture 24278190080255Failed
fixture 32554278190080Failed
fixture 400Passed

SHA-256 / 3d71728d3211febd8faeef4c55c548472f14698867d499758f2b9a7ca475fe37

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[0]<<24)|(rgba[1]<<16)|(rgba[2]<<8)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([1, 2, 3, 4],)), 16909060)
check('fixture 2', solve(*([0, 0, 0, 255],)), 255)
check('fixture 3', solve(*([255, 0, 0, 0],)), 4278190080)
check('fixture 4', solve(*([0, 0, 0, 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
fixture 11690905616909060Failed
fixture 20255Failed
fixture 342781900804278190080Passed
fixture 400Passed

SHA-256 / 4a762fba071c64533cd7d857c91f1bac926597e8d3e559e13886b6fca41713ed

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[0]<<24)|(rgba[1]<<16)|(rgba[2]<<8)|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],)), 16909060)
check('fixture 2', solve(*([0, 0, 0, 255],)), 255)
check('fixture 3', solve(*([255, 0, 0, 0],)), 4278190080)
check('fixture 4', solve(*([0, 0, 0, 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
fixture 11690906016909060Passed
fixture 2255255Passed
fixture 342781900804278190080Passed
fixture 400Passed

SHA-256 / 838cb374cf9d1b18e032016790eb910dfa143f8284911a6d9fae7fbaa1727c8b

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

Case digest / 4b9393ee1ddab13b697056d9d54866bf9f5ff2ea6b1310bfa4747c70818ce07e