FA-11361 / Spreadsheet calculation semantics / Open access
Subtotal includes nested aggregates or hidden rows · case 01
The subtotal doubles a nested subtotal or counts rows hidden by the specified mode.
ROOT CAUSE
Ordinary sum ignores row provenance and visibility.
THE FAILURE
Ordinary sum ignores row provenance and visibility.
Unsuccessful approach: Excluding every hidden row also changes mode 9, which includes manually hidden rows.
Case contract
Rows are [number,filtered,manually_hidden,is_subtotal]. Mode 9 includes manually hidden rows; mode 109 excludes them. Both exclude filtered rows and subtotal cells.
Why this case matters
This isolated spreadsheet model makes cell semantics explicit; it does not claim compatibility with every workbook engine.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, mode):
return sum(v for v,f,h,s in rows)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual hidden counted in mode nine', solve([[N,False,True,False]],9), N)
check('manual hidden omitted in mode 109', solve([[N,False,True,False]],109), 0)
check('filtered omitted in mode nine', solve([[N,True,False,False]],9), 0)
check('nested subtotal omitted', solve([[N,False,False,True]],9), 0)
check('visible ordinary cell', solve([[N,False,False,False]],109), N)
check('empty range', solve([],9), 0)
check('mixed provenance', solve([[N,False,False,False],[2*N,False,True,False],[3*N,False,False,True]],9),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 |
|---|---|---|---|
| manual hidden counted in mode nine | 1 | 1 | Passed |
| manual hidden omitted in mode 109 | 1 | 0 | Failed |
| filtered omitted in mode nine | 1 | 0 | Failed |
| nested subtotal omitted | 1 | 0 | Failed |
| visible ordinary cell | 1 | 1 | Passed |
| empty range | 0 | 0 | Passed |
| mixed provenance | 6 | 3 | Failed |
SHA-256 / 72725e6b24637e675b83c871f454aea90213a7183ae5fcc652f6605745e0efd8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, mode):
return sum(v for v,f,h,s in rows if not f and not h and not s)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual hidden counted in mode nine', solve([[N,False,True,False]],9), N)
check('manual hidden omitted in mode 109', solve([[N,False,True,False]],109), 0)
check('filtered omitted in mode nine', solve([[N,True,False,False]],9), 0)
check('nested subtotal omitted', solve([[N,False,False,True]],9), 0)
check('visible ordinary cell', solve([[N,False,False,False]],109), N)
check('empty range', solve([],9), 0)
check('mixed provenance', solve([[N,False,False,False],[2*N,False,True,False],[3*N,False,False,True]],9),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 |
|---|---|---|---|
| manual hidden counted in mode nine | 0 | 1 | Failed |
| manual hidden omitted in mode 109 | 0 | 0 | Passed |
| filtered omitted in mode nine | 0 | 0 | Passed |
| nested subtotal omitted | 0 | 0 | Passed |
| visible ordinary cell | 1 | 1 | Passed |
| empty range | 0 | 0 | Passed |
| mixed provenance | 1 | 3 | Failed |
SHA-256 / 4c5b6dfe3469a995f325f43681cb52b682f28547279064f0707b5bcc197348fa
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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:38:47.284097+00:00.
Case digest / fd630fe1ba3f8ba450bc2c3ad988f94f483360c7d17ef8b3bc307a10b50b215e