FAILURE MAP
← Case archive

FA-10611 / Color encoding / Open access

Byte channel normalization · case 01

Dividing by 256 makes the maximum representable white less than one.

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

ROOT CAUSE

Dividing by 256 makes the maximum representable white less than one.

VERIFIED REPAIR

Use the stage contract: Map integer byte values in [0,255] to normalized [0,1] with both endpoints exact.

Unsuccessful approach: Integer division reduces nearly all nonwhite channels to black.

Case contract

Map integer byte values in [0,255] to normalized [0,1] with both endpoints exact.

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(byte):
    return byte/256
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(255,)), 1)
check('fixture 2', solve(*(0,)), 0)
check('fixture 3', solve(*(85,)), 0.3333333333333333)
check('fixture 4', solve(*(128,)), 0.5019607843137255)
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.996093751Failed
fixture 20.00Passed
fixture 30.332031250.3333333333333333Failed
fixture 40.50.5019607843137255Failed

SHA-256 / b17b00cebb088a4e4138bfeab1b27bfb43c52eff055c2951b82a268740a5d38d

2 / The unsuccessful fix

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

SHA-256 / 591e377c0a1dafec26e763aa211ad69f535db974c7f7a0edb4b4d437f8aed3d4

3 / The verified repair

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

SHA-256 / a73f82f808cb53fc2d201e393ff48d66bd5c516db98b8086f54615aba81c405a

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

Case digest / f8ef3bed0e2f789b4a44a468816b7f75d1158cba233607a7b3b7204b0dcd930b