FAILURE MAP
← Case archive

FA-44226 / Borrow checking / Open access

Associated lifetime application loses type-argument order in its proof key · case 01

Associated lifetime application loses type-argument order in its proof key.

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

ROOT CAUSE

The static analyzer mishandles associated arguments: associated lifetime application loses type-argument order in its proof key.

THE FAILURE

The static analyzer mishandles associated arguments: associated lifetime application loses type-argument order in its proof key.

Unsuccessful approach: The partial repair uses if set(d['associated_args'])!=set(d['recorded_args']): errors.append('associated-arguments'), which still violates the stipulated analysis contract.

Case contract

Check generic borrow-summary instantiation. Generic lifetime arguments match parameter arity; parameter substitution is positional; repeated occurrences substitute consistently; recursive instantiation uses each callee actual mapping; static lifetime is not substituted; inferred anonymous lifetimes are fresh per call; where-outlives obligations instantiated in declared direction; associated lifetime applications include all type arguments; recursive summary fixed point cannot be accepted while new obligations remain; monomorphized reference types retain lifetime proof metadata. Input is a fully explicit descriptor of the stated toy IR. Return rule identifiers in declaration order; absent optional obligations use the provided neutral defaults. No rule is an assertion about a production language.

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(d):
    errors=[]
    if len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if False: errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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
well formed empty obligations[][]Passed
lifetime-arity regression 0['lifetime-arity']['lifetime-arity']Passed
lifetime-arity regression 1['lifetime-arity']['lifetime-arity']Passed
positional-substitution regression 0['positional-substitution']['positional-substitution']Passed
positional-substitution regression 1['positional-substitution']['positional-substitution']Passed
repeated-substitution regression 0['repeated-substitution']['repeated-substitution']Passed
repeated-substitution regression 1['repeated-substitution']['repeated-substitution']Passed
recursive-actual-map regression 0['recursive-actual-map']['recursive-actual-map']Passed
recursive-actual-map regression 1['recursive-actual-map']['recursive-actual-map']Passed
static-preservation regression 0['static-preservation']['static-preservation']Passed
static-preservation regression 1['static-preservation']['static-preservation']Passed
anonymous-freshness regression 0['anonymous-freshness']['anonymous-freshness']Passed
anonymous-freshness regression 1['anonymous-freshness']['anonymous-freshness']Passed
where-direction regression 0['where-direction']['where-direction']Passed
where-direction regression 1['where-direction']['where-direction']Passed
associated-arguments regression 0[]['associated-arguments']Failed
associated-arguments regression 1[]['associated-arguments']Failed
summary-fixed-point regression 0['summary-fixed-point']['summary-fixed-point']Passed
summary-fixed-point regression 1['summary-fixed-point']['summary-fixed-point']Passed
erased-proof-metadata regression 0['erased-proof-metadata']['erased-proof-metadata']Passed
erased-proof-metadata regression 1['erased-proof-metadata']['erased-proof-metadata']Passed

SHA-256 / 0eabc834fbb48d4bc0b80342c121d10d3ae134d8cd0dc9d9c4dd07648f5c0b57

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    errors=[]
    if len(d['params'])!=len(d['args']): errors.append('lifetime-arity')
    if d['expected_mapping']!=d['actual_mapping']: errors.append('positional-substitution')
    if any(len(set(xs))>1 for xs in d['occurrences'].values()): errors.append('repeated-substitution')
    if d['recursive_expected']!=d['recursive_actual']: errors.append('recursive-actual-map')
    if d['static_before']!=d['static_after']: errors.append('static-preservation')
    if len(d['anonymous_calls'])==len(d['anonymous_ids']) and len(set(d['anonymous_ids']))!=len(d['anonymous_ids']): errors.append('anonymous-freshness')
    if set(map(tuple,d['expected_outlives']))!=set(map(tuple,d['actual_outlives'])): errors.append('where-direction')
    if set(d['associated_args'])!=set(d['recorded_args']): errors.append('associated-arguments')
    if d['accepted'] and bool(d['pending']): errors.append('summary-fixed-point')
    if not set(d['reference_types'])<=set(d['proof_metadata']): errors.append('erased-proof-metadata')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'params': [], 'args': [], 'expected_mapping': {}, 'actual_mapping': {}, 'occurrences': {}, 'recursive_expected': {}, 'recursive_actual': {}, 'static_before': None, 'static_after': None, 'anonymous_calls': [], 'anonymous_ids': [], 'expected_outlives': [], 'actual_outlives': [], 'associated_args': [], 'recorded_args': [], 'pending': [], 'accepted': False, 'reference_types': [], 'proof_metadata': []}
check('well formed empty obligations',solve(base),[])
check('lifetime-arity regression 0', solve(dict(base, **({'params':['a'],'args':['x','y']}))), ['lifetime-arity'])
check('lifetime-arity regression 1', solve(dict(base, **({'params':[N],'args':[N,N+1]}))), ['lifetime-arity'])
check('positional-substitution regression 0', solve(dict(base, **({'expected_mapping':{'a':'x','b':'y'},'actual_mapping':{'a':'y','b':'x'}}))), ['positional-substitution'])
check('positional-substitution regression 1', solve(dict(base, **({'expected_mapping':{'a':N,'b':N+1},'actual_mapping':{'a':N+1,'b':N}}))), ['positional-substitution'])
check('repeated-substitution regression 0', solve(dict(base, **({'occurrences':{'a':['x','y']}}))), ['repeated-substitution'])
check('repeated-substitution regression 1', solve(dict(base, **({'occurrences':{'a':[N,N+1]}}))), ['repeated-substitution'])
check('recursive-actual-map regression 0', solve(dict(base, **({'recursive_expected':{'call':'b'},'recursive_actual':{'call':'a'}}))), ['recursive-actual-map'])
check('recursive-actual-map regression 1', solve(dict(base, **({'recursive_expected':{'call':N+1},'recursive_actual':{'call':N}}))), ['recursive-actual-map'])
check('static-preservation regression 0', solve(dict(base, **({'static_before':'static','static_after':'a'}))), ['static-preservation'])
check('static-preservation regression 1', solve(dict(base, **({'static_before':'static','static_after':N}))), ['static-preservation'])
check('anonymous-freshness regression 0', solve(dict(base, **({'anonymous_calls':['c1','c2'],'anonymous_ids':['r','r']}))), ['anonymous-freshness'])
check('anonymous-freshness regression 1', solve(dict(base, **({'anonymous_calls':[N,N+1],'anonymous_ids':[0,0]}))), ['anonymous-freshness'])
check('where-direction regression 0', solve(dict(base, **({'expected_outlives':[('a','b')],'actual_outlives':[('b','a')]}))), ['where-direction'])
check('where-direction regression 1', solve(dict(base, **({'expected_outlives':[(N,N+1)],'actual_outlives':[(N+1,N)]}))), ['where-direction'])
check('associated-arguments regression 0', solve(dict(base, **({'associated_args':['a','b'],'recorded_args':['b','a']}))), ['associated-arguments'])
check('associated-arguments regression 1', solve(dict(base, **({'associated_args':[N,N+1],'recorded_args':[N+1,N]}))), ['associated-arguments'])
check('summary-fixed-point regression 0', solve(dict(base, **({'accepted':True,'pending':['a']}))), ['summary-fixed-point'])
check('summary-fixed-point regression 1', solve(dict(base, **({'accepted':True,'pending':[N]}))), ['summary-fixed-point'])
check('erased-proof-metadata regression 0', solve(dict(base, **({'reference_types':['a','b'],'proof_metadata':['a']}))), ['erased-proof-metadata'])
check('erased-proof-metadata regression 1', solve(dict(base, **({'reference_types':[N,N+1],'proof_metadata':[N]}))), ['erased-proof-metadata'])
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
well formed empty obligations[][]Passed
lifetime-arity regression 0['lifetime-arity']['lifetime-arity']Passed
lifetime-arity regression 1['lifetime-arity']['lifetime-arity']Passed
positional-substitution regression 0['positional-substitution']['positional-substitution']Passed
positional-substitution regression 1['positional-substitution']['positional-substitution']Passed
repeated-substitution regression 0['repeated-substitution']['repeated-substitution']Passed
repeated-substitution regression 1['repeated-substitution']['repeated-substitution']Passed
recursive-actual-map regression 0['recursive-actual-map']['recursive-actual-map']Passed
recursive-actual-map regression 1['recursive-actual-map']['recursive-actual-map']Passed
static-preservation regression 0['static-preservation']['static-preservation']Passed
static-preservation regression 1['static-preservation']['static-preservation']Passed
anonymous-freshness regression 0['anonymous-freshness']['anonymous-freshness']Passed
anonymous-freshness regression 1['anonymous-freshness']['anonymous-freshness']Passed
where-direction regression 0['where-direction']['where-direction']Passed
where-direction regression 1['where-direction']['where-direction']Passed
associated-arguments regression 0[]['associated-arguments']Failed
associated-arguments regression 1[]['associated-arguments']Failed
summary-fixed-point regression 0['summary-fixed-point']['summary-fixed-point']Passed
summary-fixed-point regression 1['summary-fixed-point']['summary-fixed-point']Passed
erased-proof-metadata regression 0['erased-proof-metadata']['erased-proof-metadata']Passed
erased-proof-metadata regression 1['erased-proof-metadata']['erased-proof-metadata']Passed

SHA-256 / df924eb0b6e3159327c75a793523a68a9084d7685ce82db105a5f7ac5e564e01

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 21 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:44:10.295010+00:00.

Case digest / e17b9f7e05ae2c823cdca29a2ac998bddc9c6181a1d9a0f7f9f7ceaf207f5782