FAILURE MAP
← Case archive

FA-10701 / Rendering state / Open access

Stencil increment saturates · case 01

Stencil increment wraps a saturated 255 value back to zero.

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

ROOT CAUSE

Stencil increment wraps a saturated 255 value back to zero.

VERIFIED REPAIR

Use the stage contract: Increment a stencil byte using the saturating increment operation, distinct from increment-and-wrap.

Unsuccessful approach: A ceiling of 254 excludes the valid maximal stencil value.

Case contract

Increment a stencil byte using the saturating increment operation, distinct from increment-and-wrap.

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(value):
    return (value+1)&255
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(255,)), 255)
check('fixture 2', solve(*(254,)), 255)
check('fixture 3', solve(*(0,)), 1)
check('fixture 4', solve(*(100,)), 101)
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 10255Failed
fixture 2255255Passed
fixture 311Passed
fixture 4101101Passed

SHA-256 / 1e9b3351dbf59c3ab9ce5e078284664dcf73c2ca4f614eb8bef2e8ff52d93778

2 / The unsuccessful fix

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

SHA-256 / 6fa26c07c855310b356c0bb25a63633561654d29e02f44a8afcdf7525bc96a52

3 / The verified repair

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

SHA-256 / d94141c64a494572cadd34d35ef490b41e891fe8f90b2cf1007c2a6e8848cb49

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

Case digest / dfb68e86ae478826b9c9064ff896b474faa7908425e8f1fc9c5b4799169d0697