FA-13181 / Numerical aggregation / Open access
Maximum subarray block summary: Extending a prefix uses the old suffix instead of the whole old total. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Extending a prefix uses the old suffix instead of the whole old total.
VERIFIED REPAIR
Preserve the maximum subarray block summary contract at the identified reduction decision.
Unsuccessful approach: The old best subarray also need not begin at the global left edge.
Case contract
Merge ordered disjoint integer blocks, preserving concatenation order. Return [total, maximum prefix sum, maximum suffix sum, maximum contiguous subarray sum]; empty subarrays are allowed and have sum 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):
total=prefix=suffix=best=0
for block in blocks:
t=sum(block)
p=max([0]+[sum(block[:i]) for i in range(1,len(block)+1)])
s=max([0]+[sum(block[i:]) for i in range(len(block))])
b=max([0]+[sum(block[i:j]) for i in range(len(block)) for j in range(i+1,len(block)+1)])
new_best=max(best,b,suffix+p)
new_prefix=max(prefix,suffix+p)
new_suffix=max(s,suffix+t)
total=total+t
prefix,suffix,best=new_prefix,new_suffix,new_best
return [total,prefix,suffix,best]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[-100, 5]],)), [-95, 0, 5, 5])
check('regression 2', solve(*([[2, -7, 4], [3, -1]],)), [1, 2, 6, 7])
check('regression 3', solve(*([[-8, -2], [-3]],)), [-13, 0, 0, 0])
check('regression 4', solve(*([],)), [0, 0, 0, 0])
check('regression 5', solve(*([[4, -2], [], [3, -9, 6]],)), [2, 5, 6, 6])
check('regression 6', solve(*([[-2, 7], [-3, 5, -9], [2]],)), [0, 7, 2, 9])
check('regression 7', solve(*([[8, -9], [1, -4, 9]],)), [5, 8, 9, 9])
check('regression 8', solve(*([[1, 2], [3, 4]],)), [10, 10, 10, 10])
check("variable cross block peak",solve([[-N,2*N],[N,-4*N]]),[-2*N,2*N,0,3*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 | [-95, 0, 5, 5] | [-95, 0, 5, 5] | Passed |
| regression 2 | [1, 7, 6, 7] | [1, 2, 6, 7] | Failed |
| regression 3 | [-13, 0, 0, 0] | [-13, 0, 0, 0] | Passed |
| regression 4 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 5 | [2, 5, 6, 6] | [2, 5, 6, 6] | Passed |
| regression 6 | [0, 9, 2, 9] | [0, 7, 2, 9] | Failed |
| regression 7 | [5, 8, 9, 9] | [5, 8, 9, 9] | Passed |
| regression 8 | [10, 10, 10, 10] | [10, 10, 10, 10] | Passed |
| variable cross block peak | [-2, 3, 0, 3] | [-2, 2, 0, 3] | Failed |
SHA-256 / 544ad760e2f5bf80dd54a0f34845cc4edc33862da14a41b4161d8619481cdee4
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):
total=prefix=suffix=best=0
for block in blocks:
t=sum(block)
p=max([0]+[sum(block[:i]) for i in range(1,len(block)+1)])
s=max([0]+[sum(block[i:]) for i in range(len(block))])
b=max([0]+[sum(block[i:j]) for i in range(len(block)) for j in range(i+1,len(block)+1)])
new_best=max(best,b,suffix+p)
new_prefix=max(prefix,best+p)
new_suffix=max(s,suffix+t)
total=total+t
prefix,suffix,best=new_prefix,new_suffix,new_best
return [total,prefix,suffix,best]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[-100, 5]],)), [-95, 0, 5, 5])
check('regression 2', solve(*([[2, -7, 4], [3, -1]],)), [1, 2, 6, 7])
check('regression 3', solve(*([[-8, -2], [-3]],)), [-13, 0, 0, 0])
check('regression 4', solve(*([],)), [0, 0, 0, 0])
check('regression 5', solve(*([[4, -2], [], [3, -9, 6]],)), [2, 5, 6, 6])
check('regression 6', solve(*([[-2, 7], [-3, 5, -9], [2]],)), [0, 7, 2, 9])
check('regression 7', solve(*([[8, -9], [1, -4, 9]],)), [5, 8, 9, 9])
check('regression 8', solve(*([[1, 2], [3, 4]],)), [10, 10, 10, 10])
check("variable cross block peak",solve([[-N,2*N],[N,-4*N]]),[-2*N,2*N,0,3*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 | [-95, 0, 5, 5] | [-95, 0, 5, 5] | Passed |
| regression 2 | [1, 7, 6, 7] | [1, 2, 6, 7] | Failed |
| regression 3 | [-13, 0, 0, 0] | [-13, 0, 0, 0] | Passed |
| regression 4 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 5 | [2, 7, 6, 6] | [2, 5, 6, 6] | Failed |
| regression 6 | [0, 11, 2, 9] | [0, 7, 2, 9] | Failed |
| regression 7 | [5, 14, 9, 9] | [5, 8, 9, 9] | Failed |
| regression 8 | [10, 10, 10, 10] | [10, 10, 10, 10] | Passed |
| variable cross block peak | [-2, 3, 0, 3] | [-2, 2, 0, 3] | Failed |
SHA-256 / 3fe43f6f9cb6eeb0b73c52ede49042051b34b7af37437644f71442e2c47e05fe
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):
total=prefix=suffix=best=0
for block in blocks:
t=sum(block)
p=max([0]+[sum(block[:i]) for i in range(1,len(block)+1)])
s=max([0]+[sum(block[i:]) for i in range(len(block))])
b=max([0]+[sum(block[i:j]) for i in range(len(block)) for j in range(i+1,len(block)+1)])
new_best=max(best,b,suffix+p)
new_prefix=max(prefix,total+p)
new_suffix=max(s,suffix+t)
total=total+t
prefix,suffix,best=new_prefix,new_suffix,new_best
return [total,prefix,suffix,best]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[-100, 5]],)), [-95, 0, 5, 5])
check('regression 2', solve(*([[2, -7, 4], [3, -1]],)), [1, 2, 6, 7])
check('regression 3', solve(*([[-8, -2], [-3]],)), [-13, 0, 0, 0])
check('regression 4', solve(*([],)), [0, 0, 0, 0])
check('regression 5', solve(*([[4, -2], [], [3, -9, 6]],)), [2, 5, 6, 6])
check('regression 6', solve(*([[-2, 7], [-3, 5, -9], [2]],)), [0, 7, 2, 9])
check('regression 7', solve(*([[8, -9], [1, -4, 9]],)), [5, 8, 9, 9])
check('regression 8', solve(*([[1, 2], [3, 4]],)), [10, 10, 10, 10])
check("variable cross block peak",solve([[-N,2*N],[N,-4*N]]),[-2*N,2*N,0,3*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 | [-95, 0, 5, 5] | [-95, 0, 5, 5] | Passed |
| regression 2 | [1, 2, 6, 7] | [1, 2, 6, 7] | Passed |
| regression 3 | [-13, 0, 0, 0] | [-13, 0, 0, 0] | Passed |
| regression 4 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 5 | [2, 5, 6, 6] | [2, 5, 6, 6] | Passed |
| regression 6 | [0, 7, 2, 9] | [0, 7, 2, 9] | Passed |
| regression 7 | [5, 8, 9, 9] | [5, 8, 9, 9] | Passed |
| regression 8 | [10, 10, 10, 10] | [10, 10, 10, 10] | Passed |
| variable cross block peak | [-2, 2, 0, 3] | [-2, 2, 0, 3] | Passed |
SHA-256 / e4797b1147c92336e8b898e2f3d32f1b5c7446b40369599781886673d584e95d
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:04.367394+00:00.
Case digest / b9205e8a687ccfc8d5deb539e14d5ad0a9844146e2e5bd4d1cdbc7312613194d