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

N = 1
observations = []
def solve(d):
    errors=[]
    if not set(d['captures'])<=set(d['declared']): errors.append('capture-declaration')
    if any(a!=b and b.startswith(a+'.') for a in d['captures'] for b in d['captures']): errors.append('capture-prefix')
    if len(d['unique'])!=len(set(d['unique'])): errors.append('unique-duplicate')
    if bool(d['consumed']) and d['mode']!='Once': errors.append('once-mode')
    if bool(d['mutated']) and d['mode']=='Shared': errors.append('mut-mode')
    if d['escapes'] and bool(set(d['captures'])&set(d['stack'])): errors.append('escape-stack')
    if not set(d['calls'])<=set(d['env']): errors.append('call-region')
    if not set(d['env'])<=set(d['valid']): errors.append('capture-validity')
    if bool(set(d['captures'])&set(d['packed'])): errors.append('packed-reference')
    if False: errors.append('destructor-narrowing')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'captures': [], 'declared': [], 'unique': [], 'consumed': [], 'mutated': [], 'mode': 'Shared', 'escapes': False, 'stack': [], 'env': [], 'calls': [], 'valid': [], 'packed': [], 'narrow_moves': [], 'drop_aggregates': []}
check('well formed empty obligations',solve(base),[])
check('capture-declaration regression 0', solve(dict(base, **({'captures':['a','b'],'declared':['a']}))), ['capture-declaration'])
check('capture-declaration regression 1', solve(dict(base, **({'captures':['a','x'+str(N)],'declared':['a']}))), ['capture-declaration'])
check('capture-prefix regression 0', solve(dict(base, **({'captures':['r','r.y'],'declared':['r','r.y']}))), ['capture-prefix'])
check('capture-prefix regression 1', solve(dict(base, **({'captures':['r','r.y.z'],'declared':['r','r.y.z']}))), ['capture-prefix'])
check('unique-duplicate regression 0', solve(dict(base, **({'unique':['r','r']}))), ['unique-duplicate'])
check('unique-duplicate regression 1', solve(dict(base, **({'unique':[N,N]}))), ['unique-duplicate'])
check('once-mode regression 0', solve(dict(base, **({'consumed':['x'],'mode':'Mut'}))), ['once-mode'])
check('once-mode regression 1', solve(dict(base, **({'consumed':list(range(N)),'mode':'Mut'}))), ['once-mode'])
check('mut-mode regression 0', solve(dict(base, **({'mutated':['x']}))), ['mut-mode'])
check('mut-mode regression 1', solve(dict(base, **({'mutated':[N]}))), ['mut-mode'])
check('escape-stack regression 0', solve(dict(base, **({'escapes':True,'captures':['a','b'],'declared':['a','b'],'stack':['b']}))), ['escape-stack'])
check('escape-stack regression 1', solve(dict(base, **({'escapes':True,'captures':['a','c'],'declared':['a','c'],'stack':['c']}))), ['escape-stack'])
check('call-region regression 0', solve(dict(base, **({'calls':[N],'env':[N+1],'valid':[N+1]}))), ['call-region'])
check('call-region regression 1', solve(dict(base, **({'calls':[N,N+1],'env':[N+1,N+2],'valid':[N+1,N+2]}))), ['call-region'])
check('capture-validity regression 0', solve(dict(base, **({'env':[N,N+1],'valid':[N]}))), ['capture-validity'])
check('capture-validity regression 1', solve(dict(base, **({'env':[N],'valid':[N+1]}))), ['capture-validity'])
check('packed-reference regression 0', solve(dict(base, **({'captures':['a','b'],'declared':['a','b'],'packed':['b']}))), ['packed-reference'])
check('packed-reference regression 1', solve(dict(base, **({'captures':['a','c'],'declared':['a','c'],'packed':['c']}))), ['packed-reference'])
check('destructor-narrowing regression 0', solve(dict(base, **({'narrow_moves':['r.f'],'drop_aggregates':['r']}))), ['destructor-narrowing'])
check('destructor-narrowing regression 1', solve(dict(base, **({'narrow_moves':['r.f.g'],'drop_aggregates':['r']}))), ['destructor-narrowing'])
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 not set(d['captures'])<=set(d['declared']): errors.append('capture-declaration')
    if any(a!=b and b.startswith(a+'.') for a in d['captures'] for b in d['captures']): errors.append('capture-prefix')
    if len(d['unique'])!=len(set(d['unique'])): errors.append('unique-duplicate')
    if bool(d['consumed']) and d['mode']!='Once': errors.append('once-mode')
    if bool(d['mutated']) and d['mode']=='Shared': errors.append('mut-mode')
    if d['escapes'] and bool(set(d['captures'])&set(d['stack'])): errors.append('escape-stack')
    if not set(d['calls'])<=set(d['env']): errors.append('call-region')
    if not set(d['env'])<=set(d['valid']): errors.append('capture-validity')
    if bool(set(d['captures'])&set(d['packed'])): errors.append('packed-reference')
    if any(p in d['drop_aggregates'] for p in d['narrow_moves']): errors.append('destructor-narrowing')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'captures': [], 'declared': [], 'unique': [], 'consumed': [], 'mutated': [], 'mode': 'Shared', 'escapes': False, 'stack': [], 'env': [], 'calls': [], 'valid': [], 'packed': [], 'narrow_moves': [], 'drop_aggregates': []}
check('well formed empty obligations',solve(base),[])
check('capture-declaration regression 0', solve(dict(base, **({'captures':['a','b'],'declared':['a']}))), ['capture-declaration'])
check('capture-declaration regression 1', solve(dict(base, **({'captures':['a','x'+str(N)],'declared':['a']}))), ['capture-declaration'])
check('capture-prefix regression 0', solve(dict(base, **({'captures':['r','r.y'],'declared':['r','r.y']}))), ['capture-prefix'])
check('capture-prefix regression 1', solve(dict(base, **({'captures':['r','r.y.z'],'declared':['r','r.y.z']}))), ['capture-prefix'])
check('unique-duplicate regression 0', solve(dict(base, **({'unique':['r','r']}))), ['unique-duplicate'])
check('unique-duplicate regression 1', solve(dict(base, **({'unique':[N,N]}))), ['unique-duplicate'])
check('once-mode regression 0', solve(dict(base, **({'consumed':['x'],'mode':'Mut'}))), ['once-mode'])
check('once-mode regression 1', solve(dict(base, **({'consumed':list(range(N)),'mode':'Mut'}))), ['once-mode'])
check('mut-mode regression 0', solve(dict(base, **({'mutated':['x']}))), ['mut-mode'])
check('mut-mode regression 1', solve(dict(base, **({'mutated':[N]}))), ['mut-mode'])
check('escape-stack regression 0', solve(dict(base, **({'escapes':True,'captures':['a','b'],'declared':['a','b'],'stack':['b']}))), ['escape-stack'])
check('escape-stack regression 1', solve(dict(base, **({'escapes':True,'captures':['a','c'],'declared':['a','c'],'stack':['c']}))), ['escape-stack'])
check('call-region regression 0', solve(dict(base, **({'calls':[N],'env':[N+1],'valid':[N+1]}))), ['call-region'])
check('call-region regression 1', solve(dict(base, **({'calls':[N,N+1],'env':[N+1,N+2],'valid':[N+1,N+2]}))), ['call-region'])
check('capture-validity regression 0', solve(dict(base, **({'env':[N,N+1],'valid':[N]}))), ['capture-validity'])
check('capture-validity regression 1', solve(dict(base, **({'env':[N],'valid':[N+1]}))), ['capture-validity'])
check('packed-reference regression 0', solve(dict(base, **({'captures':['a','b'],'declared':['a','b'],'packed':['b']}))), ['packed-reference'])
check('packed-reference regression 1', solve(dict(base, **({'captures':['a','c'],'declared':['a','c'],'packed':['c']}))), ['packed-reference'])
check('destructor-narrowing regression 0', solve(dict(base, **({'narrow_moves':['r.f'],'drop_aggregates':['r']}))), ['destructor-narrowing'])
check('destructor-narrowing regression 1', solve(dict(base, **({'narrow_moves':['r.f.g'],'drop_aggregates':['r']}))), ['destructor-narrowing'])
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:
Capture precision partially moves a value whose destructor needs the whole aggregate.

Validate an inferred closure environment. Captures contain declared places; overlapping prefix captures must be minimized; unique captures may not be duplicated; consumed captures require Once call mode; mutated captures require Mut or Once; an escaping environment cannot hold stack-only origins; environment region contains all call sites; captured references remain valid for the environment region; captures of packed fields cannot form references; captures of destructor-bearing aggregates cannot be narrowed to moved fields. 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 False: errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 bool(d['live_origins']) and d['live_origins'][0] not in d['frame_slots']: errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 borrowed local live at yield is not promoted into generator storage.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if False: errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and len(d['self_refs'])>1: errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 movable generator is accepted with one retained self reference.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if False: errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not d['pinned'] and bool(d['self_refs']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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:
Pinning one frame projection is assumed to pin every self referent.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if False: errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if len(set(d['unique_saved'])&set(d['external_aliases']))>1: errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 suspended exclusive loan retains a caller-visible alias.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if False: errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(d['guards']) and d['guards'][0] in d['suspend_disallowed']: errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 suspension-forbidden borrowed guard is missed after an ordinary guard.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if False: errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if len(d['resume'])>len(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 resumed reference uses point-count equality as lifetime validity.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if False: errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o)+1 for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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:
Cancellation destroys an owner immediately before its borrowing frame slot.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if False: errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(d['returned']) and d['returned'][0] in d['frame_slots']: errors.append('completed-frame-return')
    if bool(set(d['saved'])&set(d['killed'])): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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:
Completion returns a reference into the destroyed generator frame.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if False: errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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 not set(d['live_origins'])<=set(d['frame_slots']): errors.append('frame-promotion')
    if d['movable'] and bool(d['self_refs']): errors.append('self-move')
    if not set(d['self_refs'])<=set(d['pinned']): errors.append('pin-projection')
    if bool(set(d['unique_saved'])&set(d['external_aliases'])): errors.append('suspended-unique-alias')
    if bool(set(d['guards'])&set(d['suspend_disallowed'])): errors.append('guard-yield')
    if not set(d['resume'])<=set(d['valid']): errors.append('resume-lifetime')
    if any(d['drop_order'].index(b)>d['drop_order'].index(o) for b,o in d['dependencies']): errors.append('cancel-drop-order')
    if d['completed'] and bool(set(d['returned'])&set(d['frame_slots'])): errors.append('completed-frame-return')
    if set(d['saved'])==set(d['killed']) and bool(d['saved']): errors.append('dead-loan-spill')
    if any(v!=d['active_variant'] and bool(set(ls)&set(d['common_loans'])) for v,ls in d['variant_loans'].items()): errors.append('variant-separation')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'live_origins': [], 'frame_slots': [], 'self_refs': [], 'movable': False, 'pinned': [], 'unique_saved': [], 'external_aliases': [], 'guards': [], 'suspend_disallowed': [], 'resume': [], 'valid': [], 'drop_order': [], 'dependencies': [], 'returned': [], 'completed': False, 'saved': [], 'killed': [], 'variant_loans': {}, 'active_variant': None, 'common_loans': []}
check('well formed empty obligations',solve(base),[])
check('frame-promotion regression 0', solve(dict(base, **({'live_origins':['a','b'],'frame_slots':['a']}))), ['frame-promotion'])
check('frame-promotion regression 1', solve(dict(base, **({'live_origins':['a',N],'frame_slots':['a']}))), ['frame-promotion'])
check('self-move regression 0', solve(dict(base, **({'movable':True,'self_refs':['r'],'pinned':['r']}))), ['self-move'])
check('self-move regression 1', solve(dict(base, **({'movable':True,'self_refs':[N],'pinned':[N]}))), ['self-move'])
check('pin-projection regression 0', solve(dict(base, **({'self_refs':['a','b'],'pinned':['a']}))), ['pin-projection'])
check('pin-projection regression 1', solve(dict(base, **({'self_refs':[N],'pinned':[N+1]}))), ['pin-projection'])
check('suspended-unique-alias regression 0', solve(dict(base, **({'unique_saved':['a'],'external_aliases':['a']}))), ['suspended-unique-alias'])
check('suspended-unique-alias regression 1', solve(dict(base, **({'unique_saved':[N],'external_aliases':[N]}))), ['suspended-unique-alias'])
check('guard-yield regression 0', solve(dict(base, **({'guards':['a','b'],'suspend_disallowed':['b']}))), ['guard-yield'])
check('guard-yield regression 1', solve(dict(base, **({'guards':['a',N],'suspend_disallowed':[N]}))), ['guard-yield'])
check('resume-lifetime regression 0', solve(dict(base, **({'resume':[N],'valid':[N+1]}))), ['resume-lifetime'])
check('resume-lifetime regression 1', solve(dict(base, **({'resume':[N,N+1],'valid':[N+1,N+2]}))), ['resume-lifetime'])
check('cancel-drop-order regression 0', solve(dict(base, **({'drop_order':['o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('cancel-drop-order regression 1', solve(dict(base, **({'drop_order':['x','o','b'],'dependencies':[('b','o')]}))), ['cancel-drop-order'])
check('completed-frame-return regression 0', solve(dict(base, **({'completed':True,'returned':['x','r'],'frame_slots':['r']}))), ['completed-frame-return'])
check('completed-frame-return regression 1', solve(dict(base, **({'completed':True,'returned':['x',N],'frame_slots':[N]}))), ['completed-frame-return'])
check('dead-loan-spill regression 0', solve(dict(base, **({'saved':['a','b'],'killed':['b']}))), ['dead-loan-spill'])
check('dead-loan-spill regression 1', solve(dict(base, **({'saved':[N,N+1],'killed':[N+1]}))), ['dead-loan-spill'])
check('variant-separation regression 0', solve(dict(base, **({'active_variant':'a','variant_loans':{'b':['r']},'common_loans':['r']}))), ['variant-separation'])
check('variant-separation regression 1', solve(dict(base, **({'active_variant':N,'variant_loans':{N+1:['r']},'common_loans':['r']}))), ['variant-separation'])
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:
Frame spilling resurrects a loan killed before suspension.

Validate static generator suspension descriptors. Live borrowed stack origins must be stored in the frame; movable frames cannot retain self references; pinned self references require pinned projection; a saved unique loan cannot have external aliases; suspension-disallowed guards cannot cross yield; resumed references must survive every resume point; cancellation drop order releases borrowers before owners; references returned by a completed generator cannot target its frame; loans killed before yield must not be saved; mutually exclusive variants require variant-specific frame loans. 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