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

N = 1
observations = []
def solve(d):
    errors=[]
    if d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if False: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if set(d['source_origins'])!=set(d['lowered_origins']): errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Lowered borrowed field points to another field expression origin.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if False: errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if len(set(d['exclusive_fields'])&set(d['spread_copies']))>1: errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Aggregate spread copies a unique reference instead of moving its capability.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if False: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if set(d['tuple_source'])!=set(d['tuple_lowered']): errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Tuple lowering swaps borrow origins between positional fields.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if False: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant'] is None: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Enum construction attaches a payload borrow to the wrong variant.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if False: errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not d['remapped_slots'] and bool(d['reference_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and bool(d['synthetic_loans']): errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Moving an aggregate fails to transfer a contained reference slot.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if False: errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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 d['source_order']!=d['eval_order']: errors.append('field-evaluation-order')
    if set(d['omitted'])!=set(d['update_moved']): errors.append('update-omitted-only')
    if bool(set(d['explicit'])&set(d['update_written'])): errors.append('explicit-field-precedence')
    if d['cleanup_order']!=list(reversed(d['initialized_order'])): errors.append('construction-cleanup-order')
    if d['source_origins']!=d['lowered_origins']: errors.append('field-origin-preservation')
    if bool(set(d['exclusive_fields'])&set(d['spread_copies'])): errors.append('spread-exclusive-duplication')
    if d['tuple_source']!=d['tuple_lowered']: errors.append('tuple-slot-identity')
    if d['payload_loan'] and d['actual_variant']!=d['expected_variant']: errors.append('enum-loan-discriminant')
    if not set(d['reference_slots'])<=set(d['remapped_slots']): errors.append('contained-reference-remap')
    if d['zero_field'] and len(d['synthetic_loans'])>1: errors.append('empty-aggregate-origin')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'source_order': [], 'eval_order': [], 'omitted': [], 'update_moved': [], 'explicit': [], 'update_written': [], 'initialized_order': [], 'cleanup_order': [], 'source_origins': {}, 'lowered_origins': {}, 'exclusive_fields': [], 'spread_copies': [], 'tuple_source': [], 'tuple_lowered': [], 'expected_variant': None, 'actual_variant': None, 'payload_loan': False, 'reference_slots': [], 'remapped_slots': [], 'zero_field': False, 'synthetic_loans': []}
check('well formed empty obligations',solve(base),[])
check('field-evaluation-order regression 0', solve(dict(base, **({'source_order':['a','b'],'eval_order':['b','a']}))), ['field-evaluation-order'])
check('field-evaluation-order regression 1', solve(dict(base, **({'source_order':[N,N+1],'eval_order':[N+1,N]}))), ['field-evaluation-order'])
check('update-omitted-only regression 0', solve(dict(base, **({'omitted':['a'],'update_moved':['a','b']}))), ['update-omitted-only'])
check('update-omitted-only regression 1', solve(dict(base, **({'omitted':[N],'update_moved':[N,N+1]}))), ['update-omitted-only'])
check('explicit-field-precedence regression 0', solve(dict(base, **({'explicit':['a'],'update_written':['a','b']}))), ['explicit-field-precedence'])
check('explicit-field-precedence regression 1', solve(dict(base, **({'explicit':[N],'update_written':[N,N+1]}))), ['explicit-field-precedence'])
check('construction-cleanup-order regression 0', solve(dict(base, **({'initialized_order':['a','b'],'cleanup_order':['a','b']}))), ['construction-cleanup-order'])
check('construction-cleanup-order regression 1', solve(dict(base, **({'initialized_order':[N,N+1],'cleanup_order':[N,N+1]}))), ['construction-cleanup-order'])
check('field-origin-preservation regression 0', solve(dict(base, **({'source_origins':{'a':'r'},'lowered_origins':{'a':'s'}}))), ['field-origin-preservation'])
check('field-origin-preservation regression 1', solve(dict(base, **({'source_origins':{'a':N},'lowered_origins':{'a':N+1}}))), ['field-origin-preservation'])
check('spread-exclusive-duplication regression 0', solve(dict(base, **({'exclusive_fields':['a'],'spread_copies':['a']}))), ['spread-exclusive-duplication'])
check('spread-exclusive-duplication regression 1', solve(dict(base, **({'exclusive_fields':[N],'spread_copies':[N]}))), ['spread-exclusive-duplication'])
check('tuple-slot-identity regression 0', solve(dict(base, **({'tuple_source':['a','b'],'tuple_lowered':['b','a']}))), ['tuple-slot-identity'])
check('tuple-slot-identity regression 1', solve(dict(base, **({'tuple_source':[N,N+1],'tuple_lowered':[N+1,N]}))), ['tuple-slot-identity'])
check('enum-loan-discriminant regression 0', solve(dict(base, **({'payload_loan':True,'actual_variant':'b','expected_variant':'a'}))), ['enum-loan-discriminant'])
check('enum-loan-discriminant regression 1', solve(dict(base, **({'payload_loan':True,'actual_variant':N+1,'expected_variant':N}))), ['enum-loan-discriminant'])
check('contained-reference-remap regression 0', solve(dict(base, **({'reference_slots':['a','b'],'remapped_slots':['a']}))), ['contained-reference-remap'])
check('contained-reference-remap regression 1', solve(dict(base, **({'reference_slots':[N,N+1],'remapped_slots':[N]}))), ['contained-reference-remap'])
check('empty-aggregate-origin regression 0', solve(dict(base, **({'zero_field':True,'synthetic_loans':['r']}))), ['empty-aggregate-origin'])
check('empty-aggregate-origin regression 1', solve(dict(base, **({'zero_field':True,'synthetic_loans':[N]}))), ['empty-aggregate-origin'])
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:
Empty aggregate lowering invents a borrowed field capability.

Validate lowering of aggregate expressions containing owned and borrowed fields. Evaluation order follows source field order; struct update moves only omitted fields; explicit fields override update sources; failed construction drops initialized fields in reverse initialization order; borrowed fields preserve their source origin; spread cannot duplicate exclusive fields; tuple projection indices remain positional; enum payload loans require matching discriminant; moving an aggregate remaps every contained reference owner slot; zero-field aggregates create no synthetic borrowed field. 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('one-shot-resume')
    if d['aborted'] and bool(d['capture_live']): errors.append('abort-capture-release')
    if d['escapes'] and bool(d['stack_captures']): errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
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 d['resume_count']>2: errors.append('one-shot-resume')
    if d['aborted'] and bool(d['capture_live']): errors.append('abort-capture-release')
    if d['escapes'] and bool(d['stack_captures']): errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
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 one-shot continuation can be resumed twice.

Check a one-shot continuation calculus with borrowed captures. A continuation resumes at most once; abort releases captures; escaping continuation may not borrow its capturing stack; cloning continuation cannot duplicate unique captures; resumption restores suspended loans; captured owner must survive resumed body; continuation argument ownership is transferred once; nested handler cannot release outer captures; unwound continuation invalidates frame-local reference results; resumed result origin must be among the continuation declared return origins. 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 d['resume_count']>1: errors.append('one-shot-resume')
    if False: errors.append('abort-capture-release')
    if d['escapes'] and bool(d['stack_captures']): errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
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 d['resume_count']>1: errors.append('one-shot-resume')
    if d['aborted'] and len(d['capture_live'])>1: errors.append('abort-capture-release')
    if d['escapes'] and bool(d['stack_captures']): errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
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:
Aborting a continuation leaves its captured borrow live.

Check a one-shot continuation calculus with borrowed captures. A continuation resumes at most once; abort releases captures; escaping continuation may not borrow its capturing stack; cloning continuation cannot duplicate unique captures; resumption restores suspended loans; captured owner must survive resumed body; continuation argument ownership is transferred once; nested handler cannot release outer captures; unwound continuation invalidates frame-local reference results; resumed result origin must be among the continuation declared return origins. 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 d['resume_count']>1: errors.append('one-shot-resume')
    if d['aborted'] and bool(d['capture_live']): errors.append('abort-capture-release')
    if False: errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
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 d['resume_count']>1: errors.append('one-shot-resume')
    if d['aborted'] and bool(d['capture_live']): errors.append('abort-capture-release')
    if d['escapes'] and len(d['stack_captures'])>1: errors.append('escape-capture-stack')
    if d['cloned'] and bool(d['unique_captures']): errors.append('clone-unique-capture')
    if not set(d['suspended'])<=set(d['restored']): errors.append('resume-loan-restore')
    if d['resumed_end']>d['owner_end']: errors.append('captured-owner-duration')
    if len(d['argument_transfers'])!=len(set(d['argument_transfers'])): errors.append('argument-transfer-once')
    if bool(set(d['outer_captures'])&set(d['released'])): errors.append('handler-capture-boundary')
    if d['unwound'] and bool(d['frame_results']): errors.append('unwind-frame-result')
    if not set(d['result_origins'])<=set(d['declared_returns']): errors.append('continuation-return-summary')
    return errors
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base={'resume_count': 0, 'aborted': False, 'capture_live': [], 'escapes': False, 'stack_captures': [], 'cloned': False, 'unique_captures': [], 'suspended': [], 'restored': [], 'owner_end': 0, 'resumed_end': 0, 'argument_transfers': [], 'outer_captures': [], 'released': [], 'unwound': False, 'frame_results': [], 'result_origins': [], 'declared_returns': []}
check('well formed empty obligations',solve(base),[])
check('one-shot-resume regression 0', solve(dict(base, **({'resume_count':2}))), ['one-shot-resume'])
check('one-shot-resume regression 1', solve(dict(base, **({'resume_count':2,'owner_end':N,'resumed_end':N}))), ['one-shot-resume'])
check('abort-capture-release regression 0', solve(dict(base, **({'aborted':True,'capture_live':['r']}))), ['abort-capture-release'])
check('abort-capture-release regression 1', solve(dict(base, **({'aborted':True,'capture_live':[N]}))), ['abort-capture-release'])
check('escape-capture-stack regression 0', solve(dict(base, **({'escapes':True,'stack_captures':['r']}))), ['escape-capture-stack'])
check('escape-capture-stack regression 1', solve(dict(base, **({'escapes':True,'stack_captures':[N]}))), ['escape-capture-stack'])
check('clone-unique-capture regression 0', solve(dict(base, **({'cloned':True,'unique_captures':['r']}))), ['clone-unique-capture'])
check('clone-unique-capture regression 1', solve(dict(base, **({'cloned':True,'unique_captures':[N]}))), ['clone-unique-capture'])
check('resume-loan-restore regression 0', solve(dict(base, **({'suspended':['a','b'],'restored':['a']}))), ['resume-loan-restore'])
check('resume-loan-restore regression 1', solve(dict(base, **({'suspended':[N,N+1],'restored':[N]}))), ['resume-loan-restore'])
check('captured-owner-duration regression 0', solve(dict(base, **({'resumed_end':N+1,'owner_end':N}))), ['captured-owner-duration'])
check('captured-owner-duration regression 1', solve(dict(base, **({'resumed_end':N+2,'owner_end':N+1}))), ['captured-owner-duration'])
check('argument-transfer-once regression 0', solve(dict(base, **({'argument_transfers':['x','x']}))), ['argument-transfer-once'])
check('argument-transfer-once regression 1', solve(dict(base, **({'argument_transfers':[N,N]}))), ['argument-transfer-once'])
check('handler-capture-boundary regression 0', solve(dict(base, **({'outer_captures':['r'],'released':['r']}))), ['handler-capture-boundary'])
check('handler-capture-boundary regression 1', solve(dict(base, **({'outer_captures':[N],'released':[N]}))), ['handler-capture-boundary'])
check('unwind-frame-result regression 0', solve(dict(base, **({'unwound':True,'frame_results':['r']}))), ['unwind-frame-result'])
check('unwind-frame-result regression 1', solve(dict(base, **({'unwound':True,'frame_results':[N]}))), ['unwind-frame-result'])
check('continuation-return-summary regression 0', solve(dict(base, **({'result_origins':['a','b'],'declared_returns':['a']}))), ['continuation-return-summary'])
check('continuation-return-summary regression 1', solve(dict(base, **({'result_origins':[N,N+1],'declared_returns':[N]}))), ['continuation-return-summary'])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An escaping continuation retains a borrow into its removed capture frame.

Check a one-shot continuation calculus with borrowed captures. A continuation resumes at most once; abort releases captures; escaping continuation may not borrow its capturing stack; cloning continuation cannot duplicate unique captures; resumption restores suspended loans; captured owner must survive resumed body; continuation argument ownership is transferred once; nested handler cannot release outer captures; unwound continuation invalidates frame-local reference results; resumed result origin must be among the continuation declared return origins. 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