FAILURE MAP
← Case archive

FA-6436 / Discrete calculus / Open access

Discrete laplacian periodic · case 01

The center stencil coefficient lacks its factor of two.

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

ROOT CAUSE

The center stencil coefficient lacks its factor of two.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return [values[i-1]-2*v+values[(i+1)%len(values)] for i,v in enumerate(values)]

Unsuccessful approach: Zero boundary conditions replace periodic wraparound.

Case contract

Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. Discrete laplacian periodic. Exact operational definition: [values[i-1]-2*v+values[(i+1)%len(values)] for i,v in enumerate(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 [values[i-1]-v+values[(i+1)%len(values)] for i,v in enumerate(values)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [3, 0, -3])
check('fixture 2: ([4, 4, 4],)', solve(*([4, 4, 4],)), [0, 0, 0])
check('fixture 3: ([5],)', solve(*([5],)), [0])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],)[4, 2, 0][3, 0, -3]Failed
fixture 2: ([4, 4, 4],)[4, 4, 4][0, 0, 0]Failed
fixture 3: ([5],)[5][0]Failed
fixture 4: ([],)[][]Passed

SHA-256 / 60bdd74bc121a736409fa792b7e5fc73ab8bb82605e799cf503eb3d704305efe

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 [(values[i-1] if i else 0)-2*v+(values[i+1] if i+1<len(values) else 0) for i,v in enumerate(values)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [3, 0, -3])
check('fixture 2: ([4, 4, 4],)', solve(*([4, 4, 4],)), [0, 0, 0])
check('fixture 3: ([5],)', solve(*([5],)), [0])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],)[0, 0, -4][3, 0, -3]Failed
fixture 2: ([4, 4, 4],)[-4, 0, -4][0, 0, 0]Failed
fixture 3: ([5],)[-10][0]Failed
fixture 4: ([],)[][]Passed

SHA-256 / 9952c20926d4894ce7c8099947efea444974bd12f0af4fb48c784d8e9a57b3a4

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 [values[i-1]-2*v+values[(i+1)%len(values)] for i,v in enumerate(values)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [3, 0, -3])
check('fixture 2: ([4, 4, 4],)', solve(*([4, 4, 4],)), [0, 0, 0])
check('fixture 3: ([5],)', solve(*([5],)), [0])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],)[3, 0, -3][3, 0, -3]Passed
fixture 2: ([4, 4, 4],)[0, 0, 0][0, 0, 0]Passed
fixture 3: ([5],)[0][0]Passed
fixture 4: ([],)[][]Passed

SHA-256 / ea5bf33f06da4c345b8acaad85d2af367715d45e01f0b2299664b8ddd04bbe21

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

Case digest / d93425fba5ecbf84f6b9c686f5aafec4e4bbb38b8b60b36294ec731be01ac1df