FAILURE MAP
← Case archive

FA-13061 / Numerical aggregation / Open access

Merge cross scatter: The covariance correction uses the square of the x displacement. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The covariance correction uses the square of the x displacement.

VERIFIED REPAIR

Preserve the merge cross scatter contract at the identified reduction decision.

Unsuccessful approach: Using only y displacement still computes a marginal scatter.

Case contract

Merge disjoint integer (x,y) observation blocks. Return count, exact x/y means and unnormalised centered cross scatter as Fraction strings; empty summary is zero.

Why this case matters

Exact bounded examples isolate a reduction defect without floating-point or external-service effects.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(blocks):
    n=0
    mx=my=c=Fraction(0)
    for block in blocks:
        if not block: continue
        k=len(block)
        ax=Fraction(sum(x for x,y in block),k)
        ay=Fraction(sum(y for x,y in block),k)
        q=sum((x-ax)*(y-ay) for x,y in block)
        total=n+k
        dx,dy=ax-mx,ay-my
        c=c+q+dx*dx*n*k/total
        mx=mx+dx*k/total
        my=my+dy*k/total
        n=total
    return [n,str(mx),str(my),str(c)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[(1, 8), (4, 3), (5, 1)], [(9, 1)]],)), [4, '19/4', '13/4', '-111/4'])
check('regression 2', solve(*([[(8, 1)], [(1, 7), (2, 9)]],)), [3, '11/3', '17/3', '-88/3'])
check('regression 3', solve(*([],)), [0, '0', '0', '0'])
check('regression 4', solve(*([[], [(2, 4), (2, 4)]],)), [2, '2', '4', '0'])
check('regression 5', solve(*([[(0, 3), (2, 1)], [(4, 8), (8, 0)]],)), [4, '7/2', '3', '-8'])
check("variable replicated pairs",solve([[(0,2),(2,0)]]*N),[2*N,"1","1",str(-2*N)])
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
regression 1[4, '19/4', '13/4', '109/12'][4, '19/4', '13/4', '-111/4']Failed
regression 2[3, '11/3', '17/3', '175/6'][3, '11/3', '17/3', '-88/3']Failed
regression 3[0, '0', '0', '0'][0, '0', '0', '0']Passed
regression 4[2, '2', '4', '0'][2, '2', '4', '0']Passed
regression 5[4, '7/2', '3', '7'][4, '7/2', '3', '-8']Failed
variable replicated pairs[2, '1', '1', '-2'][2, '1', '1', '-2']Passed

SHA-256 / db179c4252f3045aa2daf96141ff07d4012b0c7a704c2891bf9c7de455239128

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(blocks):
    n=0
    mx=my=c=Fraction(0)
    for block in blocks:
        if not block: continue
        k=len(block)
        ax=Fraction(sum(x for x,y in block),k)
        ay=Fraction(sum(y for x,y in block),k)
        q=sum((x-ax)*(y-ay) for x,y in block)
        total=n+k
        dx,dy=ax-mx,ay-my
        c=c+q+dy*dy*n*k/total
        mx=mx+dx*k/total
        my=my+dy*k/total
        n=total
    return [n,str(mx),str(my),str(c)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[(1, 8), (4, 3), (5, 1)], [(9, 1)]],)), [4, '19/4', '13/4', '-111/4'])
check('regression 2', solve(*([[(8, 1)], [(1, 7), (2, 9)]],)), [3, '11/3', '17/3', '-88/3'])
check('regression 3', solve(*([],)), [0, '0', '0', '0'])
check('regression 4', solve(*([[], [(2, 4), (2, 4)]],)), [2, '2', '4', '0'])
check('regression 5', solve(*([[(0, 3), (2, 1)], [(4, 8), (8, 0)]],)), [4, '7/2', '3', '-8'])
check("variable replicated pairs",solve([[(0,2),(2,0)]]*N),[2*N,"1","1",str(-2*N)])
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
regression 1[4, '19/4', '13/4', '-33/4'][4, '19/4', '13/4', '-111/4']Failed
regression 2[3, '11/3', '17/3', '101/3'][3, '11/3', '17/3', '-88/3']Failed
regression 3[0, '0', '0', '0'][0, '0', '0', '0']Passed
regression 4[2, '2', '4', '0'][2, '2', '4', '0']Passed
regression 5[4, '7/2', '3', '-14'][4, '7/2', '3', '-8']Failed
variable replicated pairs[2, '1', '1', '-2'][2, '1', '1', '-2']Passed

SHA-256 / 8b02f22735919a19bc6962915d3bc054ac53bb52417f1f53058c99580893e54c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(blocks):
    n=0
    mx=my=c=Fraction(0)
    for block in blocks:
        if not block: continue
        k=len(block)
        ax=Fraction(sum(x for x,y in block),k)
        ay=Fraction(sum(y for x,y in block),k)
        q=sum((x-ax)*(y-ay) for x,y in block)
        total=n+k
        dx,dy=ax-mx,ay-my
        c=c+q+dx*dy*n*k/total
        mx=mx+dx*k/total
        my=my+dy*k/total
        n=total
    return [n,str(mx),str(my),str(c)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[(1, 8), (4, 3), (5, 1)], [(9, 1)]],)), [4, '19/4', '13/4', '-111/4'])
check('regression 2', solve(*([[(8, 1)], [(1, 7), (2, 9)]],)), [3, '11/3', '17/3', '-88/3'])
check('regression 3', solve(*([],)), [0, '0', '0', '0'])
check('regression 4', solve(*([[], [(2, 4), (2, 4)]],)), [2, '2', '4', '0'])
check('regression 5', solve(*([[(0, 3), (2, 1)], [(4, 8), (8, 0)]],)), [4, '7/2', '3', '-8'])
check("variable replicated pairs",solve([[(0,2),(2,0)]]*N),[2*N,"1","1",str(-2*N)])
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
regression 1[4, '19/4', '13/4', '-111/4'][4, '19/4', '13/4', '-111/4']Passed
regression 2[3, '11/3', '17/3', '-88/3'][3, '11/3', '17/3', '-88/3']Passed
regression 3[0, '0', '0', '0'][0, '0', '0', '0']Passed
regression 4[2, '2', '4', '0'][2, '2', '4', '0']Passed
regression 5[4, '7/2', '3', '-8'][4, '7/2', '3', '-8']Passed
variable replicated pairs[2, '1', '1', '-2'][2, '1', '1', '-2']Passed

SHA-256 / 46c71abc96f3dbf8e9a3f5c98919aac11ccc7deb073564121d49028238275542

Verification & scope

Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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:39:03.126939+00:00.

Case digest / 8cc1be1e41e3ebbabb2d19d97acab3119b2e244868ba87744841e15216ea7203