FA-45306 / Data systems / Open access
A vector UDF omits output validity cardinality validation · case 01
A vector UDF omits output validity cardinality validation.
ROOT CAUSE
udf-vector-cardinality: A vector UDF omits output validity cardinality validation.
VERIFIED REPAIR
Preserve the stated physical representation and operation order: Execute a stipulated vector UDF result contract. For every selected batch, output length must equal selected input length, and output validity must have the same length. A malformed batch emits LENGTH_ERROR and no partial values. Valid output values use their own validity and retain selected input identities.
Unsuccessful approach: Accepting extra validity lanes violates the exact vector contract.
Case contract
Execute a stipulated vector UDF result contract. For every selected batch, output length must equal selected input length, and output validity must have the same length. A malformed batch emits LENGTH_ERROR and no partial values. Valid output values use their own validity and retain selected input identities.
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:
out=[]
for ids,selection,values,valid in d:
selected=[ids[i] for i in selection]
if len(values)!=len(selected) or False:
out.append('LENGTH_ERROR'); continue
out.append([[ident,values[i] if valid[i] else None] for i,ident in enumerate(selected)])
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('selected ids', solve([[[10, 11, 12], [2, 0], [1, 2], [True, True]]]), [[[12, 1], [10, 2]]])
check('short result', solve([[[10, 11], [0, 1], [1], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [1], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [1, 2], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [1], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 2:
check('selected ids', solve([[[10, 11, 12], [2, 0], [2, 3], [True, True]]]), [[[12, 2], [10, 3]]])
check('short result', solve([[[10, 11], [0, 1], [2], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [2], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [2, 3], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [2], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 3:
check('selected ids', solve([[[10, 11, 12], [2, 0], [3, 4], [True, True]]]), [[[12, 3], [10, 4]]])
check('short result', solve([[[10, 11], [0, 1], [3], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [3], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [3, 4], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [3], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 4:
check('selected ids', solve([[[10, 11, 12], [2, 0], [4, 5], [True, True]]]), [[[12, 4], [10, 5]]])
check('short result', solve([[[10, 11], [0, 1], [4], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [4], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [4, 5], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [4], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 5:
check('selected ids', solve([[[10, 11, 12], [2, 0], [5, 6], [True, True]]]), [[[12, 5], [10, 6]]])
check('short result', solve([[[10, 11], [0, 1], [5], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [5], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [5, 6], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [5], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
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 |
|---|---|---|---|
| selected ids | [[[12, 1], [10, 2]]] | [[[12, 1], [10, 2]]] | Passed |
| short result | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| long validity | [[[10, 1]]] | ['LENGTH_ERROR'] | Failed |
| short validity | {'representation_error': 'IndexError'} | ['LENGTH_ERROR'] | Failed |
| null output | [[[10, None]]] | [[[10, None]]] | Passed |
| empty result | [[]] | [[]] | Passed |
| no invocations | [] | [] | Passed |
SHA-256 / da0368e4dbcb463df4d8c8e286806088f8ae51144d08a8aa1586bd56351517f1
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
out=[]
for ids,selection,values,valid in d:
selected=[ids[i] for i in selection]
if len(values)!=len(selected) or len(valid)<len(selected):
out.append('LENGTH_ERROR'); continue
out.append([[ident,values[i] if valid[i] else None] for i,ident in enumerate(selected)])
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('selected ids', solve([[[10, 11, 12], [2, 0], [1, 2], [True, True]]]), [[[12, 1], [10, 2]]])
check('short result', solve([[[10, 11], [0, 1], [1], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [1], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [1, 2], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [1], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 2:
check('selected ids', solve([[[10, 11, 12], [2, 0], [2, 3], [True, True]]]), [[[12, 2], [10, 3]]])
check('short result', solve([[[10, 11], [0, 1], [2], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [2], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [2, 3], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [2], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 3:
check('selected ids', solve([[[10, 11, 12], [2, 0], [3, 4], [True, True]]]), [[[12, 3], [10, 4]]])
check('short result', solve([[[10, 11], [0, 1], [3], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [3], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [3, 4], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [3], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 4:
check('selected ids', solve([[[10, 11, 12], [2, 0], [4, 5], [True, True]]]), [[[12, 4], [10, 5]]])
check('short result', solve([[[10, 11], [0, 1], [4], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [4], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [4, 5], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [4], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 5:
check('selected ids', solve([[[10, 11, 12], [2, 0], [5, 6], [True, True]]]), [[[12, 5], [10, 6]]])
check('short result', solve([[[10, 11], [0, 1], [5], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [5], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [5, 6], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [5], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
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 |
|---|---|---|---|
| selected ids | [[[12, 1], [10, 2]]] | [[[12, 1], [10, 2]]] | Passed |
| short result | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| long validity | [[[10, 1]]] | ['LENGTH_ERROR'] | Failed |
| short validity | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| null output | [[[10, None]]] | [[[10, None]]] | Passed |
| empty result | [[]] | [[]] | Passed |
| no invocations | [] | [] | Passed |
SHA-256 / e0a4877ff2b8a74c03429e2ff055eefdae95676cc69bdc33c6d4fd18cd32b4a9
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
try:
out=[]
for ids,selection,values,valid in d:
selected=[ids[i] for i in selection]
if len(values)!=len(selected) or len(valid)!=len(selected):
out.append('LENGTH_ERROR'); continue
out.append([[ident,values[i] if valid[i] else None] for i,ident in enumerate(selected)])
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('selected ids', solve([[[10, 11, 12], [2, 0], [1, 2], [True, True]]]), [[[12, 1], [10, 2]]])
check('short result', solve([[[10, 11], [0, 1], [1], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [1], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [1, 2], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [1], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 2:
check('selected ids', solve([[[10, 11, 12], [2, 0], [2, 3], [True, True]]]), [[[12, 2], [10, 3]]])
check('short result', solve([[[10, 11], [0, 1], [2], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [2], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [2, 3], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [2], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 3:
check('selected ids', solve([[[10, 11, 12], [2, 0], [3, 4], [True, True]]]), [[[12, 3], [10, 4]]])
check('short result', solve([[[10, 11], [0, 1], [3], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [3], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [3, 4], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [3], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 4:
check('selected ids', solve([[[10, 11, 12], [2, 0], [4, 5], [True, True]]]), [[[12, 4], [10, 5]]])
check('short result', solve([[[10, 11], [0, 1], [4], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [4], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [4, 5], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [4], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
elif N == 5:
check('selected ids', solve([[[10, 11, 12], [2, 0], [5, 6], [True, True]]]), [[[12, 5], [10, 6]]])
check('short result', solve([[[10, 11], [0, 1], [5], [True, True]]]), ['LENGTH_ERROR'])
check('long validity', solve([[[10], [0], [5], [True, False]]]), ['LENGTH_ERROR'])
check('short validity', solve([[[10, 11], [0, 1], [5, 6], [True]]]), ['LENGTH_ERROR'])
check('null output', solve([[[10], [0], [5], [False]]]), [[[10, None]]])
check('empty result', solve([[[10], [], [], []]]), [[]])
check('no invocations', solve([]), [])
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 |
|---|---|---|---|
| selected ids | [[[12, 1], [10, 2]]] | [[[12, 1], [10, 2]]] | Passed |
| short result | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| long validity | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| short validity | ['LENGTH_ERROR'] | ['LENGTH_ERROR'] | Passed |
| null output | [[[10, None]]] | [[[10, None]]] | Passed |
| empty result | [[]] | [[]] | Passed |
| no invocations | [] | [] | Passed |
SHA-256 / 90f6dd0cb980d8cbf3e353c24205b0be51f5a85ae554b6c02c13b33be8cef471
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:20.847774+00:00.
Case digest / 7f39e219563a4ec4484a2960f5884d236a54f6675e76c7af737168a9d58dd20a