FAILURE MAP
← Case archive

FA-11456 / Compiler transformation correctness / Open access

Phi lowering selects operands by block position · case 01

Phi lowering selects operands by block position.

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

ROOT CAUSE

Incoming values are indexed by predecessor list order instead of edge identity.

VERIFIED REPAIR

Select the value attached to the actual predecessor label.

Unsuccessful approach: Sorting labels before indexing still loses predecessor identity.

Case contract

Given incoming (predecessor,value) pairs and a present predecessor label, return that edge value regardless of list order.

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(incoming, pred):
    return incoming[0][1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('right edge', solve([('left',N),('right',N+1)],'right'), N+1)
check('left edge', solve([('left',N),('right',N+1)],'left'), N)
check('reordered right', solve([('right',N+1),('left',N)],'right'), N+1)
check('reordered left', solve([('right',N+1),('left',N)],'left'), N)
check('single predecessor', solve([('entry',N)],'entry'), N)
check('back edge', solve([('entry',0),('back',N),('exit',N+1)],'back'), N)
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
right edge12Failed
left edge11Passed
reordered right22Passed
reordered left21Failed
single predecessor11Passed
back edge01Failed

SHA-256 / 2019bd2938513479bad3246d73079e5e69d29421269087bea415e48723995252

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(incoming, pred):
    return sorted(incoming)[0][1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('right edge', solve([('left',N),('right',N+1)],'right'), N+1)
check('left edge', solve([('left',N),('right',N+1)],'left'), N)
check('reordered right', solve([('right',N+1),('left',N)],'right'), N+1)
check('reordered left', solve([('right',N+1),('left',N)],'left'), N)
check('single predecessor', solve([('entry',N)],'entry'), N)
check('back edge', solve([('entry',0),('back',N),('exit',N+1)],'back'), N)
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
right edge12Failed
left edge11Passed
reordered right12Failed
reordered left11Passed
single predecessor11Passed
back edge11Passed

SHA-256 / 771f002acb61ba2b7bdb9caeeac851929b57cac87c46ca915989f1f239db02c0

3 / The verified repair

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

N = 1
observations = []
def solve(incoming, pred):
    return dict(incoming)[pred]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('right edge', solve([('left',N),('right',N+1)],'right'), N+1)
check('left edge', solve([('left',N),('right',N+1)],'left'), N)
check('reordered right', solve([('right',N+1),('left',N)],'right'), N+1)
check('reordered left', solve([('right',N+1),('left',N)],'left'), N)
check('single predecessor', solve([('entry',N)],'entry'), N)
check('back edge', solve([('entry',0),('back',N),('exit',N+1)],'back'), N)
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
right edge22Passed
left edge11Passed
reordered right22Passed
reordered left11Passed
single predecessor11Passed
back edge11Passed

SHA-256 / 369153c67f622eae06864c72942c75f8beb6c6459ef4a3bba0fa647b9ccb7065

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

Case digest / 76fda9b916621fd52a602786ad94202d36ae3be65852d7b3dd9b76f607c1fb58