FA-10641 / Raster clipping / Open access
Clip row both ends · case 01
Negative clipping coordinates are interpreted as Python indices from the row end.
ROOT CAUSE
Negative clipping coordinates are interpreted as Python indices from the row end.
VERIFIED REPAIR
Use the stage contract: Clip integer half-open horizontal coverage [start,end) against a row extent [0,len(row)); return covered pixels in order.
Unsuccessful approach: Adding one to the exclusive end shades an extra pixel.
Case contract
Clip integer half-open horizontal coverage [start,end) against a row extent [0,len(row)); return covered pixels in order.
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(row, start, end):
return row[start:end]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([0, 1, 2, 3], -2, 2)), [0, 1])
check('fixture 2', solve(*([0, 1, 2, 3], 1, 3)), [1, 2])
check('fixture 3', solve(*([0, 1], 4, 8)), [])
check('fixture 4', solve(*([0, 1], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [] | [0, 1] | Failed |
| fixture 2 | [1, 2] | [1, 2] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / ffbc9966c88936cdfb836918801d9bf47acc19b2cf12530654b2d1567718adb5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(row, start, end):
return row[max(0,start):min(len(row),end)+1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([0, 1, 2, 3], -2, 2)), [0, 1])
check('fixture 2', solve(*([0, 1, 2, 3], 1, 3)), [1, 2])
check('fixture 3', solve(*([0, 1], 4, 8)), [])
check('fixture 4', solve(*([0, 1], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [0, 1, 2] | [0, 1] | Failed |
| fixture 2 | [1, 2, 3] | [1, 2] | Failed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0] | [] | Failed |
SHA-256 / 83f8d8ef3da21eef89441a3f5e43f81dd2cd415f3a2518712d433ce906e4b55d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(row, start, end):
return row[max(0,start):max(0,min(len(row),end))] if end>max(0,start) else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([0, 1, 2, 3], -2, 2)), [0, 1])
check('fixture 2', solve(*([0, 1, 2, 3], 1, 3)), [1, 2])
check('fixture 3', solve(*([0, 1], 4, 8)), [])
check('fixture 4', solve(*([0, 1], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [0, 1] | [0, 1] | Passed |
| fixture 2 | [1, 2] | [1, 2] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 63ff6062f0da64373ffae109210f0fa575ba0ae89cc388406d0e669d074781b3
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.900005+00:00.
Case digest / e9cc7852de88f6e1cde2aa47ab59af19db14404f70d25e0a2c94a321b460d6db