FAILURE MAP
← Case archive

FA-10656 / Raster clipping / Open access

Viewport bottom origin flip · case 01

Origin conversion flips the top edge without accounting for rectangle height.

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

ROOT CAUSE

Origin conversion flips the top edge without accounting for rectangle height.

VERIFIED REPAIR

Use the stage contract: Convert the top coordinate of an in-bounds top-left-origin rectangle to its bottom-left-origin viewport y using the full rectangle height.

Unsuccessful approach: Passing through y leaves the top-origin coordinate system unchanged.

Case contract

Convert the top coordinate of an in-bounds top-left-origin rectangle to its bottom-left-origin viewport y using the full rectangle height.

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(top, height, framebuffer_height):
    return framebuffer_height-top
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(2, 3, 10)), 5)
check('fixture 2', solve(*(0, 10, 10)), 0)
check('fixture 3', solve(*(0, 1, 10)), 9)
check('fixture 4', solve(*(9, 1, 10)), 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 185Failed
fixture 2100Failed
fixture 3109Failed
fixture 410Failed

SHA-256 / 6af3d9c2447c2dcd14f82ba99516379d423ff407d5b18b521020cfd139696db8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(top, height, framebuffer_height):
    return top
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(2, 3, 10)), 5)
check('fixture 2', solve(*(0, 10, 10)), 0)
check('fixture 3', solve(*(0, 1, 10)), 9)
check('fixture 4', solve(*(9, 1, 10)), 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 125Failed
fixture 200Passed
fixture 309Failed
fixture 490Failed

SHA-256 / 2c78bab289dac8f45bd9147ff8a5afd1cc637169f8c4e958c4edc016cc26cf7b

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(top, height, framebuffer_height):
    return framebuffer_height-top-height
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(2, 3, 10)), 5)
check('fixture 2', solve(*(0, 10, 10)), 0)
check('fixture 3', solve(*(0, 1, 10)), 9)
check('fixture 4', solve(*(9, 1, 10)), 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 155Passed
fixture 200Passed
fixture 399Passed
fixture 400Passed

SHA-256 / a8c972f6def6075b63550cdb9a7ad29ee49bd89eafde7aed5748839c0ef70f94

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

Case digest / 5bca1f193202dbc4228921f718181651bcfa9bc79d3704ec1a996fc7946136b1