FA-13291 / Numerical aggregation / Open access
Frequency lower tail sum: Repeated support rows overwrite each other before selection. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Repeated support rows overwrite each other before selection.
VERIFIED REPAIR
Preserve the frequency lower tail sum contract at the identified reduction decision.
Unsuccessful approach: Removing identical compressed rows discards their independent mass.
Case contract
Rows [integer value, nonnegative frequency] expand to a multiset. Sum its smallest min(k,total frequency) observations for nonnegative integer k; zero/empty tail sums to 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(rows, k):
rows=list(dict(rows).items())
remaining=k
out=0
for x,w in sorted(rows):
take=min(remaining,w)
out+=x*take
remaining-=take
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(2, 1), (2, 1), (9, 3)], 3)), 13)
check('regression 2', solve(*([(8, 2), (1, 3), (4, 2)], 4)), 7)
check('regression 3', solve(*([(2, 3)], 0)), 0)
check('regression 4', solve(*([], 3)), 0)
check('regression 5', solve(*([(9, 0), (2, 1)], 8)), 2)
check('regression 6', solve(*([(-5, 2), (3, 4)], 3)), -7)
check('regression 7', solve(*([(2, 1), (2, 2), (9, 1)], 2)), 4)
check('regression 8', solve(*([(1, 8), (7, 2)], 9)), 15)
check("variable tail mass",solve([(N,3),(N+5,2)],4),4*N+5)
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 | 20 | 13 | Failed |
| regression 2 | 7 | 7 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 2 | 2 | Passed |
| regression 6 | -7 | -7 | Passed |
| regression 7 | 4 | 4 | Passed |
| regression 8 | 15 | 15 | Passed |
| variable tail mass | 9 | 9 | Passed |
SHA-256 / 55b620264a7fae095fa3f654443ebfce0aeab36e6acad8299228bf4b433b52dc
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, k):
rows=list(set(rows))
remaining=k
out=0
for x,w in sorted(rows):
take=min(remaining,w)
out+=x*take
remaining-=take
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(2, 1), (2, 1), (9, 3)], 3)), 13)
check('regression 2', solve(*([(8, 2), (1, 3), (4, 2)], 4)), 7)
check('regression 3', solve(*([(2, 3)], 0)), 0)
check('regression 4', solve(*([], 3)), 0)
check('regression 5', solve(*([(9, 0), (2, 1)], 8)), 2)
check('regression 6', solve(*([(-5, 2), (3, 4)], 3)), -7)
check('regression 7', solve(*([(2, 1), (2, 2), (9, 1)], 2)), 4)
check('regression 8', solve(*([(1, 8), (7, 2)], 9)), 15)
check("variable tail mass",solve([(N,3),(N+5,2)],4),4*N+5)
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 | 20 | 13 | Failed |
| regression 2 | 7 | 7 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 2 | 2 | Passed |
| regression 6 | -7 | -7 | Passed |
| regression 7 | 4 | 4 | Passed |
| regression 8 | 15 | 15 | Passed |
| variable tail mass | 9 | 9 | Passed |
SHA-256 / 3b2bcba455468bb1995dd415007d0471f427bc2f8030cab11ea8fe401c052c3c
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, k):
remaining=k
out=0
for x,w in sorted(rows):
take=min(remaining,w)
out+=x*take
remaining-=take
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(2, 1), (2, 1), (9, 3)], 3)), 13)
check('regression 2', solve(*([(8, 2), (1, 3), (4, 2)], 4)), 7)
check('regression 3', solve(*([(2, 3)], 0)), 0)
check('regression 4', solve(*([], 3)), 0)
check('regression 5', solve(*([(9, 0), (2, 1)], 8)), 2)
check('regression 6', solve(*([(-5, 2), (3, 4)], 3)), -7)
check('regression 7', solve(*([(2, 1), (2, 2), (9, 1)], 2)), 4)
check('regression 8', solve(*([(1, 8), (7, 2)], 9)), 15)
check("variable tail mass",solve([(N,3),(N+5,2)],4),4*N+5)
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 | 13 | 13 | Passed |
| regression 2 | 7 | 7 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 2 | 2 | Passed |
| regression 6 | -7 | -7 | Passed |
| regression 7 | 4 | 4 | Passed |
| regression 8 | 15 | 15 | Passed |
| variable tail mass | 9 | 9 | Passed |
SHA-256 / 417ea1a368ee3e5d21cca4194af0275ebd8f4420b8ab532e12385aebec4c9142
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:05.376558+00:00.
Case digest / e9d96f6cb4dab51bffa275e4a585eedad79bcad54a9a4d8e1cdfc7fdb28378f2