FAILURE MAP
← Case archive

FA-5906 / Planar geometry / Open access

Barycentric affine point · case 01

Homogeneous weights are not normalized.

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

ROOT CAUSE

Homogeneous weights are not normalized.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return [sum(p[i]*w for p,w in zip(points,weights))/sum(weights) for i in range(2)]

Unsuccessful approach: An unweighted centroid ignores unequal barycentric weights.

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. points are planar integer vectors; weights are matching nonnegative integers with positive total. Return a two-coordinate weighted affine point. Exact operational definition: [sum(p[i]*w for p,w in zip(points,weights))/sum(weights) for i in range(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(points, weights):
    return [sum(p[i]*w for p,w in zip(points,weights)) for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [1, 1, 1])), [2, 2])
check('fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [2, 1, 1])), [1.5, 1.5])
check('fixture 3: ([(1, 2)], [5])', solve(*([(1, 2)], [5])), [1, 2])
check('fixture 4: ([(0, 0), (4, 4)], [1, 3])', solve(*([(0, 0), (4, 4)], [1, 3])), [3, 3])
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 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])[6, 6][2, 2]Failed
fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])[6, 6][1.5, 1.5]Failed
fixture 3: ([(1, 2)], [5])[5, 10][1, 2]Failed
fixture 4: ([(0, 0), (4, 4)], [1, 3])[12, 12][3, 3]Failed

SHA-256 / 80bf2ae94f53e8f65ec07839d2829eaeae0e2e909213178a1c8cb3887bdc523c

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, weights):
    return [sum(p[i] for p in points)/len(points) for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [1, 1, 1])), [2, 2])
check('fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [2, 1, 1])), [1.5, 1.5])
check('fixture 3: ([(1, 2)], [5])', solve(*([(1, 2)], [5])), [1, 2])
check('fixture 4: ([(0, 0), (4, 4)], [1, 3])', solve(*([(0, 0), (4, 4)], [1, 3])), [3, 3])
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 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])[2.0, 2.0][2, 2]Passed
fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])[2.0, 2.0][1.5, 1.5]Failed
fixture 3: ([(1, 2)], [5])[1.0, 2.0][1, 2]Passed
fixture 4: ([(0, 0), (4, 4)], [1, 3])[2.0, 2.0][3, 3]Failed

SHA-256 / d2027b3bc3eb955d1386a83098abbd6464a5ef6f59d7e82c9b4ab697fb0ddf90

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, weights):
    return [sum(p[i]*w for p,w in zip(points,weights))/sum(weights) for i in range(2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [1, 1, 1])), [2, 2])
check('fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])', solve(*([(0, 0), (6, 0), (0, 6)], [2, 1, 1])), [1.5, 1.5])
check('fixture 3: ([(1, 2)], [5])', solve(*([(1, 2)], [5])), [1, 2])
check('fixture 4: ([(0, 0), (4, 4)], [1, 3])', solve(*([(0, 0), (4, 4)], [1, 3])), [3, 3])
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 1: ([(0, 0), (6, 0), (0, 6)], [1, 1, 1])[2.0, 2.0][2, 2]Passed
fixture 2: ([(0, 0), (6, 0), (0, 6)], [2, 1, 1])[1.5, 1.5][1.5, 1.5]Passed
fixture 3: ([(1, 2)], [5])[1.0, 2.0][1, 2]Passed
fixture 4: ([(0, 0), (4, 4)], [1, 3])[3.0, 3.0][3, 3]Passed

SHA-256 / 7a8c30fd6e1607af5c733907e9daf8983eb730eb2d2c2efe7afe7003d0572381

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

Case digest / 57b32c538a146d0be3bfa647acd286c807c3a278d4748a49789c3565a05530c1