FA-5771 / Planar geometry / Open access
Rectangle intersection area · case 01
Separated axis extents are multiplied as negative lengths.
ROOT CAUSE
Separated axis extents are multiplied as negative lengths.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return max(0,min(a[2],b[2])-max(a[0],b[0]))*max(0,min(a[3],b[3])-max(a[1],b[1]))
Unsuccessful approach: Clamping after multiplication admits two negative extents.
Case contract
Integer coordinates and lengths, with exact arithmetic except for indicated division results. Lengths are nonnegative. Rectangles are (xmin,ymin,xmax,ymax) with ordered bounds; coordinate vectors have matching dimensions. Rectangle intersection area. Exact operational definition: max(0,min(a[2],b[2])-max(a[0],b[0]))*max(0,min(a[3],b[3])-max(a[1],b[1]))
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Planar geometry results depend on the stated convention.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(a, b):
return (min(a[2],b[2])-max(a[0],b[0]))*(min(a[3],b[3])-max(a[1],b[1]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 1)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 0)
check('fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1))', solve(*((0, 0, 1, 1), (2, 0, 3, 1))), 0)
check('fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2))', solve(*((0, 0, 2, 2), (2, 0, 4, 2))), 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, 0, 2, 2), (1, 1, 3, 3)) | 1 | 1 | Passed |
| fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3)) | 1 | 0 | Failed |
| fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1)) | -1 | 0 | Failed |
| fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2)) | 0 | 0 | Passed |
SHA-256 / fb9189754b1b5963d70bfb3e24fba7182684e858798aaf9c4089a8b660e12f04
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(a, b):
return max(0,(min(a[2],b[2])-max(a[0],b[0]))*(min(a[3],b[3])-max(a[1],b[1])))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 1)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 0)
check('fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1))', solve(*((0, 0, 1, 1), (2, 0, 3, 1))), 0)
check('fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2))', solve(*((0, 0, 2, 2), (2, 0, 4, 2))), 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, 0, 2, 2), (1, 1, 3, 3)) | 1 | 1 | Passed |
| fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3)) | 1 | 0 | Failed |
| fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1)) | 0 | 0 | Passed |
| fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2)) | 0 | 0 | Passed |
SHA-256 / 8ec29d227e1a0ffe902786d07b547d691b66a7009307378ae514f80837679f97
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(a, b):
return max(0,min(a[2],b[2])-max(a[0],b[0]))*max(0,min(a[3],b[3])-max(a[1],b[1]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0, 2, 2), (1, 1, 3, 3))', solve(*((0, 0, 2, 2), (1, 1, 3, 3))), 1)
check('fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3))', solve(*((0, 0, 1, 1), (2, 2, 3, 3))), 0)
check('fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1))', solve(*((0, 0, 1, 1), (2, 0, 3, 1))), 0)
check('fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2))', solve(*((0, 0, 2, 2), (2, 0, 4, 2))), 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, 0, 2, 2), (1, 1, 3, 3)) | 1 | 1 | Passed |
| fixture 2: ((0, 0, 1, 1), (2, 2, 3, 3)) | 0 | 0 | Passed |
| fixture 3: ((0, 0, 1, 1), (2, 0, 3, 1)) | 0 | 0 | Passed |
| fixture 4: ((0, 0, 2, 2), (2, 0, 4, 2)) | 0 | 0 | Passed |
SHA-256 / 817eeaf44fda23ca056f1fb9f76433aba03cb878268936e4ad07b730e9e2fbf0
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:37:53.470831+00:00.
Case digest / 4c77e769c1d684ccb30e58961be0728be24a67af7ee7d72f4f1cc9fde3ad8404