FA-5891 / Planar geometry / Open access
Polygon signed double area · case 01
The closing polygon edge is missing from the shoelace sum.
ROOT CAUSE
The closing polygon edge is missing from the shoelace sum.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[:1]))
Unsuccessful approach: Taking magnitude destroys signed winding information.
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. Vertices are ordered around a polygon; close the last edge to the first. The empty list returns zero. Exact operational definition: sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[: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(points):
return sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(1, 1), (3, 1), (1, 4)],)', solve(*([(1, 1), (3, 1), (1, 4)],)), 6)
check('fixture 2: ([(1, 4), (3, 1), (1, 1)],)', solve(*([(1, 4), (3, 1), (1, 1)],)), -6)
check('fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 4: ([],)', solve(*([],)), 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: ([(1, 1), (3, 1), (1, 4)],) | 9 | 6 | Failed |
| fixture 2: ([(1, 4), (3, 1), (1, 1)],) | -9 | -6 | Failed |
| fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],) | 8 | 8 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 6a374596aadf6af0cb3171d9db1d137c82e0c4942cba08f43d3b4bb8e992b202
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(points):
return abs(sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[:1])))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(1, 1), (3, 1), (1, 4)],)', solve(*([(1, 1), (3, 1), (1, 4)],)), 6)
check('fixture 2: ([(1, 4), (3, 1), (1, 1)],)', solve(*([(1, 4), (3, 1), (1, 1)],)), -6)
check('fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 4: ([],)', solve(*([],)), 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: ([(1, 1), (3, 1), (1, 4)],) | 6 | 6 | Passed |
| fixture 2: ([(1, 4), (3, 1), (1, 1)],) | 6 | -6 | Failed |
| fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],) | 8 | 8 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 3b11463ced536fdec5366a738f8adcf96ca1628bb3e6a804c0f67fab4c3b917a
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(points):
return sum(a[0]*b[1]-a[1]*b[0] for a,b in zip(points,points[1:]+points[:1]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(1, 1), (3, 1), (1, 4)],)', solve(*([(1, 1), (3, 1), (1, 4)],)), 6)
check('fixture 2: ([(1, 4), (3, 1), (1, 1)],)', solve(*([(1, 4), (3, 1), (1, 1)],)), -6)
check('fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],)', solve(*([(0, 0), (2, 0), (2, 2), (0, 2)],)), 8)
check('fixture 4: ([],)', solve(*([],)), 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: ([(1, 1), (3, 1), (1, 4)],) | 6 | 6 | Passed |
| fixture 2: ([(1, 4), (3, 1), (1, 1)],) | -6 | -6 | Passed |
| fixture 3: ([(0, 0), (2, 0), (2, 2), (0, 2)],) | 8 | 8 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 0f84b1537cefd3ea7a5dddf8a83b9de2e808c46256adc01d9ead11ef55c49b1f
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:55.200742+00:00.
Case digest / 3345495f8fd7655b32d19c0af6e2538338b06b9423af22e3aea1f0fd80ccc866