FAILURE MAP
← Case archive

FA-45361 / Data systems / Open access

Volatile projection calls are cached by expression key · case 01

Volatile projection calls are cached by expression key.

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

ROOT CAUSE

volatile-projection-scope: Volatile projection calls are cached by expression key.

VERIFIED REPAIR

Preserve the stated physical representation and operation order: Evaluate projection expressions over row IDs. Expressions are [kind,key] with stable, volatile, or row. A deterministic counter starts at seed and increments on each stable first call or volatile call; stable calls cache by key for the whole query. Row expressions return the current row ID. Preserve expression and row order.

Unsuccessful approach: Caching within a row still merges separate volatile calls.

Case contract

Evaluate projection expressions over row IDs. Expressions are [kind,key] with stable, volatile, or row. A deterministic counter starts at seed and increments on each stable first call or volatile call; stable calls cache by key for the whole query. Row expressions return the current row ID. Preserve expression and row 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:
        rows,expressions,seed=d
        counter=seed; cache={}; result=[]
        for row in rows:
            projected=[]
            for kind,key in expressions:
                if kind=='row': value=row
                elif kind=='stable':
                    if key not in cache: counter+=1; cache[key]=counter
                    value=cache[key]
                else:
                    if key not in cache: counter+=1; cache[key]=counter
                    value=cache[key]
                projected.append(value)
            result.append(projected)
        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('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 1]), [[2, 3]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 1]), [[2], [2]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 1]), [[2, 3]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 1]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 1]), [[2, 9, 3]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 1]), [[9, 2, 3]])
    check('empty projection', solve([[9, 2], [], 1]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 1]), [])
elif N == 2:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 2]), [[3, 4]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 2]), [[3], [3]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 2]), [[3, 4]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 2]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 2]), [[3, 9, 4]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 2]), [[9, 3, 4]])
    check('empty projection', solve([[9, 2], [], 2]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 2]), [])
elif N == 3:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 3]), [[4, 5]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 3]), [[4], [4]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 3]), [[4, 5]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 3]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 3]), [[4, 9, 5]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 3]), [[9, 4, 5]])
    check('empty projection', solve([[9, 2], [], 3]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 3]), [])
elif N == 4:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 4]), [[5, 6]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 4]), [[5], [5]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 4]), [[5, 6]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 4]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 4]), [[5, 9, 6]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 4]), [[9, 5, 6]])
    check('empty projection', solve([[9, 2], [], 4]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 4]), [])
elif N == 5:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 5]), [[6, 7]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 5]), [[6], [6]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 5]), [[6, 7]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 5]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 5]), [[6, 9, 7]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 5]), [[9, 6, 7]])
    check('empty projection', solve([[9, 2], [], 5]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 5]), [])
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
separate volatile calls[[2, 2]][[2, 3]]Failed
stable across rows[[2], [2]][[2], [2]]Passed
distinct stable keys[[2, 3]][[2, 3]]Passed
row-dependent[[9], [2]][[9], [2]]Passed
mixed expression order[[2, 9, 3]][[2, 9, 3]]Passed
row first expression[[9, 2, 3]][[9, 2, 3]]Passed
empty projection[[], []][[], []]Passed
no input[][]Passed

SHA-256 / c8d02b4fe9e5b6a8f4a865a1b8a5c3d49eca53a5324e7b5f5e53e55a2ff6aa6a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        rows,expressions,seed=d
        counter=seed; cache={}; result=[]
        for row in rows:
            projected=[]
            for kind,key in expressions:
                if kind=='row': value=row
                elif kind=='stable':
                    if key not in cache: counter+=1; cache[key]=counter
                    value=cache[key]
                else:
                    if key not in cache or not projected: counter+=1; cache[key]=counter
                    value=cache[key]
                projected.append(value)
            result.append(projected)
        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('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 1]), [[2, 3]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 1]), [[2], [2]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 1]), [[2, 3]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 1]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 1]), [[2, 9, 3]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 1]), [[9, 2, 3]])
    check('empty projection', solve([[9, 2], [], 1]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 1]), [])
elif N == 2:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 2]), [[3, 4]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 2]), [[3], [3]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 2]), [[3, 4]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 2]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 2]), [[3, 9, 4]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 2]), [[9, 3, 4]])
    check('empty projection', solve([[9, 2], [], 2]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 2]), [])
elif N == 3:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 3]), [[4, 5]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 3]), [[4], [4]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 3]), [[4, 5]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 3]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 3]), [[4, 9, 5]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 3]), [[9, 4, 5]])
    check('empty projection', solve([[9, 2], [], 3]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 3]), [])
elif N == 4:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 4]), [[5, 6]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 4]), [[5], [5]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 4]), [[5, 6]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 4]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 4]), [[5, 9, 6]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 4]), [[9, 5, 6]])
    check('empty projection', solve([[9, 2], [], 4]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 4]), [])
elif N == 5:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 5]), [[6, 7]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 5]), [[6], [6]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 5]), [[6, 7]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 5]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 5]), [[6, 9, 7]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 5]), [[9, 6, 7]])
    check('empty projection', solve([[9, 2], [], 5]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 5]), [])
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
separate volatile calls[[2, 2]][[2, 3]]Failed
stable across rows[[2], [2]][[2], [2]]Passed
distinct stable keys[[2, 3]][[2, 3]]Passed
row-dependent[[9], [2]][[9], [2]]Passed
mixed expression order[[2, 9, 3]][[2, 9, 3]]Passed
row first expression[[9, 2, 3]][[9, 2, 3]]Passed
empty projection[[], []][[], []]Passed
no input[][]Passed

SHA-256 / aad89e2114e7a3399d9597cbbb3c1f21f4577c35d5420da5653a41e10b3f3473

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    try:
        rows,expressions,seed=d
        counter=seed; cache={}; result=[]
        for row in rows:
            projected=[]
            for kind,key in expressions:
                if kind=='row': value=row
                elif kind=='stable':
                    if key not in cache: counter+=1; cache[key]=counter
                    value=cache[key]
                else:
                    counter+=1; value=counter
                projected.append(value)
            result.append(projected)
        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('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 1]), [[2, 3]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 1]), [[2], [2]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 1]), [[2, 3]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 1]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 1]), [[2, 9, 3]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 1]), [[9, 2, 3]])
    check('empty projection', solve([[9, 2], [], 1]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 1]), [])
elif N == 2:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 2]), [[3, 4]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 2]), [[3], [3]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 2]), [[3, 4]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 2]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 2]), [[3, 9, 4]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 2]), [[9, 3, 4]])
    check('empty projection', solve([[9, 2], [], 2]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 2]), [])
elif N == 3:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 3]), [[4, 5]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 3]), [[4], [4]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 3]), [[4, 5]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 3]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 3]), [[4, 9, 5]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 3]), [[9, 4, 5]])
    check('empty projection', solve([[9, 2], [], 3]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 3]), [])
elif N == 4:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 4]), [[5, 6]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 4]), [[5], [5]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 4]), [[5, 6]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 4]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 4]), [[5, 9, 6]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 4]), [[9, 5, 6]])
    check('empty projection', solve([[9, 2], [], 4]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 4]), [])
elif N == 5:
    check('separate volatile calls', solve([[9], [['volatile', 'v'], ['volatile', 'v']], 5]), [[6, 7]])
    check('stable across rows', solve([[9, 2], [['stable', 's']], 5]), [[6], [6]])
    check('distinct stable keys', solve([[9], [['stable', 'a'], ['stable', 'b']], 5]), [[6, 7]])
    check('row-dependent', solve([[9, 2], [['row', 'r']], 5]), [[9], [2]])
    check('mixed expression order', solve([[9], [['volatile', 'z'], ['row', 'r'], ['stable', 'a']], 5]), [[6, 9, 7]])
    check('row first expression', solve([[9], [['row', 'r'], ['stable', 's'], ['volatile', 'v']], 5]), [[9, 6, 7]])
    check('empty projection', solve([[9, 2], [], 5]), [[], []])
    check('no input', solve([[], [['volatile', 'v']], 5]), [])
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
separate volatile calls[[2, 3]][[2, 3]]Passed
stable across rows[[2], [2]][[2], [2]]Passed
distinct stable keys[[2, 3]][[2, 3]]Passed
row-dependent[[9], [2]][[9], [2]]Passed
mixed expression order[[2, 9, 3]][[2, 9, 3]]Passed
row first expression[[9, 2, 3]][[9, 2, 3]]Passed
empty projection[[], []][[], []]Passed
no input[][]Passed

SHA-256 / 031c2f9c4b0e9cf9a2ae56e8095eddbfc27b19c798e98466179c7179c98a7d0a

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

Case digest / 7a08f2de72442294205fa96816337ff7ef6caa429aa96346dfc850ca90b8045f