FA-5871 / Planar geometry / Open access
Point line squared distance · case 01
Distance to an endpoint replaces perpendicular distance to the infinite line.
ROOT CAUSE
Distance to an endpoint replaces perpendicular distance to the infinite line.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(Fraction(((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1]))**2,(b[0]-a[0])**2+(b[1]-a[1])**2))
Unsuccessful approach: The cross product is not squared for squared distance.
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. p,a,b are integer planar points with a!=b; return reduced Fraction string for distance squared to the infinite line through a and b. Exact operational definition: str(Fraction(((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1]))**2,(b[0]-a[0])**2+(b[1]-a[1])**2))
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(p, a, b):
return str((p[0]-a[0])**2+(p[1]-a[1])**2)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((1, 2), (0, 0), (2, 0))', solve(*((1, 2), (0, 0), (2, 0))), '4')
check('fixture 2: ((1, 1), (0, 0), (2, 2))', solve(*((1, 1), (0, 0), (2, 2))), '0')
check('fixture 3: ((0, 2), (0, 0), (1, 1))', solve(*((0, 2), (0, 0), (1, 1))), '2')
check('fixture 4: ((3, 0), (0, 0), (1, 0))', solve(*((3, 0), (0, 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: ((1, 2), (0, 0), (2, 0)) | 5 | 4 | Failed |
| fixture 2: ((1, 1), (0, 0), (2, 2)) | 2 | 0 | Failed |
| fixture 3: ((0, 2), (0, 0), (1, 1)) | 4 | 2 | Failed |
| fixture 4: ((3, 0), (0, 0), (1, 0)) | 9 | 0 | Failed |
SHA-256 / 7d468b937273a1a7ec2d10f06cb144fe59c1365c7c4db4906af2cc0d6932e8d5
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(p, a, b):
return str(Fraction(abs((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1])),(b[0]-a[0])**2+(b[1]-a[1])**2))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((1, 2), (0, 0), (2, 0))', solve(*((1, 2), (0, 0), (2, 0))), '4')
check('fixture 2: ((1, 1), (0, 0), (2, 2))', solve(*((1, 1), (0, 0), (2, 2))), '0')
check('fixture 3: ((0, 2), (0, 0), (1, 1))', solve(*((0, 2), (0, 0), (1, 1))), '2')
check('fixture 4: ((3, 0), (0, 0), (1, 0))', solve(*((3, 0), (0, 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: ((1, 2), (0, 0), (2, 0)) | 1 | 4 | Failed |
| fixture 2: ((1, 1), (0, 0), (2, 2)) | 0 | 0 | Passed |
| fixture 3: ((0, 2), (0, 0), (1, 1)) | 1 | 2 | Failed |
| fixture 4: ((3, 0), (0, 0), (1, 0)) | 0 | 0 | Passed |
SHA-256 / 8a92bfe63283368c1bfdacc8e01d55c328ebeb776b6e501deedd16c7f4c04e88
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(p, a, b):
return str(Fraction(((b[0]-a[0])*(a[1]-p[1])-(a[0]-p[0])*(b[1]-a[1]))**2,(b[0]-a[0])**2+(b[1]-a[1])**2))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((1, 2), (0, 0), (2, 0))', solve(*((1, 2), (0, 0), (2, 0))), '4')
check('fixture 2: ((1, 1), (0, 0), (2, 2))', solve(*((1, 1), (0, 0), (2, 2))), '0')
check('fixture 3: ((0, 2), (0, 0), (1, 1))', solve(*((0, 2), (0, 0), (1, 1))), '2')
check('fixture 4: ((3, 0), (0, 0), (1, 0))', solve(*((3, 0), (0, 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: ((1, 2), (0, 0), (2, 0)) | 4 | 4 | Passed |
| fixture 2: ((1, 1), (0, 0), (2, 2)) | 0 | 0 | Passed |
| fixture 3: ((0, 2), (0, 0), (1, 1)) | 2 | 2 | Passed |
| fixture 4: ((3, 0), (0, 0), (1, 0)) | 0 | 0 | Passed |
SHA-256 / a3850bd315781965ac49b5b9e2d59c70c9b22fe34a02ae3ec514d3b95a1264b6
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:54.537103+00:00.
Case digest / c5e553d2f52addf4520bb5c0cdf9da891fc2683e5a26f772af5eb9d7f5c4e89f