FA-14161 / Numerical aggregation / Open access
Jointly observed pair summary: Paired count uses all original rows. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Paired count uses all original rows.
VERIFIED REPAIR
Preserve the jointly observed pair summary contract at the identified reduction decision.
Unsuccessful approach: Counting observed x values admits rows whose y value is missing.
Case contract
Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.
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(rows):
pairs=[(x,y) for x,y in rows if x is not None and y is not None]
return [len(rows),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [4, 1, 6, 2, 17] | [2, 1, 6, 2, 17] | Failed |
| regression 2 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| regression 3 | [1, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Failed |
| regression 4 | [3, 2, 2, -10, 50] | [3, 2, 2, -10, 50] | Passed |
| regression 5 | [3, 6, 6, 18, 0] | [2, 6, 6, 18, 0] | Failed |
| regression 6 | [2, 2, 2, 0, 8] | [2, 2, 2, 0, 8] | Passed |
| regression 7 | [2, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Failed |
| variable complete pair | [3, 1, 3, 2, 2] | [2, 1, 3, 2, 2] | Failed |
SHA-256 / 0435ebe1bb93a4816d42f5062b2df2cdb4dbd64df4a783191e950aa54192610e
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(rows):
pairs=[(x,y) for x,y in rows if x is not None and y is not None]
return [sum(x is not None for x,y in rows),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [3, 1, 6, 2, 17] | [2, 1, 6, 2, 17] | Failed |
| regression 2 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| regression 3 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| regression 4 | [3, 2, 2, -10, 50] | [3, 2, 2, -10, 50] | Passed |
| regression 5 | [2, 6, 6, 18, 0] | [2, 6, 6, 18, 0] | Passed |
| regression 6 | [2, 2, 2, 0, 8] | [2, 2, 2, 0, 8] | Passed |
| regression 7 | [1, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Failed |
| variable complete pair | [2, 1, 3, 2, 2] | [2, 1, 3, 2, 2] | Passed |
SHA-256 / 7c020cecd3a9c2c55b9d3b58662659fb5d5ca617d263827ab2ede8569a93ca9e
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(rows):
pairs=[(x,y) for x,y in rows if x is not None and y is not None]
return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [2, 1, 6, 2, 17] | [2, 1, 6, 2, 17] | Passed |
| regression 2 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| regression 3 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| regression 4 | [3, 2, 2, -10, 50] | [3, 2, 2, -10, 50] | Passed |
| regression 5 | [2, 6, 6, 18, 0] | [2, 6, 6, 18, 0] | Passed |
| regression 6 | [2, 2, 2, 0, 8] | [2, 2, 2, 0, 8] | Passed |
| regression 7 | [0, 0, 0, 0, 0] | [0, 0, 0, 0, 0] | Passed |
| variable complete pair | [2, 1, 3, 2, 2] | [2, 1, 3, 2, 2] | Passed |
SHA-256 / 60c442955b5ed4ca674217effef5b7c2d93fe8155f1f2af49686d10e0ebe6143
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:14.164340+00:00.
Case digest / 05938a1d5c68ee6996a804f25ad60797e6be3a881c529a55e7d597fbe2c8ab9a