FAILURE MAP
← Case archive

FA-43066 / Borrow checking / Open access

External lifetime seeds replace local use demands · case 01

External lifetime seeds replace local use demands.

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

ROOT CAUSE

The static analyzer mishandles universal seed: external lifetime seeds replace local use demands.

THE FAILURE

The static analyzer mishandles universal seed: external lifetime seeds replace local use demands.

Unsuccessful approach: The partial repair uses for r in names: points[r]=set(universal.get(r,[])), which still violates the stipulated analysis contract.

Case contract

Solve finite outlives constraints a:b meaning a contains b. regions is universe, edges named constraints, equalities are bidirectional, demands maps region to points, universal maps region to required external points, forbidden maps region to points forbidden by storage scope. Compute least fixed point. Unknown edge endpoints produce error unknown; own seeds are retained; report sorted point sets and region names violating forbidden points. The static solution includes disconnected regions and propagates through cycles.

Why this case matters

A finite offline static-analysis model of ownership and borrowing; it does not execute the analyzed program.

1 / The failure

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

N = 1
observations = []
def solve(regions, edges, equalities, demands, universal, forbidden):
    names=set(regions)
    if any(a not in names or b not in names for a,b in edges+equalities): return 'unknown'
    links=list(edges)
    for a,b in equalities: links.extend([(a,b),(b,a)])
    points={r:set(demands.get(r,[])) for r in names}
    for r in names: points[r].update([])
    changed=True
    while changed:
        changed=False
        for a,b in links:
            before=set(points[a])
            points[a].update(points[b])
            if points[a]!=before: changed=True
    bad=sorted(r for r in names if points[r]&set(forbidden.get(r,[])))
    return [dict((r,sorted(points[r])) for r in sorted(names)),bad]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty',solve([],[],[],{},{},{}),[{},[]])
check('disconnected',solve(['a'],[],[],{},{},{}),[{'a':[]},[]])
check('unknown edge',solve(['a'],[('a','z')],[],{},{},{}),'unknown')
check('unknown equality',solve(['a'],[],[('a','z')],{},{},{}),'unknown')
check('seed both',solve(['a'],[],[],{'a':[N,N+1]},{'a':[N+2]},{}),[{'a':[N,N+1,N+2]},[]])
check('equality',solve(['a','b'],[],[('a','b')],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N,N+1]},[]])
check('transitive reversed order',solve(['a','b','c'],[('a','b'),('b','c')],[],{'c':[N]},{},{}),[{'a':[N],'b':[N],'c':[N]},[]])
check('one-way',solve(['a','b'],[('a','b')],[],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N+1]},[]])
check('forbidden partial',solve(['a'],[],[],{'a':[N,N+1]},{},{'a':[N]}),[{'a':[N,N+1]},['a']])
check('empty not forbidden',solve(['a'],[],[],{},{},{'a':[N]}),[{'a':[]},[]])
check('cycle',solve(['a','b'],[('a','b'),('b','a')],[],{'a':[N]},{},{}),[{'a':[N],'b':[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
empty[{}, []][{}, []]Passed
disconnected[{'a': []}, []][{'a': []}, []]Passed
unknown edgeunknownunknownPassed
unknown equalityunknownunknownPassed
seed both[{'a': [1, 2]}, []][{'a': [1, 2, 3]}, []]Failed
equality[{'a': [1, 2], 'b': [1, 2]}, []][{'a': [1, 2], 'b': [1, 2]}, []]Passed
transitive reversed order[{'a': [1], 'b': [1], 'c': [1]}, []][{'a': [1], 'b': [1], 'c': [1]}, []]Passed
one-way[{'a': [1, 2], 'b': [2]}, []][{'a': [1, 2], 'b': [2]}, []]Passed
forbidden partial[{'a': [1, 2]}, ['a']][{'a': [1, 2]}, ['a']]Passed
empty not forbidden[{'a': []}, []][{'a': []}, []]Passed
cycle[{'a': [1], 'b': [1]}, []][{'a': [1], 'b': [1]}, []]Passed

SHA-256 / d05a39d8e92b26d1a05517228a53d4eb86184add89e68d694c2f86129b21c912

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(regions, edges, equalities, demands, universal, forbidden):
    names=set(regions)
    if any(a not in names or b not in names for a,b in edges+equalities): return 'unknown'
    links=list(edges)
    for a,b in equalities: links.extend([(a,b),(b,a)])
    points={r:set(demands.get(r,[])) for r in names}
    for r in names: points[r]=set(universal.get(r,[]))
    changed=True
    while changed:
        changed=False
        for a,b in links:
            before=set(points[a])
            points[a].update(points[b])
            if points[a]!=before: changed=True
    bad=sorted(r for r in names if points[r]&set(forbidden.get(r,[])))
    return [dict((r,sorted(points[r])) for r in sorted(names)),bad]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty',solve([],[],[],{},{},{}),[{},[]])
check('disconnected',solve(['a'],[],[],{},{},{}),[{'a':[]},[]])
check('unknown edge',solve(['a'],[('a','z')],[],{},{},{}),'unknown')
check('unknown equality',solve(['a'],[],[('a','z')],{},{},{}),'unknown')
check('seed both',solve(['a'],[],[],{'a':[N,N+1]},{'a':[N+2]},{}),[{'a':[N,N+1,N+2]},[]])
check('equality',solve(['a','b'],[],[('a','b')],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N,N+1]},[]])
check('transitive reversed order',solve(['a','b','c'],[('a','b'),('b','c')],[],{'c':[N]},{},{}),[{'a':[N],'b':[N],'c':[N]},[]])
check('one-way',solve(['a','b'],[('a','b')],[],{'a':[N],'b':[N+1]},{},{}),[{'a':[N,N+1],'b':[N+1]},[]])
check('forbidden partial',solve(['a'],[],[],{'a':[N,N+1]},{},{'a':[N]}),[{'a':[N,N+1]},['a']])
check('empty not forbidden',solve(['a'],[],[],{},{},{'a':[N]}),[{'a':[]},[]])
check('cycle',solve(['a','b'],[('a','b'),('b','a')],[],{'a':[N]},{},{}),[{'a':[N],'b':[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
empty[{}, []][{}, []]Passed
disconnected[{'a': []}, []][{'a': []}, []]Passed
unknown edgeunknownunknownPassed
unknown equalityunknownunknownPassed
seed both[{'a': [3]}, []][{'a': [1, 2, 3]}, []]Failed
equality[{'a': [], 'b': []}, []][{'a': [1, 2], 'b': [1, 2]}, []]Failed
transitive reversed order[{'a': [], 'b': [], 'c': []}, []][{'a': [1], 'b': [1], 'c': [1]}, []]Failed
one-way[{'a': [], 'b': []}, []][{'a': [1, 2], 'b': [2]}, []]Failed
forbidden partial[{'a': []}, []][{'a': [1, 2]}, ['a']]Failed
empty not forbidden[{'a': []}, []][{'a': []}, []]Passed
cycle[{'a': [], 'b': []}, []][{'a': [1], 'b': [1]}, []]Failed

SHA-256 / efe99ead93cb5194055fe87a8e26016beb8392fa55240055d18c599f598df4ad

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 11 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

The explicitly stated toy language is the complete scope; this is not a production compiler or a claim about Rust semantics. 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:43:58.180376+00:00.

Case digest / 912b2b0debabfad8e1a6c6fd90e9a0731aee28145284039eb7a32ed302058812