FAILURE MAP
← Case archive

FA-5836 / Planar geometry / Open access

Degree normalization signed · case 01

Unsigned normalization violates the signed half-open interval.

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

ROOT CAUSE

Unsigned normalization violates the signed half-open interval.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return (degrees+180)%360-180

Unsuccessful approach: Remainder preserves a negative dividend outside the interval.

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. Degree normalization signed. Exact operational definition: (degrees+180)%360-180

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(degrees):
    return degrees%360
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (180,)', solve(*(180,)), -180)
check('fixture 2: (370,)', solve(*(370,)), 10)
check('fixture 3: (-190,)', solve(*(-190,)), 170)
check('fixture 4: (0,)', solve(*(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 fixtureActualExpectedOutcome
fixture 1: (180,)180-180Failed
fixture 2: (370,)1010Passed
fixture 3: (-190,)170170Passed
fixture 4: (0,)00Passed

SHA-256 / d806ef8b9e8502490338c7c42b1a38a1a39cd4f3bd38b9be2afbf8296b5a6029

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(degrees):
    return math.fmod(degrees,360)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (180,)', solve(*(180,)), -180)
check('fixture 2: (370,)', solve(*(370,)), 10)
check('fixture 3: (-190,)', solve(*(-190,)), 170)
check('fixture 4: (0,)', solve(*(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 fixtureActualExpectedOutcome
fixture 1: (180,)180.0-180Failed
fixture 2: (370,)10.010Passed
fixture 3: (-190,)-190.0170Failed
fixture 4: (0,)0.00Passed

SHA-256 / 41ecce2042731e9e1cb6e27250571c84958e3881990dca9ab5b1923192ad5395

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(degrees):
    return (degrees+180)%360-180
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (180,)', solve(*(180,)), -180)
check('fixture 2: (370,)', solve(*(370,)), 10)
check('fixture 3: (-190,)', solve(*(-190,)), 170)
check('fixture 4: (0,)', solve(*(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 fixtureActualExpectedOutcome
fixture 1: (180,)-180-180Passed
fixture 2: (370,)1010Passed
fixture 3: (-190,)170170Passed
fixture 4: (0,)00Passed

SHA-256 / acb6d9c6b056128942c0a03fc80e8e65daa8692739802e32e332f708f6e6e76e

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

Case digest / aa3a70d8e770010ac9ec2f49481fcc6cd1b89731fd7d3509b386cdaf8aa1123a