FA-6466 / Discrete calculus / Open access
Discrete energy squared norm · case 01
Squaring the total allows cancellation between samples.
ROOT CAUSE
Squaring the total allows cancellation between samples.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(v*v for v in values)
Unsuccessful approach: Magnitude sum is not quadratic energy.
Case contract
Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. Discrete energy squared norm. Exact operational definition: sum(v*v for v in values)
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Discrete calculus 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(values):
return sum(values)**2
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, -2],)', solve(*([2, -2],)), 8)
check('fixture 2: ([1, 2, 3],)', solve(*([1, 2, 3],)), 14)
check('fixture 3: ([0],)', solve(*([0],)), 0)
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: ([2, -2],) | 0 | 8 | Failed |
| fixture 2: ([1, 2, 3],) | 36 | 14 | Failed |
| fixture 3: ([0],) | 0 | 0 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / c57058ca4a9bee9818150b77deb625f25878b00b2694d0745d1ead243eea3fa0
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(values):
return sum(abs(v) for v in values)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, -2],)', solve(*([2, -2],)), 8)
check('fixture 2: ([1, 2, 3],)', solve(*([1, 2, 3],)), 14)
check('fixture 3: ([0],)', solve(*([0],)), 0)
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: ([2, -2],) | 4 | 8 | Failed |
| fixture 2: ([1, 2, 3],) | 6 | 14 | Failed |
| fixture 3: ([0],) | 0 | 0 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 7dd3f5bfd57ad3c550c98d8b81d7157636826af31e4174f485b00637567e8d50
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(values):
return sum(v*v for v in values)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([2, -2],)', solve(*([2, -2],)), 8)
check('fixture 2: ([1, 2, 3],)', solve(*([1, 2, 3],)), 14)
check('fixture 3: ([0],)', solve(*([0],)), 0)
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: ([2, -2],) | 8 | 8 | Passed |
| fixture 2: ([1, 2, 3],) | 14 | 14 | Passed |
| fixture 3: ([0],) | 0 | 0 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 5da0a89029fab5d5331daa283748ec86573cd8259cd34cd3eebc3b7bd8079093
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:38:02.369070+00:00.
Case digest / 17f6157cbdb66003949d8ada59300ebe165557c243476f90c797f7098611395b