FAILURE MAP
← Case archive

FA-43431 / Borrow checking / Open access

Receiver reservation activates before the last argument evaluation step · case 01

Receiver reservation activates before the last argument evaluation step.

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

ROOT CAUSE

The static analyzer mishandles argument before activation: receiver reservation activates before the last argument evaluation step.

THE FAILURE

The static analyzer mishandles argument before activation: receiver reservation activates before the last argument evaluation step.

Unsuccessful approach: The partial repair uses if d['activation_point']+1<d['argument_end']: errors.append('argument-before-activation'), which still violates the stipulated analysis contract.

Case contract

Validate reservation/activation facts of a toy two-phase mutable loan. Activation requires prior reservation, dominance and same loan identity. Reserved loan cannot be written through. Shared reads may exist during reservation but not activation. Reservation cannot cross storage death. Activation occurs at most once per path. Only compiler-generated method receiver auto-borrows may be two-phase. Argument evaluation must complete before activation. Canceled calls must release reservations. 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 d['activated'] and not d['reserved']: errors.append('reservation-required')
    if d['activated'] and not d['dominates']: errors.append('reservation-dominance')
    if d['activated'] and d['reservation_id']!=d['activation_id']: errors.append('activation-identity')
    if bool(d['reserved_writes']): errors.append('reserved-write')
    if d['activated'] and bool(d['shared_at_activation']): errors.append('activation-shared-conflict')
    if bool(set(d['storage_dead'])&set(d['reservation_points'])): errors.append('reservation-storage')
    if len(d['activations'])!=len(set(d['activations'])): errors.append('single-activation')
    if d['two_phase'] and not d['auto_receiver']: errors.append('eligible-auto-borrow')
    if False: errors.append('argument-before-activation')
    if d['canceled'] and d['reservation_live']: errors.append('cancellation-release')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'activated': False, 'reserved': False, 'dominates': True, 'reservation_id': None, 'activation_id': None, 'reserved_writes': [], 'shared_at_activation': [], 'storage_dead': [], 'reservation_points': [], 'activations': [], 'auto_receiver': True, 'two_phase': False, 'argument_end': 0, 'activation_point': 0, 'canceled': False, 'reservation_live': False}
check('well formed empty obligations',solve(base),[])
check('reservation-required regression 0', solve(dict(base, **({'activated':True,'activation_id':'a','reservation_id':'a'}))), ['reservation-required'])
check('reservation-required regression 1', solve(dict(base, **({'activated':True,'activation_id':N,'reservation_id':N}))), ['reservation-required'])
check('reservation-dominance regression 0', solve(dict(base, **({'activated':True,'reserved':True,'dominates':False}))), ['reservation-dominance'])
check('reservation-dominance regression 1', solve(dict(base, **({'activated':True,'reserved':True,'dominates':False,'activation_point':N}))), ['reservation-dominance'])
check('activation-identity regression 0', solve(dict(base, **({'activated':True,'reserved':True,'reservation_id':'a','activation_id':'b'}))), ['activation-identity'])
check('activation-identity regression 1', solve(dict(base, **({'activated':True,'reserved':True,'reservation_id':N,'activation_id':N+1}))), ['activation-identity'])
check('reserved-write regression 0', solve(dict(base, **({'reserved_writes':[N]}))), ['reserved-write'])
check('reserved-write regression 1', solve(dict(base, **({'reserved_writes':[N+1]}))), ['reserved-write'])
check('activation-shared-conflict regression 0', solve(dict(base, **({'activated':True,'reserved':True,'shared_at_activation':['r']}))), ['activation-shared-conflict'])
check('activation-shared-conflict regression 1', solve(dict(base, **({'activated':True,'reserved':True,'shared_at_activation':[N]}))), ['activation-shared-conflict'])
check('reservation-storage regression 0', solve(dict(base, **({'storage_dead':[N],'reservation_points':[N,N+1]}))), ['reservation-storage'])
check('reservation-storage regression 1', solve(dict(base, **({'storage_dead':[N,N+1],'reservation_points':[N]}))), ['reservation-storage'])
check('single-activation regression 0', solve(dict(base, **({'activations':['r','r']}))), ['single-activation'])
check('single-activation regression 1', solve(dict(base, **({'activations':[N,N]}))), ['single-activation'])
check('eligible-auto-borrow regression 0', solve(dict(base, **({'two_phase':True,'auto_receiver':False}))), ['eligible-auto-borrow'])
check('eligible-auto-borrow regression 1', solve(dict(base, **({'two_phase':True,'auto_receiver':False,'argument_end':0,'activation_point':N}))), ['eligible-auto-borrow'])
check('argument-before-activation regression 0', solve(dict(base, **({'activation_point':N,'argument_end':N+1}))), ['argument-before-activation'])
check('argument-before-activation regression 1', solve(dict(base, **({'activation_point':N+1,'argument_end':N+2}))), ['argument-before-activation'])
check('cancellation-release regression 0', solve(dict(base, **({'canceled':True,'reservation_live':True}))), ['cancellation-release'])
check('cancellation-release regression 1', solve(dict(base, **({'canceled':True,'reservation_live':True,'activation_point':N}))), ['cancellation-release'])
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
reservation-required regression 0['reservation-required']['reservation-required']Passed
reservation-required regression 1['reservation-required']['reservation-required']Passed
reservation-dominance regression 0['reservation-dominance']['reservation-dominance']Passed
reservation-dominance regression 1['reservation-dominance']['reservation-dominance']Passed
activation-identity regression 0['activation-identity']['activation-identity']Passed
activation-identity regression 1['activation-identity']['activation-identity']Passed
reserved-write regression 0['reserved-write']['reserved-write']Passed
reserved-write regression 1['reserved-write']['reserved-write']Passed
activation-shared-conflict regression 0['activation-shared-conflict']['activation-shared-conflict']Passed
activation-shared-conflict regression 1['activation-shared-conflict']['activation-shared-conflict']Passed
reservation-storage regression 0['reservation-storage']['reservation-storage']Passed
reservation-storage regression 1['reservation-storage']['reservation-storage']Passed
single-activation regression 0['single-activation']['single-activation']Passed
single-activation regression 1['single-activation']['single-activation']Passed
eligible-auto-borrow regression 0['eligible-auto-borrow']['eligible-auto-borrow']Passed
eligible-auto-borrow regression 1['eligible-auto-borrow']['eligible-auto-borrow']Passed
argument-before-activation regression 0[]['argument-before-activation']Failed
argument-before-activation regression 1[]['argument-before-activation']Failed
cancellation-release regression 0['cancellation-release']['cancellation-release']Passed
cancellation-release regression 1['cancellation-release']['cancellation-release']Passed

SHA-256 / 6ffe4ba25ce96030e81ab7afb8b2ceb13423cdfc9883d21c4a56b1587a4898d1

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['activated'] and not d['reserved']: errors.append('reservation-required')
    if d['activated'] and not d['dominates']: errors.append('reservation-dominance')
    if d['activated'] and d['reservation_id']!=d['activation_id']: errors.append('activation-identity')
    if bool(d['reserved_writes']): errors.append('reserved-write')
    if d['activated'] and bool(d['shared_at_activation']): errors.append('activation-shared-conflict')
    if bool(set(d['storage_dead'])&set(d['reservation_points'])): errors.append('reservation-storage')
    if len(d['activations'])!=len(set(d['activations'])): errors.append('single-activation')
    if d['two_phase'] and not d['auto_receiver']: errors.append('eligible-auto-borrow')
    if d['activation_point']+1<d['argument_end']: errors.append('argument-before-activation')
    if d['canceled'] and d['reservation_live']: errors.append('cancellation-release')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'activated': False, 'reserved': False, 'dominates': True, 'reservation_id': None, 'activation_id': None, 'reserved_writes': [], 'shared_at_activation': [], 'storage_dead': [], 'reservation_points': [], 'activations': [], 'auto_receiver': True, 'two_phase': False, 'argument_end': 0, 'activation_point': 0, 'canceled': False, 'reservation_live': False}
check('well formed empty obligations',solve(base),[])
check('reservation-required regression 0', solve(dict(base, **({'activated':True,'activation_id':'a','reservation_id':'a'}))), ['reservation-required'])
check('reservation-required regression 1', solve(dict(base, **({'activated':True,'activation_id':N,'reservation_id':N}))), ['reservation-required'])
check('reservation-dominance regression 0', solve(dict(base, **({'activated':True,'reserved':True,'dominates':False}))), ['reservation-dominance'])
check('reservation-dominance regression 1', solve(dict(base, **({'activated':True,'reserved':True,'dominates':False,'activation_point':N}))), ['reservation-dominance'])
check('activation-identity regression 0', solve(dict(base, **({'activated':True,'reserved':True,'reservation_id':'a','activation_id':'b'}))), ['activation-identity'])
check('activation-identity regression 1', solve(dict(base, **({'activated':True,'reserved':True,'reservation_id':N,'activation_id':N+1}))), ['activation-identity'])
check('reserved-write regression 0', solve(dict(base, **({'reserved_writes':[N]}))), ['reserved-write'])
check('reserved-write regression 1', solve(dict(base, **({'reserved_writes':[N+1]}))), ['reserved-write'])
check('activation-shared-conflict regression 0', solve(dict(base, **({'activated':True,'reserved':True,'shared_at_activation':['r']}))), ['activation-shared-conflict'])
check('activation-shared-conflict regression 1', solve(dict(base, **({'activated':True,'reserved':True,'shared_at_activation':[N]}))), ['activation-shared-conflict'])
check('reservation-storage regression 0', solve(dict(base, **({'storage_dead':[N],'reservation_points':[N,N+1]}))), ['reservation-storage'])
check('reservation-storage regression 1', solve(dict(base, **({'storage_dead':[N,N+1],'reservation_points':[N]}))), ['reservation-storage'])
check('single-activation regression 0', solve(dict(base, **({'activations':['r','r']}))), ['single-activation'])
check('single-activation regression 1', solve(dict(base, **({'activations':[N,N]}))), ['single-activation'])
check('eligible-auto-borrow regression 0', solve(dict(base, **({'two_phase':True,'auto_receiver':False}))), ['eligible-auto-borrow'])
check('eligible-auto-borrow regression 1', solve(dict(base, **({'two_phase':True,'auto_receiver':False,'argument_end':0,'activation_point':N}))), ['eligible-auto-borrow'])
check('argument-before-activation regression 0', solve(dict(base, **({'activation_point':N,'argument_end':N+1}))), ['argument-before-activation'])
check('argument-before-activation regression 1', solve(dict(base, **({'activation_point':N+1,'argument_end':N+2}))), ['argument-before-activation'])
check('cancellation-release regression 0', solve(dict(base, **({'canceled':True,'reservation_live':True}))), ['cancellation-release'])
check('cancellation-release regression 1', solve(dict(base, **({'canceled':True,'reservation_live':True,'activation_point':N}))), ['cancellation-release'])
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
reservation-required regression 0['reservation-required']['reservation-required']Passed
reservation-required regression 1['reservation-required']['reservation-required']Passed
reservation-dominance regression 0['reservation-dominance']['reservation-dominance']Passed
reservation-dominance regression 1['reservation-dominance']['reservation-dominance']Passed
activation-identity regression 0['activation-identity']['activation-identity']Passed
activation-identity regression 1['activation-identity']['activation-identity']Passed
reserved-write regression 0['reserved-write']['reserved-write']Passed
reserved-write regression 1['reserved-write']['reserved-write']Passed
activation-shared-conflict regression 0['activation-shared-conflict']['activation-shared-conflict']Passed
activation-shared-conflict regression 1['activation-shared-conflict']['activation-shared-conflict']Passed
reservation-storage regression 0['reservation-storage']['reservation-storage']Passed
reservation-storage regression 1['reservation-storage']['reservation-storage']Passed
single-activation regression 0['single-activation']['single-activation']Passed
single-activation regression 1['single-activation']['single-activation']Passed
eligible-auto-borrow regression 0['eligible-auto-borrow']['eligible-auto-borrow']Passed
eligible-auto-borrow regression 1['eligible-auto-borrow']['eligible-auto-borrow']Passed
argument-before-activation regression 0[]['argument-before-activation']Failed
argument-before-activation regression 1[]['argument-before-activation']Failed
cancellation-release regression 0['cancellation-release']['cancellation-release']Passed
cancellation-release regression 1['cancellation-release']['cancellation-release']Passed

SHA-256 / 0985a0dd6c35a52b35d7742987044176ae22fb45bc8cc8aaf056b5ab4d33337a

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

Case digest / 4457b7ae885f27085a843105d9d5572e45133b7db13b9790e3ce7a06999e46e9