FA-11446 / Compiler transformation correctness / Open access
Dead-result elimination deletes a volatile read · case 01
Dead-result elimination deletes a volatile read.
ROOT CAUSE
Result liveness is treated as the only reason to retain an instruction.
VERIFIED REPAIR
Retain unused instructions with any modeled observable effect.
Unsuccessful approach: Retaining writes alone still removes volatile reads and trapping instructions.
Case contract
Return retained instruction IDs in order. Instructions have (id, live, effect), where effect is pure, write, volatile or trap; only unused pure operations may be removed.
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(ops):
return [i for i, live, effect in ops if live]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty', solve([]), [])
check('dead pure', solve([(N,False,'pure')]), [])
check('live pure', solve([(N,True,'pure')]), [N])
check('write', solve([(N,False,'write')]), [N])
check('volatile', solve([(N,False,'volatile')]), [N])
check('trap', solve([(N,False,'trap')]), [N])
check('preserve order', solve([(N,False,'write'),(N+1,False,'pure'),(N+2,True,'pure')]), [N,N+2])
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 |
|---|---|---|---|
| empty | [] | [] | Passed |
| dead pure | [] | [] | Passed |
| live pure | [1] | [1] | Passed |
| write | [] | [1] | Failed |
| volatile | [] | [1] | Failed |
| trap | [] | [1] | Failed |
| preserve order | [3] | [1, 3] | Failed |
SHA-256 / 12ba8d22515b8d8bcd0ea135e98ece94363b6c25c0310a2216054e04ce6f8379
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(ops):
return [i for i, live, effect in ops if live or effect == 'write']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty', solve([]), [])
check('dead pure', solve([(N,False,'pure')]), [])
check('live pure', solve([(N,True,'pure')]), [N])
check('write', solve([(N,False,'write')]), [N])
check('volatile', solve([(N,False,'volatile')]), [N])
check('trap', solve([(N,False,'trap')]), [N])
check('preserve order', solve([(N,False,'write'),(N+1,False,'pure'),(N+2,True,'pure')]), [N,N+2])
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 |
|---|---|---|---|
| empty | [] | [] | Passed |
| dead pure | [] | [] | Passed |
| live pure | [1] | [1] | Passed |
| write | [1] | [1] | Passed |
| volatile | [] | [1] | Failed |
| trap | [] | [1] | Failed |
| preserve order | [1, 3] | [1, 3] | Passed |
SHA-256 / 318f6512259e87a43ed423e182e3d96c9d4603df2cee667e6aadae5b6969b4dd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(ops):
return [i for i, live, effect in ops if live or effect != 'pure']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty', solve([]), [])
check('dead pure', solve([(N,False,'pure')]), [])
check('live pure', solve([(N,True,'pure')]), [N])
check('write', solve([(N,False,'write')]), [N])
check('volatile', solve([(N,False,'volatile')]), [N])
check('trap', solve([(N,False,'trap')]), [N])
check('preserve order', solve([(N,False,'write'),(N+1,False,'pure'),(N+2,True,'pure')]), [N,N+2])
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 |
|---|---|---|---|
| empty | [] | [] | Passed |
| dead pure | [] | [] | Passed |
| live pure | [1] | [1] | Passed |
| write | [1] | [1] | Passed |
| volatile | [1] | [1] | Passed |
| trap | [1] | [1] | Passed |
| preserve order | [1, 3] | [1, 3] | Passed |
SHA-256 / 30ec2de7270341d84e870433827d5f0b55a96098a27cd3ebdbd3df31b6823374
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.025717+00:00.
Case digest / 83e496caa01906478df7f3e9926a8b58a66caf359e0f49401f9c3ea8fd7a219d