FAILURE MAP
← Case archive

FA-5786 / Planar geometry / Open access

Manhattan point distance · case 01

Taking one final absolute value permits coordinate cancellation.

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

ROOT CAUSE

Taking one final absolute value permits coordinate cancellation.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(abs(x-y) for x,y in zip(a,b))

Unsuccessful approach: The maximum coordinate distance uses the Chebyshev norm.

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. Manhattan point distance. Exact operational definition: sum(abs(x-y) for x,y in zip(a,b))

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 abs(sum(x-y for x,y in zip(a,b)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 7)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 4)
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), (3, 4))77Passed
fixture 2: ((0, 0), (1, -1))02Failed
fixture 3: ((2, 2), (2, 2))00Passed
fixture 4: ((-2, 0), (2, 0))44Passed

SHA-256 / 0541ce39fe380471ff22b6cc86b426ba210233f919789bf5b9e1be69c65eb92a

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(abs(x-y) for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 7)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 4)
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), (3, 4))47Failed
fixture 2: ((0, 0), (1, -1))12Failed
fixture 3: ((2, 2), (2, 2))00Passed
fixture 4: ((-2, 0), (2, 0))44Passed

SHA-256 / 5e4d91a5ba2969a12cdf04708d84c47413e6bf172237b9566b36204eb21b979b

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 sum(abs(x-y) for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ((0, 0), (3, 4))', solve(*((0, 0), (3, 4))), 7)
check('fixture 2: ((0, 0), (1, -1))', solve(*((0, 0), (1, -1))), 2)
check('fixture 3: ((2, 2), (2, 2))', solve(*((2, 2), (2, 2))), 0)
check('fixture 4: ((-2, 0), (2, 0))', solve(*((-2, 0), (2, 0))), 4)
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), (3, 4))77Passed
fixture 2: ((0, 0), (1, -1))22Passed
fixture 3: ((2, 2), (2, 2))00Passed
fixture 4: ((-2, 0), (2, 0))44Passed

SHA-256 / 6f52e6170fe555552a494f391db5fa9b7d07b6890bc2dcc29445585c40c15f37

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

Case digest / ba957017e72bdb5d8da8821d9c956e9ff87eb2b54175ad10ccd65323cc3b9623