FA-11476 / Compiler transformation correctness / Open access
Boolean simplification erases evaluation of an effectful left operand · case 01
Boolean simplification erases evaluation of an effectful left operand.
ROOT CAUSE
The identity lhs AND false is folded without preserving lhs evaluation.
VERIFIED REPAIR
Fold the value while retaining the left effect trace if present.
Unsuccessful approach: Retaining only writes loses observable reads.
Case contract
Model lowering lhs AND false as [False, trace]; lhs is always evaluated and contributes its effect unless pure. Effect is pure, write or read; label identifies the operation.
Why this case matters
A deterministic miniature compiler-pass model; inputs are explicit IR facts, not a production compiler.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(effect, label):
return [False, []]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('pure', solve('pure',N), [False,[]])
check('write', solve('write',N), [False,[N]])
check('read', solve('read',N), [False,[N]])
check('zero label read', solve('read',0), [False,[0]])
check('empty label write', solve('write',''), [False,['']])
check('other pure label', solve('pure',N+1), [False,[]])
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 |
|---|---|---|---|
| pure | [False, []] | [False, []] | Passed |
| write | [False, []] | [False, [1]] | Failed |
| read | [False, []] | [False, [1]] | Failed |
| zero label read | [False, []] | [False, [0]] | Failed |
| empty label write | [False, []] | [False, ['']] | Failed |
| other pure label | [False, []] | [False, []] | Passed |
SHA-256 / a53bbfb67fc07f9b68ea0948285d5e1901b3a34991e000352449dc70ad26dd34
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(effect, label):
return [False, [label] if effect == 'write' else []]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('pure', solve('pure',N), [False,[]])
check('write', solve('write',N), [False,[N]])
check('read', solve('read',N), [False,[N]])
check('zero label read', solve('read',0), [False,[0]])
check('empty label write', solve('write',''), [False,['']])
check('other pure label', solve('pure',N+1), [False,[]])
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 |
|---|---|---|---|
| pure | [False, []] | [False, []] | Passed |
| write | [False, [1]] | [False, [1]] | Passed |
| read | [False, []] | [False, [1]] | Failed |
| zero label read | [False, []] | [False, [0]] | Failed |
| empty label write | [False, ['']] | [False, ['']] | Passed |
| other pure label | [False, []] | [False, []] | Passed |
SHA-256 / 7614dce1981298ed8b229eead7012e5b2485528691a2a3ea83d365c12d89b4b7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(effect, label):
return [False, [] if effect == 'pure' else [label]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('pure', solve('pure',N), [False,[]])
check('write', solve('write',N), [False,[N]])
check('read', solve('read',N), [False,[N]])
check('zero label read', solve('read',0), [False,[0]])
check('empty label write', solve('write',''), [False,['']])
check('other pure label', solve('pure',N+1), [False,[]])
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 |
|---|---|---|---|
| pure | [False, []] | [False, []] | Passed |
| write | [False, [1]] | [False, [1]] | Passed |
| read | [False, [1]] | [False, [1]] | Passed |
| zero label read | [False, [0]] | [False, [0]] | Passed |
| empty label write | [False, ['']] | [False, ['']] | Passed |
| other pure label | [False, []] | [False, []] | Passed |
SHA-256 / f5601d4799276b3a4371385142ae549d6e8e3b0586c4985bfcbd361ce7ac7e9f
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:38:48.280959+00:00.
Case digest / 79593d330e9663c90d941f6c0046d9a003e2e2cc1c2e86a7318abfce6367ba79