FA-13246 / Numerical aggregation / Open access
Positive run block summary: A nonpositive item leaves the local run counter intact. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
A nonpositive item leaves the local run counter intact.
VERIFIED REPAIR
Preserve the positive run block summary contract at the identified reduction decision.
Unsuccessful approach: Decrementing instead of resetting bridges nonpositive gaps.
Case contract
Return [item count, positive prefix length, positive suffix length, longest strictly positive contiguous run] over ordered integer blocks. Empty blocks are identity, zero breaks a run.
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=0
previous=None
prefix=suffix=best=0
all_positive=True
for block in blocks:
k=len(block)
p=next((i for i,x in enumerate(block) if x<=0),k)
s=next((i for i,x in enumerate(reversed(block)) if x<=0),k)
local=run=0
for x in block:
run=run+1 if x>0 else run
local=max(local,run)
best=max(best,local,suffix+p)
if all_positive: prefix+=p
suffix=suffix+k if s==k else s
all_positive=all_positive and p==k
total+=k
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(*([[1, 1, 0, 1, 1, 0]],)), [6, 2, 0, 2])
check('regression 2', solve(*([[1, 0, 1, 0, 1, 1, 0]],)), [7, 1, 0, 2])
check('regression 3', solve(*([[1, 2], [3, 0, 4]],)), [5, 3, 1, 3])
check('regression 4', solve(*([[1, 0, 2], [3, 4, -1, 5]],)), [7, 1, 1, 3])
check('regression 5', solve(*([],)), [0, 0, 0, 0])
check('regression 6', solve(*([[], [0, 0], []],)), [2, 0, 0, 0])
check('regression 7', solve(*([[1, 2], [], [3, 4]],)), [4, 4, 4, 4])
check('regression 8', solve(*([[-1, 2, 3], [4, -1], [-2, 1]],)), [7, 0, 1, 3])
check('regression 9', solve(*([[0], [1, 1, 1], [1, 0]],)), [6, 0, 0, 4])
check("variable positive run",solve([[1]*N,[2]*N+[0]]),[2*N+1,2*N,0,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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [6, 2, 0, 4] | [6, 2, 0, 2] | Failed |
| regression 2 | [7, 1, 0, 4] | [7, 1, 0, 2] | Failed |
| regression 3 | [5, 3, 1, 3] | [5, 3, 1, 3] | Passed |
| regression 4 | [7, 1, 1, 3] | [7, 1, 1, 3] | Passed |
| regression 5 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 6 | [2, 0, 0, 0] | [2, 0, 0, 0] | Passed |
| regression 7 | [4, 4, 4, 4] | [4, 4, 4, 4] | Passed |
| regression 8 | [7, 0, 1, 3] | [7, 0, 1, 3] | Passed |
| regression 9 | [6, 0, 0, 4] | [6, 0, 0, 4] | Passed |
| variable positive run | [3, 2, 0, 2] | [3, 2, 0, 2] | Passed |
SHA-256 / 62f8ab880c8c2f7e9dc8cedbc8f17fce0bd8ecb810dbbdb7f197d253ec9ef857
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=0
previous=None
prefix=suffix=best=0
all_positive=True
for block in blocks:
k=len(block)
p=next((i for i,x in enumerate(block) if x<=0),k)
s=next((i for i,x in enumerate(reversed(block)) if x<=0),k)
local=run=0
for x in block:
run=run+1 if x>0 else max(0,run-1)
local=max(local,run)
best=max(best,local,suffix+p)
if all_positive: prefix+=p
suffix=suffix+k if s==k else s
all_positive=all_positive and p==k
total+=k
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(*([[1, 1, 0, 1, 1, 0]],)), [6, 2, 0, 2])
check('regression 2', solve(*([[1, 0, 1, 0, 1, 1, 0]],)), [7, 1, 0, 2])
check('regression 3', solve(*([[1, 2], [3, 0, 4]],)), [5, 3, 1, 3])
check('regression 4', solve(*([[1, 0, 2], [3, 4, -1, 5]],)), [7, 1, 1, 3])
check('regression 5', solve(*([],)), [0, 0, 0, 0])
check('regression 6', solve(*([[], [0, 0], []],)), [2, 0, 0, 0])
check('regression 7', solve(*([[1, 2], [], [3, 4]],)), [4, 4, 4, 4])
check('regression 8', solve(*([[-1, 2, 3], [4, -1], [-2, 1]],)), [7, 0, 1, 3])
check('regression 9', solve(*([[0], [1, 1, 1], [1, 0]],)), [6, 0, 0, 4])
check("variable positive run",solve([[1]*N,[2]*N+[0]]),[2*N+1,2*N,0,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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [6, 2, 0, 3] | [6, 2, 0, 2] | Failed |
| regression 2 | [7, 1, 0, 2] | [7, 1, 0, 2] | Passed |
| regression 3 | [5, 3, 1, 3] | [5, 3, 1, 3] | Passed |
| regression 4 | [7, 1, 1, 3] | [7, 1, 1, 3] | Passed |
| regression 5 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 6 | [2, 0, 0, 0] | [2, 0, 0, 0] | Passed |
| regression 7 | [4, 4, 4, 4] | [4, 4, 4, 4] | Passed |
| regression 8 | [7, 0, 1, 3] | [7, 0, 1, 3] | Passed |
| regression 9 | [6, 0, 0, 4] | [6, 0, 0, 4] | Passed |
| variable positive run | [3, 2, 0, 2] | [3, 2, 0, 2] | Passed |
SHA-256 / e97870a502ae99e3e30bba31264958298bc0d22b0a8b0105409eb641c28d7870
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=0
previous=None
prefix=suffix=best=0
all_positive=True
for block in blocks:
k=len(block)
p=next((i for i,x in enumerate(block) if x<=0),k)
s=next((i for i,x in enumerate(reversed(block)) if x<=0),k)
local=run=0
for x in block:
run=run+1 if x>0 else 0
local=max(local,run)
best=max(best,local,suffix+p)
if all_positive: prefix+=p
suffix=suffix+k if s==k else s
all_positive=all_positive and p==k
total+=k
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(*([[1, 1, 0, 1, 1, 0]],)), [6, 2, 0, 2])
check('regression 2', solve(*([[1, 0, 1, 0, 1, 1, 0]],)), [7, 1, 0, 2])
check('regression 3', solve(*([[1, 2], [3, 0, 4]],)), [5, 3, 1, 3])
check('regression 4', solve(*([[1, 0, 2], [3, 4, -1, 5]],)), [7, 1, 1, 3])
check('regression 5', solve(*([],)), [0, 0, 0, 0])
check('regression 6', solve(*([[], [0, 0], []],)), [2, 0, 0, 0])
check('regression 7', solve(*([[1, 2], [], [3, 4]],)), [4, 4, 4, 4])
check('regression 8', solve(*([[-1, 2, 3], [4, -1], [-2, 1]],)), [7, 0, 1, 3])
check('regression 9', solve(*([[0], [1, 1, 1], [1, 0]],)), [6, 0, 0, 4])
check("variable positive run",solve([[1]*N,[2]*N+[0]]),[2*N+1,2*N,0,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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | [6, 2, 0, 2] | [6, 2, 0, 2] | Passed |
| regression 2 | [7, 1, 0, 2] | [7, 1, 0, 2] | Passed |
| regression 3 | [5, 3, 1, 3] | [5, 3, 1, 3] | Passed |
| regression 4 | [7, 1, 1, 3] | [7, 1, 1, 3] | Passed |
| regression 5 | [0, 0, 0, 0] | [0, 0, 0, 0] | Passed |
| regression 6 | [2, 0, 0, 0] | [2, 0, 0, 0] | Passed |
| regression 7 | [4, 4, 4, 4] | [4, 4, 4, 4] | Passed |
| regression 8 | [7, 0, 1, 3] | [7, 0, 1, 3] | Passed |
| regression 9 | [6, 0, 0, 4] | [6, 0, 0, 4] | Passed |
| variable positive run | [3, 2, 0, 2] | [3, 2, 0, 2] | Passed |
SHA-256 / dd6d50270aaa436369bc50b1b751995ab08b42b558a8b268f92e74559b1aba29
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.039121+00:00.
Case digest / c61b92ad603fa01e239f606ce210a6984a3669699018bbed9e777a222c69ab63