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

N = 1
observations = []
def solve(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['setup','cleanup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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:
Cleanup before rerun.

An effect tracks dependency length, values and scalar types; an empty dependency vector differs from no prior run. Cleanup precedes setup, unmount suppresses completion writes, and each setup advances a generation. Operation cleanup-before-rerun has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Completion owner check.

An effect tracks dependency length, values and scalar types; an empty dependency vector differs from no prior run. Cleanup precedes setup, unmount suppresses completion writes, and each setup advances a generation. Operation completion-owner-check has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return 1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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:
Generation increment.

An effect tracks dependency length, values and scalar types; an empty dependency vector differs from no prior run. Cleanup precedes setup, unmount suppresses completion writes, and each setup advances a generation. Operation generation-increment has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted and dependencies else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup if mounted else False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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:
Setup after unmount.

An effect tracks dependency length, values and scalar types; an empty dependency vector differs from no prior run. Cleanup precedes setup, unmount suppresses completion writes, and each setup advances a generation. Operation setup-after-unmount has the six explicit input/output oracles below.

split: open-access


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

N = 1
observations = []
def solve(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return cleanup
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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(operation, s):
    mounted, dependencies, previous, cleanup, run, owner, completion_owner = s
    if operation == 'dependency-shape-comparison':
        return previous is None or len(dependencies)!=len(previous) or any(type(a)!=type(b) or a!=b for a,b in zip(dependencies,previous))
    if operation == 'unmount-cleanup':
        return cleanup and not mounted
    if operation == 'initial-effect-run':
        return previous is None or run==0
    if operation == 'cleanup-before-rerun':
        return ['cleanup','setup'] if cleanup else ['setup']
    if operation == 'completion-owner-check':
        return mounted and owner==completion_owner
    if operation == 'dependency-snapshot-copy':
        return list(dependencies)
    if operation == 'generation-increment':
        return run+1
    if operation == 'setup-after-unmount':
        return 'setup' if mounted else 'skip'
    if operation == 'cleanup-registration-retained':
        return False
    if operation == 'owner-change-invalidates':
        return owner!=completion_owner
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dependency-shape-comparison scenario 1', solve('dependency-shape-comparison', (True,[N,2],[N,1],True,2,'a','a')), True)
check('dependency-shape-comparison scenario 2', solve('dependency-shape-comparison', (True,[],[],False,0,'a','a')), False)
check('dependency-shape-comparison scenario 3', solve('dependency-shape-comparison', (False,[1],[1],True,1,'a','a')), False)
check('dependency-shape-comparison scenario 4', solve('dependency-shape-comparison', (True,[0],[False],True,3,'a','b')), True)
check('dependency-shape-comparison scenario 5', solve('dependency-shape-comparison', (True,[None],None,False,0,'b','b')), True)
check('dependency-shape-comparison scenario 6', solve('dependency-shape-comparison', (True,[1,2],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 1', solve('unmount-cleanup', (True,[N,2],[N,1],True,2,'a','a')), False)
check('unmount-cleanup scenario 2', solve('unmount-cleanup', (True,[],[],False,0,'a','a')), False)
check('unmount-cleanup scenario 3', solve('unmount-cleanup', (False,[1],[1],True,1,'a','a')), True)
check('unmount-cleanup scenario 4', solve('unmount-cleanup', (True,[0],[False],True,3,'a','b')), False)
check('unmount-cleanup scenario 5', solve('unmount-cleanup', (True,[None],None,False,0,'b','b')), False)
check('unmount-cleanup scenario 6', solve('unmount-cleanup', (True,[1,2],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 1', solve('initial-effect-run', (True,[N,2],[N,1],True,2,'a','a')), False)
check('initial-effect-run scenario 2', solve('initial-effect-run', (True,[],[],False,0,'a','a')), True)
check('initial-effect-run scenario 3', solve('initial-effect-run', (False,[1],[1],True,1,'a','a')), False)
check('initial-effect-run scenario 4', solve('initial-effect-run', (True,[0],[False],True,3,'a','b')), False)
check('initial-effect-run scenario 5', solve('initial-effect-run', (True,[None],None,False,0,'b','b')), True)
check('initial-effect-run scenario 6', solve('initial-effect-run', (True,[1,2],[1],True,1,'a','a')), False)
check('cleanup-before-rerun scenario 1', solve('cleanup-before-rerun', (True,[N,2],[N,1],True,2,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 2', solve('cleanup-before-rerun', (True,[],[],False,0,'a','a')), ['setup'])
check('cleanup-before-rerun scenario 3', solve('cleanup-before-rerun', (False,[1],[1],True,1,'a','a')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 4', solve('cleanup-before-rerun', (True,[0],[False],True,3,'a','b')), ['cleanup','setup'])
check('cleanup-before-rerun scenario 5', solve('cleanup-before-rerun', (True,[None],None,False,0,'b','b')), ['setup'])
check('cleanup-before-rerun scenario 6', solve('cleanup-before-rerun', (True,[1,2],[1],True,1,'a','a')), ['cleanup','setup'])
check('completion-owner-check scenario 1', solve('completion-owner-check', (True,[N,2],[N,1],True,2,'a','a')), True)
check('completion-owner-check scenario 2', solve('completion-owner-check', (True,[],[],False,0,'a','a')), True)
check('completion-owner-check scenario 3', solve('completion-owner-check', (False,[1],[1],True,1,'a','a')), False)
check('completion-owner-check scenario 4', solve('completion-owner-check', (True,[0],[False],True,3,'a','b')), False)
check('completion-owner-check scenario 5', solve('completion-owner-check', (True,[None],None,False,0,'b','b')), True)
check('completion-owner-check scenario 6', solve('completion-owner-check', (True,[1,2],[1],True,1,'a','a')), True)
check('dependency-snapshot-copy scenario 1', solve('dependency-snapshot-copy', (True,[N,2],[N,1],True,2,'a','a')), [N,2])
check('dependency-snapshot-copy scenario 2', solve('dependency-snapshot-copy', (True,[],[],False,0,'a','a')), [])
check('dependency-snapshot-copy scenario 3', solve('dependency-snapshot-copy', (False,[1],[1],True,1,'a','a')), [1])
check('dependency-snapshot-copy scenario 4', solve('dependency-snapshot-copy', (True,[0],[False],True,3,'a','b')), [0])
check('dependency-snapshot-copy scenario 5', solve('dependency-snapshot-copy', (True,[None],None,False,0,'b','b')), [None])
check('dependency-snapshot-copy scenario 6', solve('dependency-snapshot-copy', (True,[1,2],[1],True,1,'a','a')), [1,2])
check('generation-increment scenario 1', solve('generation-increment', (True,[N,2],[N,1],True,2,'a','a')), 3)
check('generation-increment scenario 2', solve('generation-increment', (True,[],[],False,0,'a','a')), 1)
check('generation-increment scenario 3', solve('generation-increment', (False,[1],[1],True,1,'a','a')), 2)
check('generation-increment scenario 4', solve('generation-increment', (True,[0],[False],True,3,'a','b')), 4)
check('generation-increment scenario 5', solve('generation-increment', (True,[None],None,False,0,'b','b')), 1)
check('generation-increment scenario 6', solve('generation-increment', (True,[1,2],[1],True,1,'a','a')), 2)
check('setup-after-unmount scenario 1', solve('setup-after-unmount', (True,[N,2],[N,1],True,2,'a','a')), 'setup')
check('setup-after-unmount scenario 2', solve('setup-after-unmount', (True,[],[],False,0,'a','a')), 'setup')
check('setup-after-unmount scenario 3', solve('setup-after-unmount', (False,[1],[1],True,1,'a','a')), 'skip')
check('setup-after-unmount scenario 4', solve('setup-after-unmount', (True,[0],[False],True,3,'a','b')), 'setup')
check('setup-after-unmount scenario 5', solve('setup-after-unmount', (True,[None],None,False,0,'b','b')), 'setup')
check('setup-after-unmount scenario 6', solve('setup-after-unmount', (True,[1,2],[1],True,1,'a','a')), 'setup')
check('cleanup-registration-retained scenario 1', solve('cleanup-registration-retained', (True,[N,2],[N,1],True,2,'a','a')), True)
check('cleanup-registration-retained scenario 2', solve('cleanup-registration-retained', (True,[],[],False,0,'a','a')), False)
check('cleanup-registration-retained scenario 3', solve('cleanup-registration-retained', (False,[1],[1],True,1,'a','a')), False)
check('cleanup-registration-retained scenario 4', solve('cleanup-registration-retained', (True,[0],[False],True,3,'a','b')), True)
check('cleanup-registration-retained scenario 5', solve('cleanup-registration-retained', (True,[None],None,False,0,'b','b')), False)
check('cleanup-registration-retained scenario 6', solve('cleanup-registration-retained', (True,[1,2],[1],True,1,'a','a')), True)
check('owner-change-invalidates scenario 1', solve('owner-change-invalidates', (True,[N,2],[N,1],True,2,'a','a')), False)
check('owner-change-invalidates scenario 2', solve('owner-change-invalidates', (True,[],[],False,0,'a','a')), False)
check('owner-change-invalidates scenario 3', solve('owner-change-invalidates', (False,[1],[1],True,1,'a','a')), False)
check('owner-change-invalidates scenario 4', solve('owner-change-invalidates', (True,[0],[False],True,3,'a','b')), True)
check('owner-change-invalidates scenario 5', solve('owner-change-invalidates', (True,[None],None,False,0,'b','b')), False)
check('owner-change-invalidates scenario 6', solve('owner-change-invalidates', (True,[1,2],[1],True,1,'a','a')), False)
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:
Cleanup registration retained.

An effect tracks dependency length, values and scalar types; an empty dependency vector differs from no prior run. Cleanup precedes setup, unmount suppresses completion writes, and each setup advances a generation. Operation cleanup-registration-retained has the six explicit input/output oracles below.

split: open-access