FA-5291 / Python evaluation / Open access
Short circuit operands: Uses OR semantics for the AND operation · case 01
Uses OR semantics for the AND operation and changes the required Python-language result.
ROOT CAUSE
Uses OR semantics for the AND operation. The executable reproducer isolates this operation from the rest of the contract.
VERIFIED REPAIR
Evaluate left and rhs() or left or rhs(), returning [the actual selected operand,call log]. Python Boolean operators preserve operand values and call the right side only when needed.
Unsuccessful approach: The alternative still fails because it uses AND semantics for the OR operation.
Case contract
Evaluate left and rhs() or left or rhs(), returning [the actual selected operand,call log]. Python Boolean operators preserve operand values and call the right side only when needed. Inputs use the finite Python types shown in the fixtures. An error string denotes the specified caught exception, not an unhandled process failure.
Why this case matters
Runs Python standard-library language operations in a deterministic local reproducer. Literal expected answers are authored independently. Related defects share an evaluation group to avoid benchmark split leakage.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, left, right):
calls=[]
def rhs():
calls.append('right')
return right
result=left or rhs()
return [result,calls]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('false AND returns original', solve('and', 0, 'right'), [0, []])
check('true AND evaluates right', solve('and', 'left', 'right'), ['right', ['right']])
check('true OR retains left', solve('or', 'left', 'right'), ['left', []])
check('false OR evaluates right', solve('or', None, 'right'), ['right', ['right']])
check('empty right remains empty', solve('and', 1, []), [[], ['right']])
check('empty left preserved', solve('and', [], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| false AND returns original | ['right', ['right']] | [0, []] | Failed |
| true AND evaluates right | ['left', []] | ['right', ['right']] | Failed |
| true OR retains left | ['left', []] | ['left', []] | Passed |
| false OR evaluates right | ['right', ['right']] | ['right', ['right']] | Passed |
| empty right remains empty | [1, []] | [[], ['right']] | Failed |
| empty left preserved | [None, ['right']] | [[], []] | Failed |
SHA-256 / dbce60fb0fcd0ca202721f1ed8134aa0be9cf460e1fefdddce6ed0c20c51e4aa
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, left, right):
calls=[]
def rhs():
calls.append('right')
return right
result=left and rhs()
return [result,calls]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('false AND returns original', solve('and', 0, 'right'), [0, []])
check('true AND evaluates right', solve('and', 'left', 'right'), ['right', ['right']])
check('true OR retains left', solve('or', 'left', 'right'), ['left', []])
check('false OR evaluates right', solve('or', None, 'right'), ['right', ['right']])
check('empty right remains empty', solve('and', 1, []), [[], ['right']])
check('empty left preserved', solve('and', [], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| false AND returns original | [0, []] | [0, []] | Passed |
| true AND evaluates right | ['right', ['right']] | ['right', ['right']] | Passed |
| true OR retains left | ['right', ['right']] | ['left', []] | Failed |
| false OR evaluates right | [None, []] | ['right', ['right']] | Failed |
| empty right remains empty | [[], ['right']] | [[], ['right']] | Passed |
| empty left preserved | [[], []] | [[], []] | Passed |
SHA-256 / 3fd3aaa290267dcd23e6342b0ef62ba6797852a0ed0eed809c4c6dc6e85b4c17
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(operation, left, right):
calls=[]
def rhs():
calls.append('right')
return right
result=(left and rhs()) if operation=="and" else (left or rhs())
return [result,calls]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('false AND returns original', solve('and', 0, 'right'), [0, []])
check('true AND evaluates right', solve('and', 'left', 'right'), ['right', ['right']])
check('true OR retains left', solve('or', 'left', 'right'), ['left', []])
check('false OR evaluates right', solve('or', None, 'right'), ['right', ['right']])
check('empty right remains empty', solve('and', 1, []), [[], ['right']])
check('empty left preserved', solve('and', [], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| false AND returns original | [0, []] | [0, []] | Passed |
| true AND evaluates right | ['right', ['right']] | ['right', ['right']] | Passed |
| true OR retains left | ['left', []] | ['left', []] | Passed |
| false OR evaluates right | ['right', ['right']] | ['right', ['right']] | Passed |
| empty right remains empty | [[], ['right']] | [[], ['right']] | Passed |
| empty left preserved | [[], []] | [[], []] | Passed |
SHA-256 / 67f8092f6d183ed42cc99f0ce81dc31a6e2bae5c877264ef67f6499b77de26ab
Verification & scope
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:37:47.894919+00:00.
Case digest / 67ec8276db3781e11dc0bb10af587263c3d0d05adc51570102c26813bef7ee83