FAILURE MAP
← Case archive

FA-44791 / Data systems / Open access

Lateral execution reuses the first outer row correlation key · case 01

Lateral execution reuses the first outer row correlation key.

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

ROOT CAUSE

lateral-binding-frames: Lateral execution reuses the first outer row correlation key.

VERIFIED REPAIR

Preserve the stated physical representation and operation order: For each outer [id,key] row, evaluate matching [key,value] inner rows with a minimum supplied by that outer row. Emit [id,value] in source order, preserving duplicate inner matches. Empty matches emit [id,None] under outer lateral semantics.

Unsuccessful approach: Capturing the final key still binds all invocations to one outer row.

Case contract

For each outer [id,key] row, evaluate matching [key,value] inner rows with a minimum supplied by that outer row. Emit [id,value] in source order, preserving duplicate inner matches. Empty matches emit [id,None] under outer lateral semantics.

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:
        outer,inner=d
        result=[]
        for ident,key,minimum in [(i,outer[0][1],m) for i,k,m in outer]:
            matches=[value for k,value in inner if key is not None and k==key and value>=minimum]
            if not matches: result.append([ident,None])
            for value in matches:
                result.append([ident,value])
        return result
    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('per-row bindings', solve([[[10, 'a', 1], [11, 'b', 3]], [['a', 2], ['b', 2], ['b', 4]]]), [[10, 2], [11, 4]])
    check('same key different parameter', solve([[[10, 'a', 1], [11, 'a', 3]], [['a', 2], ['a', 4]]]), [[10, 2], [10, 4], [11, 4]])
    check('null key', solve([[[10, None, 1]], [[None, 2]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 1]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 1]], [['a', 1], ['a', 1]]]), [[10, 1], [10, 1]])
    check('empty outer', solve([[], [['a', 1]]]), [])
    check('unmatched key', solve([[[10, 'z', 1]], [['a', 2]]]), [[10, None]])
elif N == 2:
    check('per-row bindings', solve([[[10, 'a', 2], [11, 'b', 4]], [['a', 3], ['b', 3], ['b', 5]]]), [[10, 3], [11, 5]])
    check('same key different parameter', solve([[[10, 'a', 2], [11, 'a', 4]], [['a', 3], ['a', 5]]]), [[10, 3], [10, 5], [11, 5]])
    check('null key', solve([[[10, None, 2]], [[None, 3]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 2]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 2]], [['a', 2], ['a', 2]]]), [[10, 2], [10, 2]])
    check('empty outer', solve([[], [['a', 2]]]), [])
    check('unmatched key', solve([[[10, 'z', 2]], [['a', 3]]]), [[10, None]])
elif N == 3:
    check('per-row bindings', solve([[[10, 'a', 3], [11, 'b', 5]], [['a', 4], ['b', 4], ['b', 6]]]), [[10, 4], [11, 6]])
    check('same key different parameter', solve([[[10, 'a', 3], [11, 'a', 5]], [['a', 4], ['a', 6]]]), [[10, 4], [10, 6], [11, 6]])
    check('null key', solve([[[10, None, 3]], [[None, 4]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 3]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 3]], [['a', 3], ['a', 3]]]), [[10, 3], [10, 3]])
    check('empty outer', solve([[], [['a', 3]]]), [])
    check('unmatched key', solve([[[10, 'z', 3]], [['a', 4]]]), [[10, None]])
elif N == 4:
    check('per-row bindings', solve([[[10, 'a', 4], [11, 'b', 6]], [['a', 5], ['b', 5], ['b', 7]]]), [[10, 5], [11, 7]])
    check('same key different parameter', solve([[[10, 'a', 4], [11, 'a', 6]], [['a', 5], ['a', 7]]]), [[10, 5], [10, 7], [11, 7]])
    check('null key', solve([[[10, None, 4]], [[None, 5]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 4]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 4]], [['a', 4], ['a', 4]]]), [[10, 4], [10, 4]])
    check('empty outer', solve([[], [['a', 4]]]), [])
    check('unmatched key', solve([[[10, 'z', 4]], [['a', 5]]]), [[10, None]])
elif N == 5:
    check('per-row bindings', solve([[[10, 'a', 5], [11, 'b', 7]], [['a', 6], ['b', 6], ['b', 8]]]), [[10, 6], [11, 8]])
    check('same key different parameter', solve([[[10, 'a', 5], [11, 'a', 7]], [['a', 6], ['a', 8]]]), [[10, 6], [10, 8], [11, 8]])
    check('null key', solve([[[10, None, 5]], [[None, 6]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 5]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 5]], [['a', 5], ['a', 5]]]), [[10, 5], [10, 5]])
    check('empty outer', solve([[], [['a', 5]]]), [])
    check('unmatched key', solve([[[10, 'z', 5]], [['a', 6]]]), [[10, None]])
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
per-row bindings[[10, 2], [11, None]][[10, 2], [11, 4]]Failed
same key different parameter[[10, 2], [10, 4], [11, 4]][[10, 2], [10, 4], [11, 4]]Passed
null key[[10, None]][[10, None]]Passed
empty inner[[10, None]][[10, None]]Passed
duplicate inner[[10, 1], [10, 1]][[10, 1], [10, 1]]Passed
empty outer[][]Passed
unmatched key[[10, None]][[10, None]]Passed

SHA-256 / 7125ec6a04c9ab65d324d1e2079f57f70bb5f882fa626527ef427a395c9e7977

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        outer,inner=d
        result=[]
        for ident,key,minimum in [(i,outer[-1][1],m) for i,k,m in outer]:
            matches=[value for k,value in inner if key is not None and k==key and value>=minimum]
            if not matches: result.append([ident,None])
            for value in matches:
                result.append([ident,value])
        return result
    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('per-row bindings', solve([[[10, 'a', 1], [11, 'b', 3]], [['a', 2], ['b', 2], ['b', 4]]]), [[10, 2], [11, 4]])
    check('same key different parameter', solve([[[10, 'a', 1], [11, 'a', 3]], [['a', 2], ['a', 4]]]), [[10, 2], [10, 4], [11, 4]])
    check('null key', solve([[[10, None, 1]], [[None, 2]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 1]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 1]], [['a', 1], ['a', 1]]]), [[10, 1], [10, 1]])
    check('empty outer', solve([[], [['a', 1]]]), [])
    check('unmatched key', solve([[[10, 'z', 1]], [['a', 2]]]), [[10, None]])
elif N == 2:
    check('per-row bindings', solve([[[10, 'a', 2], [11, 'b', 4]], [['a', 3], ['b', 3], ['b', 5]]]), [[10, 3], [11, 5]])
    check('same key different parameter', solve([[[10, 'a', 2], [11, 'a', 4]], [['a', 3], ['a', 5]]]), [[10, 3], [10, 5], [11, 5]])
    check('null key', solve([[[10, None, 2]], [[None, 3]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 2]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 2]], [['a', 2], ['a', 2]]]), [[10, 2], [10, 2]])
    check('empty outer', solve([[], [['a', 2]]]), [])
    check('unmatched key', solve([[[10, 'z', 2]], [['a', 3]]]), [[10, None]])
elif N == 3:
    check('per-row bindings', solve([[[10, 'a', 3], [11, 'b', 5]], [['a', 4], ['b', 4], ['b', 6]]]), [[10, 4], [11, 6]])
    check('same key different parameter', solve([[[10, 'a', 3], [11, 'a', 5]], [['a', 4], ['a', 6]]]), [[10, 4], [10, 6], [11, 6]])
    check('null key', solve([[[10, None, 3]], [[None, 4]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 3]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 3]], [['a', 3], ['a', 3]]]), [[10, 3], [10, 3]])
    check('empty outer', solve([[], [['a', 3]]]), [])
    check('unmatched key', solve([[[10, 'z', 3]], [['a', 4]]]), [[10, None]])
elif N == 4:
    check('per-row bindings', solve([[[10, 'a', 4], [11, 'b', 6]], [['a', 5], ['b', 5], ['b', 7]]]), [[10, 5], [11, 7]])
    check('same key different parameter', solve([[[10, 'a', 4], [11, 'a', 6]], [['a', 5], ['a', 7]]]), [[10, 5], [10, 7], [11, 7]])
    check('null key', solve([[[10, None, 4]], [[None, 5]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 4]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 4]], [['a', 4], ['a', 4]]]), [[10, 4], [10, 4]])
    check('empty outer', solve([[], [['a', 4]]]), [])
    check('unmatched key', solve([[[10, 'z', 4]], [['a', 5]]]), [[10, None]])
elif N == 5:
    check('per-row bindings', solve([[[10, 'a', 5], [11, 'b', 7]], [['a', 6], ['b', 6], ['b', 8]]]), [[10, 6], [11, 8]])
    check('same key different parameter', solve([[[10, 'a', 5], [11, 'a', 7]], [['a', 6], ['a', 8]]]), [[10, 6], [10, 8], [11, 8]])
    check('null key', solve([[[10, None, 5]], [[None, 6]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 5]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 5]], [['a', 5], ['a', 5]]]), [[10, 5], [10, 5]])
    check('empty outer', solve([[], [['a', 5]]]), [])
    check('unmatched key', solve([[[10, 'z', 5]], [['a', 6]]]), [[10, None]])
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
per-row bindings[[10, 2], [10, 4], [11, 4]][[10, 2], [11, 4]]Failed
same key different parameter[[10, 2], [10, 4], [11, 4]][[10, 2], [10, 4], [11, 4]]Passed
null key[[10, None]][[10, None]]Passed
empty inner[[10, None]][[10, None]]Passed
duplicate inner[[10, 1], [10, 1]][[10, 1], [10, 1]]Passed
empty outer[][]Passed
unmatched key[[10, None]][[10, None]]Passed

SHA-256 / 7f3d638d3d6c182a38f571d7d61e2a307a9ecc483d61835eecef8d6dbaeca46d

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    try:
        outer,inner=d
        result=[]
        for ident,key,minimum in outer:
            matches=[value for k,value in inner if key is not None and k==key and value>=minimum]
            if not matches: result.append([ident,None])
            for value in matches:
                result.append([ident,value])
        return result
    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('per-row bindings', solve([[[10, 'a', 1], [11, 'b', 3]], [['a', 2], ['b', 2], ['b', 4]]]), [[10, 2], [11, 4]])
    check('same key different parameter', solve([[[10, 'a', 1], [11, 'a', 3]], [['a', 2], ['a', 4]]]), [[10, 2], [10, 4], [11, 4]])
    check('null key', solve([[[10, None, 1]], [[None, 2]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 1]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 1]], [['a', 1], ['a', 1]]]), [[10, 1], [10, 1]])
    check('empty outer', solve([[], [['a', 1]]]), [])
    check('unmatched key', solve([[[10, 'z', 1]], [['a', 2]]]), [[10, None]])
elif N == 2:
    check('per-row bindings', solve([[[10, 'a', 2], [11, 'b', 4]], [['a', 3], ['b', 3], ['b', 5]]]), [[10, 3], [11, 5]])
    check('same key different parameter', solve([[[10, 'a', 2], [11, 'a', 4]], [['a', 3], ['a', 5]]]), [[10, 3], [10, 5], [11, 5]])
    check('null key', solve([[[10, None, 2]], [[None, 3]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 2]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 2]], [['a', 2], ['a', 2]]]), [[10, 2], [10, 2]])
    check('empty outer', solve([[], [['a', 2]]]), [])
    check('unmatched key', solve([[[10, 'z', 2]], [['a', 3]]]), [[10, None]])
elif N == 3:
    check('per-row bindings', solve([[[10, 'a', 3], [11, 'b', 5]], [['a', 4], ['b', 4], ['b', 6]]]), [[10, 4], [11, 6]])
    check('same key different parameter', solve([[[10, 'a', 3], [11, 'a', 5]], [['a', 4], ['a', 6]]]), [[10, 4], [10, 6], [11, 6]])
    check('null key', solve([[[10, None, 3]], [[None, 4]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 3]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 3]], [['a', 3], ['a', 3]]]), [[10, 3], [10, 3]])
    check('empty outer', solve([[], [['a', 3]]]), [])
    check('unmatched key', solve([[[10, 'z', 3]], [['a', 4]]]), [[10, None]])
elif N == 4:
    check('per-row bindings', solve([[[10, 'a', 4], [11, 'b', 6]], [['a', 5], ['b', 5], ['b', 7]]]), [[10, 5], [11, 7]])
    check('same key different parameter', solve([[[10, 'a', 4], [11, 'a', 6]], [['a', 5], ['a', 7]]]), [[10, 5], [10, 7], [11, 7]])
    check('null key', solve([[[10, None, 4]], [[None, 5]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 4]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 4]], [['a', 4], ['a', 4]]]), [[10, 4], [10, 4]])
    check('empty outer', solve([[], [['a', 4]]]), [])
    check('unmatched key', solve([[[10, 'z', 4]], [['a', 5]]]), [[10, None]])
elif N == 5:
    check('per-row bindings', solve([[[10, 'a', 5], [11, 'b', 7]], [['a', 6], ['b', 6], ['b', 8]]]), [[10, 6], [11, 8]])
    check('same key different parameter', solve([[[10, 'a', 5], [11, 'a', 7]], [['a', 6], ['a', 8]]]), [[10, 6], [10, 8], [11, 8]])
    check('null key', solve([[[10, None, 5]], [[None, 6]]]), [[10, None]])
    check('empty inner', solve([[[10, 'a', 5]], []]), [[10, None]])
    check('duplicate inner', solve([[[10, 'a', 5]], [['a', 5], ['a', 5]]]), [[10, 5], [10, 5]])
    check('empty outer', solve([[], [['a', 5]]]), [])
    check('unmatched key', solve([[[10, 'z', 5]], [['a', 6]]]), [[10, None]])
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
per-row bindings[[10, 2], [11, 4]][[10, 2], [11, 4]]Passed
same key different parameter[[10, 2], [10, 4], [11, 4]][[10, 2], [10, 4], [11, 4]]Passed
null key[[10, None]][[10, None]]Passed
empty inner[[10, None]][[10, None]]Passed
duplicate inner[[10, 1], [10, 1]][[10, 1], [10, 1]]Passed
empty outer[][]Passed
unmatched key[[10, None]][[10, None]]Passed

SHA-256 / b32c8048bac666216c34274a46822729e81f4c929da54323f38c18e42e704d02

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

Case digest / 108ee4be1b0c09d2cf33487262fac1d2cc6b12607f6fb96c749a6961b980551b