broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if False: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if set(d['field_order'])!=set(d['decl_order']): errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
Borrow-dependent fields are destroyed in a reordered declaration sequence.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if False: errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if not set(d['manual'])<=set(d['removed']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
Manually dropping one field clears a sibling destructor obligation.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if False: errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if len(set(d['may_dangle'])&set(d['observed_params']))>1: errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
A lifetime parameter observed by the destructor is incorrectly allowed to dangle.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if False: errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not d['obligations'] and bool(d['owned_phantom']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
An owning phantom parameter is omitted from transitive drop checking.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if False: errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>1 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
A singleton array loses its element destructor lifetime obligation.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if False: errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and len(d['partial_moves'])>1: errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
A single moved field leaves a custom destructor with an invalid whole receiver.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if False: errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(x[0] for x in d['substitutions'])<=set(x[0] for x in d['visited']): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
Recursive drop analysis memoizes by type name without lifetime substitution.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if False: errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if not set(d['initialized'])<=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
Unwinding drops an uninitialized field and invents borrow obligations.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if False: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    errors=[]
    if any(p<d['drop_point'] for p in d['observed_valid_until']): errors.append('destructor-read-live')
    if d['field_order']!=d['decl_order']: errors.append('field-drop-order')
    if set(d['removed'])!=set(d['manual']): errors.append('manual-drop-specific')
    if bool(set(d['may_dangle'])&set(d['observed_params'])): errors.append('may-dangle-observation')
    if not set(d['owned_phantom'])<=set(d['obligations']): errors.append('owning-phantom-drop')
    if d['array_length']>0 and not set(d['element_obligations'])<=set(d['array_obligations']): errors.append('array-element-drop')
    if d['custom_drop'] and bool(d['partial_moves']): errors.append('custom-drop-partial-move')
    if not set(map(tuple,d['substitutions']))<=set(map(tuple,d['visited'])): errors.append('substitution-sensitive-visit')
    if set(d['initialized'])!=set(d['unwind_drops']): errors.append('unwind-initialized-drops')
    if d['receiver_end']+1<d['body_end']: errors.append('destructor-receiver')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'observed_valid_until': [], 'drop_point': 0, 'field_order': [], 'decl_order': [], 'manual': [], 'removed': [], 'may_dangle': [], 'observed_params': [], 'owned_phantom': [], 'obligations': [], 'array_length': 0, 'element_obligations': [], 'array_obligations': [], 'custom_drop': False, 'partial_moves': [], 'substitutions': [], 'visited': [], 'initialized': [], 'unwind_drops': [], 'receiver_end': 0, 'body_end': 0}
check('well formed empty obligations',solve(base),[])
check('destructor-read-live regression 0', solve(dict(base, **({'observed_valid_until':[N],'drop_point':N+1}))), ['destructor-read-live'])
check('destructor-read-live regression 1', solve(dict(base, **({'observed_valid_until':[N+1],'drop_point':N+2}))), ['destructor-read-live'])
check('field-drop-order regression 0', solve(dict(base, **({'field_order':['b','a'],'decl_order':['a','b']}))), ['field-drop-order'])
check('field-drop-order regression 1', solve(dict(base, **({'field_order':[N+1,N],'decl_order':[N,N+1]}))), ['field-drop-order'])
check('manual-drop-specific regression 0', solve(dict(base, **({'manual':['a'],'removed':['a','b']}))), ['manual-drop-specific'])
check('manual-drop-specific regression 1', solve(dict(base, **({'manual':[N],'removed':[N,N+1]}))), ['manual-drop-specific'])
check('may-dangle-observation regression 0', solve(dict(base, **({'may_dangle':['a'],'observed_params':['a']}))), ['may-dangle-observation'])
check('may-dangle-observation regression 1', solve(dict(base, **({'may_dangle':[N],'observed_params':[N]}))), ['may-dangle-observation'])
check('owning-phantom-drop regression 0', solve(dict(base, **({'owned_phantom':['a','b'],'obligations':['a']}))), ['owning-phantom-drop'])
check('owning-phantom-drop regression 1', solve(dict(base, **({'owned_phantom':[N,N+1],'obligations':[N]}))), ['owning-phantom-drop'])
check('array-element-drop regression 0', solve(dict(base, **({'array_length':1,'element_obligations':[N]}))), ['array-element-drop'])
check('array-element-drop regression 1', solve(dict(base, **({'array_length':1,'element_obligations':[N+1]}))), ['array-element-drop'])
check('custom-drop-partial-move regression 0', solve(dict(base, **({'custom_drop':True,'partial_moves':['f']}))), ['custom-drop-partial-move'])
check('custom-drop-partial-move regression 1', solve(dict(base, **({'custom_drop':True,'partial_moves':[N]}))), ['custom-drop-partial-move'])
check('substitution-sensitive-visit regression 0', solve(dict(base, **({'substitutions':[('T','a'),('T','b')],'visited':[('T','a')]}))), ['substitution-sensitive-visit'])
check('substitution-sensitive-visit regression 1', solve(dict(base, **({'substitutions':[('T',N),('T',N+1)],'visited':[('T',N)]}))), ['substitution-sensitive-visit'])
check('unwind-initialized-drops regression 0', solve(dict(base, **({'initialized':['a'],'unwind_drops':['a','b']}))), ['unwind-initialized-drops'])
check('unwind-initialized-drops regression 1', solve(dict(base, **({'initialized':[N],'unwind_drops':[N,N+1]}))), ['unwind-initialized-drops'])
check('destructor-receiver regression 0', solve(dict(base, **({'receiver_end':N,'body_end':N+1}))), ['destructor-receiver'])
check('destructor-receiver regression 1', solve(dict(base, **({'receiver_end':N+1,'body_end':N+2}))), ['destructor-receiver'])
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)

prompt:
Destructor receiver exclusivity ends before the final destructor operation.

Check destructor-specific lifetime obligations. Destructor-read referents live at drop point; field destruction follows declaration order; explicit manual drop removes only its own drop obligation; may_dangle relaxation excludes observed parameters; owning phantom markers restore transitive drop obligations; arrays repeat element obligations even at nonzero symbolic lengths; partial move prohibited for custom-drop values; recursive drop dependencies need a visited set but may not skip distinct substitutions; unwinding runs initialized-field drops; destructor receiver borrow stays live through the whole body. 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.

split: open-access