FA-44851 / Data systems / Open access
Grouping metadata mistakes real null keys for omitted dimensions · case 01
Grouping metadata mistakes real null keys for omitted dimensions.
ROOT CAUSE
grouping-set-expansion: Grouping metadata mistakes real null keys for omitted dimensions.
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: Inspecting original null keys still fails to encode omitted dimensions.
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,v in enumerate(projected) if v is None)
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', 1, 1]] | [[None, 'b', 0, 1]] | Failed |
| 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 / e47af2650d2a26c4469782c915a51b359fefe6dd4010d75ffd09e283406651c7
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,v in enumerate(keys) if v is None)
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, 0, 1]] | [['a', None, 2, 1]] | Failed |
| other dimension | [[None, 'b', 0, 1]] | [[None, 'b', 1, 1]] | Failed |
| real null key | [[None, 'b', 1, 1]] | [[None, 'b', 0, 1]] | Failed |
| grand total row | [[None, None, 0, 1]] | [[None, None, 3, 1]] | Failed |
| duplicate sets | [['a', None, 0, 1], ['a', None, 0, 1]] | [['a', None, 2, 1], ['a', None, 2, 1]] | Failed |
| duplicate facts | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | [['a', 'b', 0, 1], ['a', 'b', 0, 1]] | Passed |
| empty facts | [] | [] | Passed |
SHA-256 / 1256564aec6c0ffab2eec69d96386ef3f65e7896d1f0770b90847d98304340b0
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.295485+00:00.
Case digest / 61ccf9b74fcdb7eb23938514a1b4a8933a9d10caa932906e11fa711c0bf9da8e