FA-10676 / Raster clipping / Open access
Span merge touching · case 01
Touching coverage spans remain separate and create redundant raster work.
ROOT CAUSE
Touching coverage spans remain separate and create redundant raster work.
VERIFIED REPAIR
Use the stage contract: Return sorted disjoint half-open raster spans after dropping zero/negative lengths and coalescing both overlapping and adjacent spans.
Unsuccessful approach: Replacing the merged end with a contained span end shrinks coverage and retains empty spans.
Case contract
Return sorted disjoint half-open raster spans after dropping zero/negative lengths and coalescing both overlapping and adjacent spans.
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(spans):
out=[]
for left,right in sorted(spans):
if right<=left: continue
if out and left<out[-1][1]: out[-1][1]=max(out[-1][1],right)
else: out.append([left,right])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([[0, 2], [2, 4]],)), [[0, 4]])
check('fixture 2', solve(*([[0, 5], [1, 2]],)), [[0, 5]])
check('fixture 3', solve(*([[3, 3], [1, 2]],)), [[1, 2]])
check('fixture 4', solve(*([],)), [])
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, 2], [2, 4]] | [[0, 4]] | Failed |
| fixture 2 | [[0, 5]] | [[0, 5]] | Passed |
| fixture 3 | [[1, 2]] | [[1, 2]] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 001eeec722b5fbb631adb5d8e391219748a25f2196b678036eaa50fafcfa53bf
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(spans):
out=[]
for left,right in sorted(spans):
if out and left<=out[-1][1]: out[-1][1]=right
else: out.append([left,right])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([[0, 2], [2, 4]],)), [[0, 4]])
check('fixture 2', solve(*([[0, 5], [1, 2]],)), [[0, 5]])
check('fixture 3', solve(*([[3, 3], [1, 2]],)), [[1, 2]])
check('fixture 4', solve(*([],)), [])
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, 4]] | [[0, 4]] | Passed |
| fixture 2 | [[0, 2]] | [[0, 5]] | Failed |
| fixture 3 | [[1, 2], [3, 3]] | [[1, 2]] | Failed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 3c18e45a4b141cf169ba23d2b79cd027860f1d74dc22b74289fc311d5849b593
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(spans):
out=[]
for left,right in sorted(spans):
if right<=left: continue
if out and left<=out[-1][1]: out[-1][1]=max(out[-1][1],right)
else: out.append([left,right])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([[0, 2], [2, 4]],)), [[0, 4]])
check('fixture 2', solve(*([[0, 5], [1, 2]],)), [[0, 5]])
check('fixture 3', solve(*([[3, 3], [1, 2]],)), [[1, 2]])
check('fixture 4', solve(*([],)), [])
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, 4]] | [[0, 4]] | Passed |
| fixture 2 | [[0, 5]] | [[0, 5]] | Passed |
| fixture 3 | [[1, 2]] | [[1, 2]] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / c2987cffcb499c4d39972b54bcb2e4e089cff5b7cc0ea61ff67bb7303156f05c
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.200323+00:00.
Case digest / 9a0fda71d0848bd25b9bed1d5781518a1914ee5b32c2218fab530e32caab4509