FAILURE MAP
← Case archive

FA-44461 / Data systems / Open access

Struct projection ignores a gathered row selection · case 01

Struct projection ignores a gathered row selection.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

struct-vector-project: Struct projection ignores a gathered row selection.

THE FAILURE

struct-vector-project: Struct projection ignores a gathered row selection.

Unsuccessful approach: Sorting selection reads the right rows in the wrong order.

Case contract

Project requested fields from a struct array. Parent validity dominates field validity, absent schema fields materialize None, selection retains row order, and projection retains requested field order.

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:
        columns,valid,parent,selection,fields=d
        out=[]
        for row in range(len(selection)):
            record=[]
            for field in fields:
                present=field in columns
                known=present and valid[field][row]
                value=columns[field][row] if present else None
                record.append(value if parent[row] and known else None)
            out.append(record)
        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('gather with field order', solve([{'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[4, 2], [3, 1]])
    check('parent hides values', solve([{'a': [1, 2]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [2]])
    check('field null lane', solve([{'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [2]])
    check('missing field', solve([{'a': [1]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[1, None]])
    check('repeated projection', solve([{'a': [1]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[1, 1]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [1]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 2:
    check('gather with field order', solve([{'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[5, 3], [4, 2]])
    check('parent hides values', solve([{'a': [2, 3]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [3]])
    check('field null lane', solve([{'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [3]])
    check('missing field', solve([{'a': [2]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[2, None]])
    check('repeated projection', solve([{'a': [2]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[2, 2]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [2]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 3:
    check('gather with field order', solve([{'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[6, 4], [5, 3]])
    check('parent hides values', solve([{'a': [3, 4]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [4]])
    check('field null lane', solve([{'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [4]])
    check('missing field', solve([{'a': [3]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[3, None]])
    check('repeated projection', solve([{'a': [3]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[3, 3]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [3]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 4:
    check('gather with field order', solve([{'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[7, 5], [6, 4]])
    check('parent hides values', solve([{'a': [4, 5]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [5]])
    check('field null lane', solve([{'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [5]])
    check('missing field', solve([{'a': [4]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[4, None]])
    check('repeated projection', solve([{'a': [4]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[4, 4]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [4]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 5:
    check('gather with field order', solve([{'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[8, 6], [7, 5]])
    check('parent hides values', solve([{'a': [5, 6]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [6]])
    check('field null lane', solve([{'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [6]])
    check('missing field', solve([{'a': [5]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[5, None]])
    check('repeated projection', solve([{'a': [5]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[5, 5]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [5]}, {'a': [True]}, [True], [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 fixtureActualExpectedOutcome
gather with field order[[3, 1], [4, 2]][[4, 2], [3, 1]]Failed
parent hides values[[None], [2]][[None], [2]]Passed
field null lane[[None], [2]][[None], [2]]Passed
missing field[[1, None]][[1, None]]Passed
repeated projection[[1, 1]][[1, 1]]Passed
empty rows[][]Passed
empty projection[[]][[]]Passed

SHA-256 / 5687597d0b370408fa2fd3445788bba971c7aa2b754f3d52febd0fb9ba3d3f49

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    try:
        columns,valid,parent,selection,fields=d
        out=[]
        for row in sorted(selection):
            record=[]
            for field in fields:
                present=field in columns
                known=present and valid[field][row]
                value=columns[field][row] if present else None
                record.append(value if parent[row] and known else None)
            out.append(record)
        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('gather with field order', solve([{'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[4, 2], [3, 1]])
    check('parent hides values', solve([{'a': [1, 2]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [2]])
    check('field null lane', solve([{'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [2]])
    check('missing field', solve([{'a': [1]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[1, None]])
    check('repeated projection', solve([{'a': [1]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[1, 1]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [1]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 2:
    check('gather with field order', solve([{'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[5, 3], [4, 2]])
    check('parent hides values', solve([{'a': [2, 3]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [3]])
    check('field null lane', solve([{'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [3]])
    check('missing field', solve([{'a': [2]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[2, None]])
    check('repeated projection', solve([{'a': [2]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[2, 2]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [2]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 3:
    check('gather with field order', solve([{'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[6, 4], [5, 3]])
    check('parent hides values', solve([{'a': [3, 4]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [4]])
    check('field null lane', solve([{'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [4]])
    check('missing field', solve([{'a': [3]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[3, None]])
    check('repeated projection', solve([{'a': [3]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[3, 3]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [3]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 4:
    check('gather with field order', solve([{'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[7, 5], [6, 4]])
    check('parent hides values', solve([{'a': [4, 5]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [5]])
    check('field null lane', solve([{'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [5]])
    check('missing field', solve([{'a': [4]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[4, None]])
    check('repeated projection', solve([{'a': [4]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[4, 4]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [4]}, {'a': [True]}, [True], [0], []]), [[]])
elif N == 5:
    check('gather with field order', solve([{'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True, True], [1, 0], ['b', 'a']]), [[8, 6], [7, 5]])
    check('parent hides values', solve([{'a': [5, 6]}, {'a': [True, True]}, [False, True], [0, 1], ['a']]), [[None], [6]])
    check('field null lane', solve([{'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1], ['a']]), [[None], [6]])
    check('missing field', solve([{'a': [5]}, {'a': [True]}, [True], [0], ['a', 'missing']]), [[5, None]])
    check('repeated projection', solve([{'a': [5]}, {'a': [True]}, [True], [0], ['a', 'a']]), [[5, 5]])
    check('empty rows', solve([{'a': []}, {'a': []}, [], [], ['a']]), [])
    check('empty projection', solve([{'a': [5]}, {'a': [True]}, [True], [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 fixtureActualExpectedOutcome
gather with field order[[3, 1], [4, 2]][[4, 2], [3, 1]]Failed
parent hides values[[None], [2]][[None], [2]]Passed
field null lane[[None], [2]][[None], [2]]Passed
missing field[[1, None]][[1, None]]Passed
repeated projection[[1, 1]][[1, 1]]Passed
empty rows[][]Passed
empty projection[[]][[]]Passed

SHA-256 / 8271d518886bc4811e423f2685ccb81cc4deed71d001d0b5c0aa6673e28c8484

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

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:12.694174+00:00.

Case digest / 582f85231020d966fc660a5ad50881d39f0e1af489b06f890c15df5b9ec376ff