FA-45381 / Data systems / Open access
Projection evaluates expressions in key order · case 01
Projection evaluates expressions in key order.
ROOT CAUSE
volatile-projection-scope: Projection evaluates expressions in key order.
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: Reversal changes both projected positions and volatile call order.
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 sorted(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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [[9, 2, 3]] | [[2, 9, 3]] | Failed |
| row first expression | [[9, 2, 3]] | [[9, 2, 3]] | Passed |
| empty projection | [[], []] | [[], []] | Passed |
| no input | [] | [] | Passed |
SHA-256 / f14553971290b2c3caa54b5e72291740386213f673b090234380d0457877a66d
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 reversed(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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [[2, 3, 9]] | [[9, 2, 3]] | Failed |
| empty projection | [[], []] | [[], []] | Passed |
| no input | [] | [] | Passed |
SHA-256 / 5ebb31230fb78887ab7f73272de022d4dc767a1ad8ece03e3967eb78eae20496
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.591366+00:00.
Case digest / dc210bb7db0be6b271042a52d8d969f6f0469a1b862d3573f2bf156a3c0774bb