FA-44871 / Data systems / Open access
Grouping expansion carries a key instead of the fact payload · case 01
Grouping expansion carries a key instead of the fact payload.
ROOT CAUSE
grouping-set-expansion: Grouping expansion carries a key instead of the fact payload.
VERIFIED REPAIR
Preserve the stated physical representation and operation order: Expand every fact [a,b,payload] once per supplied grouping-set list of column positions. Emit [projected-a,projected-b,grouping-mask,payload], using None for omitted keys and bit 1 for omitted a, bit 2 for omitted b. Preserve duplicate grouping sets and null source keys.
Unsuccessful approach: The other dimension also cannot replace the fact payload.
Case contract
Expand every fact [a,b,payload] once per supplied grouping-set list of column positions. Emit [projected-a,projected-b,grouping-mask,payload], using None for omitted keys and bit 1 for omitted a, bit 2 for omitted b. Preserve duplicate grouping sets and null source keys.
Why this case matters
A bounded deterministic data engine model makes representation and changelog faults reproducible.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
rows,sets=d
out=[]
for group in sets:
for a,b,value in rows:
keys=[a,b]
projected=[keys[i] if i in group else None for i in range(2)]
mask=sum(1<<i for i in range(2) if i not in group)
out.append(projected+[mask,a])
return out
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('one dimension', solve([[['a', 'b', 1]], [[0]]]), [['a', None, 2, 1]])
check('other dimension', solve([[['a', 'b', 1]], [[1]]]), [[None, 'b', 1, 1]])
check('real null key', solve([[[None, 'b', 1]], [[0, 1]]]), [[None, 'b', 0, 1]])
check('grand total row', solve([[['a', 'b', 1]], [[]]]), [[None, None, 3, 1]])
check('duplicate sets', solve([[['a', 'b', 1]], [[0], [0]]]), [['a', None, 2, 1], ['a', None, 2, 1]])
check('duplicate facts', solve([[['a', 'b', 1], ['a', 'b', 1]], [[0, 1]]]), [['a', 'b', 0, 1], ['a', 'b', 0, 1]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 2:
check('one dimension', solve([[['a', 'b', 2]], [[0]]]), [['a', None, 2, 2]])
check('other dimension', solve([[['a', 'b', 2]], [[1]]]), [[None, 'b', 1, 2]])
check('real null key', solve([[[None, 'b', 2]], [[0, 1]]]), [[None, 'b', 0, 2]])
check('grand total row', solve([[['a', 'b', 2]], [[]]]), [[None, None, 3, 2]])
check('duplicate sets', solve([[['a', 'b', 2]], [[0], [0]]]), [['a', None, 2, 2], ['a', None, 2, 2]])
check('duplicate facts', solve([[['a', 'b', 2], ['a', 'b', 2]], [[0, 1]]]), [['a', 'b', 0, 2], ['a', 'b', 0, 2]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 3:
check('one dimension', solve([[['a', 'b', 3]], [[0]]]), [['a', None, 2, 3]])
check('other dimension', solve([[['a', 'b', 3]], [[1]]]), [[None, 'b', 1, 3]])
check('real null key', solve([[[None, 'b', 3]], [[0, 1]]]), [[None, 'b', 0, 3]])
check('grand total row', solve([[['a', 'b', 3]], [[]]]), [[None, None, 3, 3]])
check('duplicate sets', solve([[['a', 'b', 3]], [[0], [0]]]), [['a', None, 2, 3], ['a', None, 2, 3]])
check('duplicate facts', solve([[['a', 'b', 3], ['a', 'b', 3]], [[0, 1]]]), [['a', 'b', 0, 3], ['a', 'b', 0, 3]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 4:
check('one dimension', solve([[['a', 'b', 4]], [[0]]]), [['a', None, 2, 4]])
check('other dimension', solve([[['a', 'b', 4]], [[1]]]), [[None, 'b', 1, 4]])
check('real null key', solve([[[None, 'b', 4]], [[0, 1]]]), [[None, 'b', 0, 4]])
check('grand total row', solve([[['a', 'b', 4]], [[]]]), [[None, None, 3, 4]])
check('duplicate sets', solve([[['a', 'b', 4]], [[0], [0]]]), [['a', None, 2, 4], ['a', None, 2, 4]])
check('duplicate facts', solve([[['a', 'b', 4], ['a', 'b', 4]], [[0, 1]]]), [['a', 'b', 0, 4], ['a', 'b', 0, 4]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 5:
check('one dimension', solve([[['a', 'b', 5]], [[0]]]), [['a', None, 2, 5]])
check('other dimension', solve([[['a', 'b', 5]], [[1]]]), [[None, 'b', 1, 5]])
check('real null key', solve([[[None, 'b', 5]], [[0, 1]]]), [[None, 'b', 0, 5]])
check('grand total row', solve([[['a', 'b', 5]], [[]]]), [[None, None, 3, 5]])
check('duplicate sets', solve([[['a', 'b', 5]], [[0], [0]]]), [['a', None, 2, 5], ['a', None, 2, 5]])
check('duplicate facts', solve([[['a', 'b', 5], ['a', 'b', 5]], [[0, 1]]]), [['a', 'b', 0, 5], ['a', 'b', 0, 5]])
check('empty facts', solve([[], [[0], []]]), [])
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 |
|---|---|---|---|
| one dimension | [['a', None, 2, 'a']] | [['a', None, 2, 1]] | Failed |
| other dimension | [[None, 'b', 1, 'a']] | [[None, 'b', 1, 1]] | Failed |
| real null key | [[None, 'b', 0, None]] | [[None, 'b', 0, 1]] | Failed |
| grand total row | [[None, None, 3, 'a']] | [[None, None, 3, 1]] | Failed |
| duplicate sets | [['a', None, 2, 'a'], ['a', None, 2, 'a']] | [['a', None, 2, 1], ['a', None, 2, 1]] | Failed |
| duplicate facts | [['a', 'b', 0, 'a'], ['a', 'b', 0, 'a']] | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | Failed |
| empty facts | [] | [] | Passed |
SHA-256 / 22297d6c8b123b3fb5fdb334f5cd79de3863190cf158ce81795f20afc54ed911
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
rows,sets=d
out=[]
for group in sets:
for a,b,value in rows:
keys=[a,b]
projected=[keys[i] if i in group else None for i in range(2)]
mask=sum(1<<i for i in range(2) if i not in group)
out.append(projected+[mask,b])
return out
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('one dimension', solve([[['a', 'b', 1]], [[0]]]), [['a', None, 2, 1]])
check('other dimension', solve([[['a', 'b', 1]], [[1]]]), [[None, 'b', 1, 1]])
check('real null key', solve([[[None, 'b', 1]], [[0, 1]]]), [[None, 'b', 0, 1]])
check('grand total row', solve([[['a', 'b', 1]], [[]]]), [[None, None, 3, 1]])
check('duplicate sets', solve([[['a', 'b', 1]], [[0], [0]]]), [['a', None, 2, 1], ['a', None, 2, 1]])
check('duplicate facts', solve([[['a', 'b', 1], ['a', 'b', 1]], [[0, 1]]]), [['a', 'b', 0, 1], ['a', 'b', 0, 1]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 2:
check('one dimension', solve([[['a', 'b', 2]], [[0]]]), [['a', None, 2, 2]])
check('other dimension', solve([[['a', 'b', 2]], [[1]]]), [[None, 'b', 1, 2]])
check('real null key', solve([[[None, 'b', 2]], [[0, 1]]]), [[None, 'b', 0, 2]])
check('grand total row', solve([[['a', 'b', 2]], [[]]]), [[None, None, 3, 2]])
check('duplicate sets', solve([[['a', 'b', 2]], [[0], [0]]]), [['a', None, 2, 2], ['a', None, 2, 2]])
check('duplicate facts', solve([[['a', 'b', 2], ['a', 'b', 2]], [[0, 1]]]), [['a', 'b', 0, 2], ['a', 'b', 0, 2]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 3:
check('one dimension', solve([[['a', 'b', 3]], [[0]]]), [['a', None, 2, 3]])
check('other dimension', solve([[['a', 'b', 3]], [[1]]]), [[None, 'b', 1, 3]])
check('real null key', solve([[[None, 'b', 3]], [[0, 1]]]), [[None, 'b', 0, 3]])
check('grand total row', solve([[['a', 'b', 3]], [[]]]), [[None, None, 3, 3]])
check('duplicate sets', solve([[['a', 'b', 3]], [[0], [0]]]), [['a', None, 2, 3], ['a', None, 2, 3]])
check('duplicate facts', solve([[['a', 'b', 3], ['a', 'b', 3]], [[0, 1]]]), [['a', 'b', 0, 3], ['a', 'b', 0, 3]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 4:
check('one dimension', solve([[['a', 'b', 4]], [[0]]]), [['a', None, 2, 4]])
check('other dimension', solve([[['a', 'b', 4]], [[1]]]), [[None, 'b', 1, 4]])
check('real null key', solve([[[None, 'b', 4]], [[0, 1]]]), [[None, 'b', 0, 4]])
check('grand total row', solve([[['a', 'b', 4]], [[]]]), [[None, None, 3, 4]])
check('duplicate sets', solve([[['a', 'b', 4]], [[0], [0]]]), [['a', None, 2, 4], ['a', None, 2, 4]])
check('duplicate facts', solve([[['a', 'b', 4], ['a', 'b', 4]], [[0, 1]]]), [['a', 'b', 0, 4], ['a', 'b', 0, 4]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 5:
check('one dimension', solve([[['a', 'b', 5]], [[0]]]), [['a', None, 2, 5]])
check('other dimension', solve([[['a', 'b', 5]], [[1]]]), [[None, 'b', 1, 5]])
check('real null key', solve([[[None, 'b', 5]], [[0, 1]]]), [[None, 'b', 0, 5]])
check('grand total row', solve([[['a', 'b', 5]], [[]]]), [[None, None, 3, 5]])
check('duplicate sets', solve([[['a', 'b', 5]], [[0], [0]]]), [['a', None, 2, 5], ['a', None, 2, 5]])
check('duplicate facts', solve([[['a', 'b', 5], ['a', 'b', 5]], [[0, 1]]]), [['a', 'b', 0, 5], ['a', 'b', 0, 5]])
check('empty facts', solve([[], [[0], []]]), [])
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 |
|---|---|---|---|
| one dimension | [['a', None, 2, 'b']] | [['a', None, 2, 1]] | Failed |
| other dimension | [[None, 'b', 1, 'b']] | [[None, 'b', 1, 1]] | Failed |
| real null key | [[None, 'b', 0, 'b']] | [[None, 'b', 0, 1]] | Failed |
| grand total row | [[None, None, 3, 'b']] | [[None, None, 3, 1]] | Failed |
| duplicate sets | [['a', None, 2, 'b'], ['a', None, 2, 'b']] | [['a', None, 2, 1], ['a', None, 2, 1]] | Failed |
| duplicate facts | [['a', 'b', 0, 'b'], ['a', 'b', 0, 'b']] | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | Failed |
| empty facts | [] | [] | Passed |
SHA-256 / f3d9d50fab3f6ad64957db9de5e1509ba5871a2247179bd83eaa8077954d463f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
rows,sets=d
out=[]
for group in sets:
for a,b,value in rows:
keys=[a,b]
projected=[keys[i] if i in group else None for i in range(2)]
mask=sum(1<<i for i in range(2) if i not in group)
out.append(projected+[mask,value])
return out
except (IndexError, KeyError, ValueError, StopIteration) as exc:
return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('one dimension', solve([[['a', 'b', 1]], [[0]]]), [['a', None, 2, 1]])
check('other dimension', solve([[['a', 'b', 1]], [[1]]]), [[None, 'b', 1, 1]])
check('real null key', solve([[[None, 'b', 1]], [[0, 1]]]), [[None, 'b', 0, 1]])
check('grand total row', solve([[['a', 'b', 1]], [[]]]), [[None, None, 3, 1]])
check('duplicate sets', solve([[['a', 'b', 1]], [[0], [0]]]), [['a', None, 2, 1], ['a', None, 2, 1]])
check('duplicate facts', solve([[['a', 'b', 1], ['a', 'b', 1]], [[0, 1]]]), [['a', 'b', 0, 1], ['a', 'b', 0, 1]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 2:
check('one dimension', solve([[['a', 'b', 2]], [[0]]]), [['a', None, 2, 2]])
check('other dimension', solve([[['a', 'b', 2]], [[1]]]), [[None, 'b', 1, 2]])
check('real null key', solve([[[None, 'b', 2]], [[0, 1]]]), [[None, 'b', 0, 2]])
check('grand total row', solve([[['a', 'b', 2]], [[]]]), [[None, None, 3, 2]])
check('duplicate sets', solve([[['a', 'b', 2]], [[0], [0]]]), [['a', None, 2, 2], ['a', None, 2, 2]])
check('duplicate facts', solve([[['a', 'b', 2], ['a', 'b', 2]], [[0, 1]]]), [['a', 'b', 0, 2], ['a', 'b', 0, 2]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 3:
check('one dimension', solve([[['a', 'b', 3]], [[0]]]), [['a', None, 2, 3]])
check('other dimension', solve([[['a', 'b', 3]], [[1]]]), [[None, 'b', 1, 3]])
check('real null key', solve([[[None, 'b', 3]], [[0, 1]]]), [[None, 'b', 0, 3]])
check('grand total row', solve([[['a', 'b', 3]], [[]]]), [[None, None, 3, 3]])
check('duplicate sets', solve([[['a', 'b', 3]], [[0], [0]]]), [['a', None, 2, 3], ['a', None, 2, 3]])
check('duplicate facts', solve([[['a', 'b', 3], ['a', 'b', 3]], [[0, 1]]]), [['a', 'b', 0, 3], ['a', 'b', 0, 3]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 4:
check('one dimension', solve([[['a', 'b', 4]], [[0]]]), [['a', None, 2, 4]])
check('other dimension', solve([[['a', 'b', 4]], [[1]]]), [[None, 'b', 1, 4]])
check('real null key', solve([[[None, 'b', 4]], [[0, 1]]]), [[None, 'b', 0, 4]])
check('grand total row', solve([[['a', 'b', 4]], [[]]]), [[None, None, 3, 4]])
check('duplicate sets', solve([[['a', 'b', 4]], [[0], [0]]]), [['a', None, 2, 4], ['a', None, 2, 4]])
check('duplicate facts', solve([[['a', 'b', 4], ['a', 'b', 4]], [[0, 1]]]), [['a', 'b', 0, 4], ['a', 'b', 0, 4]])
check('empty facts', solve([[], [[0], []]]), [])
elif N == 5:
check('one dimension', solve([[['a', 'b', 5]], [[0]]]), [['a', None, 2, 5]])
check('other dimension', solve([[['a', 'b', 5]], [[1]]]), [[None, 'b', 1, 5]])
check('real null key', solve([[[None, 'b', 5]], [[0, 1]]]), [[None, 'b', 0, 5]])
check('grand total row', solve([[['a', 'b', 5]], [[]]]), [[None, None, 3, 5]])
check('duplicate sets', solve([[['a', 'b', 5]], [[0], [0]]]), [['a', None, 2, 5], ['a', None, 2, 5]])
check('duplicate facts', solve([[['a', 'b', 5], ['a', 'b', 5]], [[0, 1]]]), [['a', 'b', 0, 5], ['a', 'b', 0, 5]])
check('empty facts', solve([[], [[0], []]]), [])
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 |
|---|---|---|---|
| one dimension | [['a', None, 2, 1]] | [['a', None, 2, 1]] | Passed |
| other dimension | [[None, 'b', 1, 1]] | [[None, 'b', 1, 1]] | Passed |
| real null key | [[None, 'b', 0, 1]] | [[None, 'b', 0, 1]] | Passed |
| grand total row | [[None, None, 3, 1]] | [[None, None, 3, 1]] | Passed |
| duplicate sets | [['a', None, 2, 1], ['a', None, 2, 1]] | [['a', None, 2, 1], ['a', None, 2, 1]] | Passed |
| duplicate facts | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | Passed |
| empty facts | [] | [] | Passed |
SHA-256 / bc39a0d1d21e843a73137e68f902c3168737ea2219ee433664e6490bf836de28
Verification & scope
Offline stipulated semantics over valid small inputs; no performance, concurrency, or production-engine 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:44:16.526443+00:00.
Case digest / 6e8ca02bbe9a99cb01b999fdc095ea5b03bd572352acaf3a97e0f4d58131cf51