FA-11471 / Compiler transformation correctness / Open access
Inlining chooses a local name already used by the caller · case 01
Inlining chooses a local name already used by the caller.
ROOT CAUSE
A callee local is copied into the caller without alpha-renaming.
VERIFIED REPAIR
Choose the smallest unused suffix for the local base name.
Unsuccessful approach: Appending one suffix still collides when a caller already uses it.
Case contract
Return base if unused, otherwise base_1, base_2, etc choosing the first name absent from caller names.
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(base, used):
return base
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
b = 'tmp' + str(N)
check('no names', solve(b,[]), b)
check('unrelated', solve(b,['other']), b)
check('first collision', solve(b,[b]), b+'_1')
check('second collision', solve(b,[b,b+'_1']), b+'_2')
check('gap reuse', solve(b,[b,b+'_2']), b+'_1')
check('multiple occupied', solve(b,[b,b+'_1',b+'_2']), b+'_3')
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 |
|---|---|---|---|
| no names | tmp1 | tmp1 | Passed |
| unrelated | tmp1 | tmp1 | Passed |
| first collision | tmp1 | tmp1_1 | Failed |
| second collision | tmp1 | tmp1_2 | Failed |
| gap reuse | tmp1 | tmp1_1 | Failed |
| multiple occupied | tmp1 | tmp1_3 | Failed |
SHA-256 / fdc0d80cfcc86c69988c1b4777d1559ec41792eef8a4e9e8804a2c6bb852e96c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(base, used):
return base if base not in used else base + '_1'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
b = 'tmp' + str(N)
check('no names', solve(b,[]), b)
check('unrelated', solve(b,['other']), b)
check('first collision', solve(b,[b]), b+'_1')
check('second collision', solve(b,[b,b+'_1']), b+'_2')
check('gap reuse', solve(b,[b,b+'_2']), b+'_1')
check('multiple occupied', solve(b,[b,b+'_1',b+'_2']), b+'_3')
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 |
|---|---|---|---|
| no names | tmp1 | tmp1 | Passed |
| unrelated | tmp1 | tmp1 | Passed |
| first collision | tmp1_1 | tmp1_1 | Passed |
| second collision | tmp1_1 | tmp1_2 | Failed |
| gap reuse | tmp1_1 | tmp1_1 | Passed |
| multiple occupied | tmp1_1 | tmp1_3 | Failed |
SHA-256 / a5c94cb5744c31d539b46505314b70ba892ea855271171484a0d3aa1cf245ef2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(base, used):
candidate = base
i = 0
while candidate in used:
i += 1
candidate = base + '_' + str(i)
return candidate
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
b = 'tmp' + str(N)
check('no names', solve(b,[]), b)
check('unrelated', solve(b,['other']), b)
check('first collision', solve(b,[b]), b+'_1')
check('second collision', solve(b,[b,b+'_1']), b+'_2')
check('gap reuse', solve(b,[b,b+'_2']), b+'_1')
check('multiple occupied', solve(b,[b,b+'_1',b+'_2']), b+'_3')
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 |
|---|---|---|---|
| no names | tmp1 | tmp1 | Passed |
| unrelated | tmp1 | tmp1 | Passed |
| first collision | tmp1_1 | tmp1_1 | Passed |
| second collision | tmp1_2 | tmp1_2 | Passed |
| gap reuse | tmp1_1 | tmp1_1 | Passed |
| multiple occupied | tmp1_3 | tmp1_3 | Passed |
SHA-256 / 5ac2509d6008f3dedc45ea587d6960fcdbad443c6979cd63bd0a353094471d0b
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.157110+00:00.
Case digest / 91a39a99023e6c7d013edd383cbc9fb9113e800a218bfe6024a578838612e539