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

N = 1
observations = []
def solve(operation, s):
    render_version, commit_version, selected, previous, server, browser, subscribing = s
    if operation == 'commit-tearing-recheck':
        return render_version!=commit_version
    if operation == 'selector-type-equality':
        return type(selected)==type(previous) and selected==previous
    if operation == 'server-snapshot-selection':
        return server
    if operation == 'browser-snapshot-selection':
        return browser
    if operation == 'snapshot-version-pair':
        return (commit_version,selected)
    if operation == 'subscription-install-read':
        return 'subscribe-then-read' if subscribing else 'read-only'
    if operation == 'stale-render-retry':
        return 'retry' if render_version!=commit_version else 'commit'
    if operation == 'selector-empty-value-retention':
        return selected if selected is not None else previous
    if operation == 'notify-selected-change':
        return type(selected)!=type(previous) or selected!=previous
    if operation == 'snapshot-null-initialization':
        return not selected
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-tearing-recheck scenario 1', solve('commit-tearing-recheck', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), True)
check('commit-tearing-recheck scenario 2', solve('commit-tearing-recheck', (1,1,0,False,None,'client',True)), False)
check('commit-tearing-recheck scenario 3', solve('commit-tearing-recheck', (2,2,[],[],0,1,False)), False)
check('commit-tearing-recheck scenario 4', solve('commit-tearing-recheck', (1,3,None,'old','server',None,True)), True)
check('commit-tearing-recheck scenario 5', solve('commit-tearing-recheck', (0,0,'a','b','','client',False)), False)
check('commit-tearing-recheck scenario 6', solve('commit-tearing-recheck', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('selector-type-equality scenario 1', solve('selector-type-equality', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), True)
check('selector-type-equality scenario 2', solve('selector-type-equality', (1,1,0,False,None,'client',True)), False)
check('selector-type-equality scenario 3', solve('selector-type-equality', (2,2,[],[],0,1,False)), True)
check('selector-type-equality scenario 4', solve('selector-type-equality', (1,3,None,'old','server',None,True)), False)
check('selector-type-equality scenario 5', solve('selector-type-equality', (0,0,'a','b','','client',False)), False)
check('selector-type-equality scenario 6', solve('selector-type-equality', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('server-snapshot-selection scenario 1', solve('server-snapshot-selection', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'ssr')
check('server-snapshot-selection scenario 2', solve('server-snapshot-selection', (1,1,0,False,None,'client',True)), None)
check('server-snapshot-selection scenario 3', solve('server-snapshot-selection', (2,2,[],[],0,1,False)), 0)
check('server-snapshot-selection scenario 4', solve('server-snapshot-selection', (1,3,None,'old','server',None,True)), 'server')
check('server-snapshot-selection scenario 5', solve('server-snapshot-selection', (0,0,'a','b','','client',False)), '')
check('server-snapshot-selection scenario 6', solve('server-snapshot-selection', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('browser-snapshot-selection scenario 1', solve('browser-snapshot-selection', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'client')
check('browser-snapshot-selection scenario 2', solve('browser-snapshot-selection', (1,1,0,False,None,'client',True)), 'client')
check('browser-snapshot-selection scenario 3', solve('browser-snapshot-selection', (2,2,[],[],0,1,False)), 1)
check('browser-snapshot-selection scenario 4', solve('browser-snapshot-selection', (1,3,None,'old','server',None,True)), None)
check('browser-snapshot-selection scenario 5', solve('browser-snapshot-selection', (0,0,'a','b','','client',False)), 'client')
check('browser-snapshot-selection scenario 6', solve('browser-snapshot-selection', (4,4,{'x':2},{'x':1},False,True,True)), True)
check('snapshot-version-pair scenario 1', solve('snapshot-version-pair', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), (N+1,{'x':1}))
check('snapshot-version-pair scenario 2', solve('snapshot-version-pair', (1,1,0,False,None,'client',True)), (1,0))
check('snapshot-version-pair scenario 3', solve('snapshot-version-pair', (2,2,[],[],0,1,False)), (2,[]))
check('snapshot-version-pair scenario 4', solve('snapshot-version-pair', (1,3,None,'old','server',None,True)), (3,None))
check('snapshot-version-pair scenario 5', solve('snapshot-version-pair', (0,0,'a','b','','client',False)), (0,'a'))
check('snapshot-version-pair scenario 6', solve('snapshot-version-pair', (4,4,{'x':2},{'x':1},False,True,True)), (4,{'x':2}))
check('subscription-install-read scenario 1', solve('subscription-install-read', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'subscribe-then-read')
check('subscription-install-read scenario 2', solve('subscription-install-read', (1,1,0,False,None,'client',True)), 'subscribe-then-read')
check('subscription-install-read scenario 3', solve('subscription-install-read', (2,2,[],[],0,1,False)), 'read-only')
check('subscription-install-read scenario 4', solve('subscription-install-read', (1,3,None,'old','server',None,True)), 'subscribe-then-read')
check('subscription-install-read scenario 5', solve('subscription-install-read', (0,0,'a','b','','client',False)), 'read-only')
check('subscription-install-read scenario 6', solve('subscription-install-read', (4,4,{'x':2},{'x':1},False,True,True)), 'subscribe-then-read')
check('stale-render-retry scenario 1', solve('stale-render-retry', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'retry')
check('stale-render-retry scenario 2', solve('stale-render-retry', (1,1,0,False,None,'client',True)), 'commit')
check('stale-render-retry scenario 3', solve('stale-render-retry', (2,2,[],[],0,1,False)), 'commit')
check('stale-render-retry scenario 4', solve('stale-render-retry', (1,3,None,'old','server',None,True)), 'retry')
check('stale-render-retry scenario 5', solve('stale-render-retry', (0,0,'a','b','','client',False)), 'commit')
check('stale-render-retry scenario 6', solve('stale-render-retry', (4,4,{'x':2},{'x':1},False,True,True)), 'commit')
check('selector-empty-value-retention scenario 1', solve('selector-empty-value-retention', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), {'x':1})
check('selector-empty-value-retention scenario 2', solve('selector-empty-value-retention', (1,1,0,False,None,'client',True)), 0)
check('selector-empty-value-retention scenario 3', solve('selector-empty-value-retention', (2,2,[],[],0,1,False)), [])
check('selector-empty-value-retention scenario 4', solve('selector-empty-value-retention', (1,3,None,'old','server',None,True)), 'old')
check('selector-empty-value-retention scenario 5', solve('selector-empty-value-retention', (0,0,'a','b','','client',False)), 'a')
check('selector-empty-value-retention scenario 6', solve('selector-empty-value-retention', (4,4,{'x':2},{'x':1},False,True,True)), {'x':2})
check('notify-selected-change scenario 1', solve('notify-selected-change', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), False)
check('notify-selected-change scenario 2', solve('notify-selected-change', (1,1,0,False,None,'client',True)), True)
check('notify-selected-change scenario 3', solve('notify-selected-change', (2,2,[],[],0,1,False)), False)
check('notify-selected-change scenario 4', solve('notify-selected-change', (1,3,None,'old','server',None,True)), True)
check('notify-selected-change scenario 5', solve('notify-selected-change', (0,0,'a','b','','client',False)), True)
check('notify-selected-change scenario 6', solve('notify-selected-change', (4,4,{'x':2},{'x':1},False,True,True)), True)
check('snapshot-null-initialization scenario 1', solve('snapshot-null-initialization', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), False)
check('snapshot-null-initialization scenario 2', solve('snapshot-null-initialization', (1,1,0,False,None,'client',True)), False)
check('snapshot-null-initialization scenario 3', solve('snapshot-null-initialization', (2,2,[],[],0,1,False)), False)
check('snapshot-null-initialization scenario 4', solve('snapshot-null-initialization', (1,3,None,'old','server',None,True)), True)
check('snapshot-null-initialization scenario 5', solve('snapshot-null-initialization', (0,0,'a','b','','client',False)), False)
check('snapshot-null-initialization scenario 6', solve('snapshot-null-initialization', (4,4,{'x':2},{'x':1},False,True,True)), 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):
    render_version, commit_version, selected, previous, server, browser, subscribing = s
    if operation == 'commit-tearing-recheck':
        return render_version!=commit_version
    if operation == 'selector-type-equality':
        return type(selected)==type(previous) and selected==previous
    if operation == 'server-snapshot-selection':
        return server
    if operation == 'browser-snapshot-selection':
        return browser
    if operation == 'snapshot-version-pair':
        return (commit_version,selected)
    if operation == 'subscription-install-read':
        return 'subscribe-then-read' if subscribing else 'read-only'
    if operation == 'stale-render-retry':
        return 'retry' if render_version!=commit_version else 'commit'
    if operation == 'selector-empty-value-retention':
        return selected if selected is not None else previous
    if operation == 'notify-selected-change':
        return type(selected)!=type(previous) or selected!=previous
    if operation == 'snapshot-null-initialization':
        return selected==None or selected==False
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('commit-tearing-recheck scenario 1', solve('commit-tearing-recheck', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), True)
check('commit-tearing-recheck scenario 2', solve('commit-tearing-recheck', (1,1,0,False,None,'client',True)), False)
check('commit-tearing-recheck scenario 3', solve('commit-tearing-recheck', (2,2,[],[],0,1,False)), False)
check('commit-tearing-recheck scenario 4', solve('commit-tearing-recheck', (1,3,None,'old','server',None,True)), True)
check('commit-tearing-recheck scenario 5', solve('commit-tearing-recheck', (0,0,'a','b','','client',False)), False)
check('commit-tearing-recheck scenario 6', solve('commit-tearing-recheck', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('selector-type-equality scenario 1', solve('selector-type-equality', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), True)
check('selector-type-equality scenario 2', solve('selector-type-equality', (1,1,0,False,None,'client',True)), False)
check('selector-type-equality scenario 3', solve('selector-type-equality', (2,2,[],[],0,1,False)), True)
check('selector-type-equality scenario 4', solve('selector-type-equality', (1,3,None,'old','server',None,True)), False)
check('selector-type-equality scenario 5', solve('selector-type-equality', (0,0,'a','b','','client',False)), False)
check('selector-type-equality scenario 6', solve('selector-type-equality', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('server-snapshot-selection scenario 1', solve('server-snapshot-selection', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'ssr')
check('server-snapshot-selection scenario 2', solve('server-snapshot-selection', (1,1,0,False,None,'client',True)), None)
check('server-snapshot-selection scenario 3', solve('server-snapshot-selection', (2,2,[],[],0,1,False)), 0)
check('server-snapshot-selection scenario 4', solve('server-snapshot-selection', (1,3,None,'old','server',None,True)), 'server')
check('server-snapshot-selection scenario 5', solve('server-snapshot-selection', (0,0,'a','b','','client',False)), '')
check('server-snapshot-selection scenario 6', solve('server-snapshot-selection', (4,4,{'x':2},{'x':1},False,True,True)), False)
check('browser-snapshot-selection scenario 1', solve('browser-snapshot-selection', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'client')
check('browser-snapshot-selection scenario 2', solve('browser-snapshot-selection', (1,1,0,False,None,'client',True)), 'client')
check('browser-snapshot-selection scenario 3', solve('browser-snapshot-selection', (2,2,[],[],0,1,False)), 1)
check('browser-snapshot-selection scenario 4', solve('browser-snapshot-selection', (1,3,None,'old','server',None,True)), None)
check('browser-snapshot-selection scenario 5', solve('browser-snapshot-selection', (0,0,'a','b','','client',False)), 'client')
check('browser-snapshot-selection scenario 6', solve('browser-snapshot-selection', (4,4,{'x':2},{'x':1},False,True,True)), True)
check('snapshot-version-pair scenario 1', solve('snapshot-version-pair', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), (N+1,{'x':1}))
check('snapshot-version-pair scenario 2', solve('snapshot-version-pair', (1,1,0,False,None,'client',True)), (1,0))
check('snapshot-version-pair scenario 3', solve('snapshot-version-pair', (2,2,[],[],0,1,False)), (2,[]))
check('snapshot-version-pair scenario 4', solve('snapshot-version-pair', (1,3,None,'old','server',None,True)), (3,None))
check('snapshot-version-pair scenario 5', solve('snapshot-version-pair', (0,0,'a','b','','client',False)), (0,'a'))
check('snapshot-version-pair scenario 6', solve('snapshot-version-pair', (4,4,{'x':2},{'x':1},False,True,True)), (4,{'x':2}))
check('subscription-install-read scenario 1', solve('subscription-install-read', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'subscribe-then-read')
check('subscription-install-read scenario 2', solve('subscription-install-read', (1,1,0,False,None,'client',True)), 'subscribe-then-read')
check('subscription-install-read scenario 3', solve('subscription-install-read', (2,2,[],[],0,1,False)), 'read-only')
check('subscription-install-read scenario 4', solve('subscription-install-read', (1,3,None,'old','server',None,True)), 'subscribe-then-read')
check('subscription-install-read scenario 5', solve('subscription-install-read', (0,0,'a','b','','client',False)), 'read-only')
check('subscription-install-read scenario 6', solve('subscription-install-read', (4,4,{'x':2},{'x':1},False,True,True)), 'subscribe-then-read')
check('stale-render-retry scenario 1', solve('stale-render-retry', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), 'retry')
check('stale-render-retry scenario 2', solve('stale-render-retry', (1,1,0,False,None,'client',True)), 'commit')
check('stale-render-retry scenario 3', solve('stale-render-retry', (2,2,[],[],0,1,False)), 'commit')
check('stale-render-retry scenario 4', solve('stale-render-retry', (1,3,None,'old','server',None,True)), 'retry')
check('stale-render-retry scenario 5', solve('stale-render-retry', (0,0,'a','b','','client',False)), 'commit')
check('stale-render-retry scenario 6', solve('stale-render-retry', (4,4,{'x':2},{'x':1},False,True,True)), 'commit')
check('selector-empty-value-retention scenario 1', solve('selector-empty-value-retention', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), {'x':1})
check('selector-empty-value-retention scenario 2', solve('selector-empty-value-retention', (1,1,0,False,None,'client',True)), 0)
check('selector-empty-value-retention scenario 3', solve('selector-empty-value-retention', (2,2,[],[],0,1,False)), [])
check('selector-empty-value-retention scenario 4', solve('selector-empty-value-retention', (1,3,None,'old','server',None,True)), 'old')
check('selector-empty-value-retention scenario 5', solve('selector-empty-value-retention', (0,0,'a','b','','client',False)), 'a')
check('selector-empty-value-retention scenario 6', solve('selector-empty-value-retention', (4,4,{'x':2},{'x':1},False,True,True)), {'x':2})
check('notify-selected-change scenario 1', solve('notify-selected-change', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), False)
check('notify-selected-change scenario 2', solve('notify-selected-change', (1,1,0,False,None,'client',True)), True)
check('notify-selected-change scenario 3', solve('notify-selected-change', (2,2,[],[],0,1,False)), False)
check('notify-selected-change scenario 4', solve('notify-selected-change', (1,3,None,'old','server',None,True)), True)
check('notify-selected-change scenario 5', solve('notify-selected-change', (0,0,'a','b','','client',False)), True)
check('notify-selected-change scenario 6', solve('notify-selected-change', (4,4,{'x':2},{'x':1},False,True,True)), True)
check('snapshot-null-initialization scenario 1', solve('snapshot-null-initialization', (N,N+1,{'x':1},{'x':1},'ssr','client',True)), False)
check('snapshot-null-initialization scenario 2', solve('snapshot-null-initialization', (1,1,0,False,None,'client',True)), False)
check('snapshot-null-initialization scenario 3', solve('snapshot-null-initialization', (2,2,[],[],0,1,False)), False)
check('snapshot-null-initialization scenario 4', solve('snapshot-null-initialization', (1,3,None,'old','server',None,True)), True)
check('snapshot-null-initialization scenario 5', solve('snapshot-null-initialization', (0,0,'a','b','','client',False)), False)
check('snapshot-null-initialization scenario 6', solve('snapshot-null-initialization', (4,4,{'x':2},{'x':1},False,True,True)), 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:
Snapshot null initialization.

A render snapshot is rechecked at commit to detect intervening store writes. Selectors compare both scalar type and value. Server/client snapshots are separate and null differs from false, zero, or empty containers. Operation snapshot-null-initialization 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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return urgent
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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:
Deferred content during pending.

Urgent input echoes immediately while deferred content may lag. Only the active transition can commit or clear pending work. A suspended update retains any prior screen, including empty text; first render uses fallback. Operation deferred-content-during-pending 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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return True
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return result_generation<=active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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:
Stale transition result.

Urgent input echoes immediately while deferred content may lag. Only the active transition can commit or clear pending work. A suspended update retains any prior screen, including empty text; first render uses fallback. Operation stale-transition-result 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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return fallback if suspended else urgent
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation!=active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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:
Suspension preserves prior screen.

Urgent input echoes immediately while deferred content may lag. Only the active transition can commit or clear pending work. A suspended update retains any prior screen, including empty text; first render uses fallback. Operation suspension-preserves-prior-screen 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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return False
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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):
    urgent, deferred, pending, active_generation, result_generation, suspended, previous, fallback = s
    if operation == 'urgent-value-echo':
        return urgent
    if operation == 'deferred-content-during-pending':
        return deferred if pending else urgent
    if operation == 'stale-transition-result':
        return result_generation==active_generation
    if operation == 'suspension-preserves-prior-screen':
        return previous if suspended and previous is not None else (fallback if suspended else urgent)
    if operation == 'pending-indicator-not-equality':
        return pending
    if operation == 'commit-clears-only-current-pending':
        return pending and result_generation==active_generation
    if operation == 'deferred-value-commit':
        return urgent if result_generation==active_generation and not suspended else deferred
    if operation == 'fallback-first-render':
        return suspended and previous is None
    if operation == 'transition-target-identity':
        return (active_generation,urgent)
    if operation == 'previous-empty-screen':
        return previous is not None
    raise ValueError('unknown modeled operation')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('urgent-value-echo scenario 1', solve('urgent-value-echo', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('urgent-value-echo scenario 2', solve('urgent-value-echo', ('','',False,1,1,False,'old','wait')), '')
check('urgent-value-echo scenario 3', solve('urgent-value-echo', ('new','old',True,2,2,True,'screen','spinner')), 'new')
check('urgent-value-echo scenario 4', solve('urgent-value-echo', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('urgent-value-echo scenario 5', solve('urgent-value-echo', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('urgent-value-echo scenario 6', solve('urgent-value-echo', ('','old',False,3,3,True,'','spinner')), '')
check('deferred-content-during-pending scenario 1', solve('deferred-content-during-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 2', solve('deferred-content-during-pending', ('','',False,1,1,False,'old','wait')), '')
check('deferred-content-during-pending scenario 3', solve('deferred-content-during-pending', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-content-during-pending scenario 4', solve('deferred-content-during-pending', ('new','old',True,2,2,False,None,'spinner')), 'old')
check('deferred-content-during-pending scenario 5', solve('deferred-content-during-pending', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-content-during-pending scenario 6', solve('deferred-content-during-pending', ('','old',False,3,3,True,'','spinner')), '')
check('stale-transition-result scenario 1', solve('stale-transition-result', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('stale-transition-result scenario 2', solve('stale-transition-result', ('','',False,1,1,False,'old','wait')), True)
check('stale-transition-result scenario 3', solve('stale-transition-result', ('new','old',True,2,2,True,'screen','spinner')), True)
check('stale-transition-result scenario 4', solve('stale-transition-result', ('new','old',True,2,2,False,None,'spinner')), True)
check('stale-transition-result scenario 5', solve('stale-transition-result', ('x','x',False,3,2,True,None,'spinner')), False)
check('stale-transition-result scenario 6', solve('stale-transition-result', ('','old',False,3,3,True,'','spinner')), True)
check('suspension-preserves-prior-screen scenario 1', solve('suspension-preserves-prior-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'q'+str(N))
check('suspension-preserves-prior-screen scenario 2', solve('suspension-preserves-prior-screen', ('','',False,1,1,False,'old','wait')), '')
check('suspension-preserves-prior-screen scenario 3', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,True,'screen','spinner')), 'screen')
check('suspension-preserves-prior-screen scenario 4', solve('suspension-preserves-prior-screen', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('suspension-preserves-prior-screen scenario 5', solve('suspension-preserves-prior-screen', ('x','x',False,3,2,True,None,'spinner')), 'spinner')
check('suspension-preserves-prior-screen scenario 6', solve('suspension-preserves-prior-screen', ('','old',False,3,3,True,'','spinner')), '')
check('pending-indicator-not-equality scenario 1', solve('pending-indicator-not-equality', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 2', solve('pending-indicator-not-equality', ('','',False,1,1,False,'old','wait')), False)
check('pending-indicator-not-equality scenario 3', solve('pending-indicator-not-equality', ('new','old',True,2,2,True,'screen','spinner')), True)
check('pending-indicator-not-equality scenario 4', solve('pending-indicator-not-equality', ('new','old',True,2,2,False,None,'spinner')), True)
check('pending-indicator-not-equality scenario 5', solve('pending-indicator-not-equality', ('x','x',False,3,2,True,None,'spinner')), False)
check('pending-indicator-not-equality scenario 6', solve('pending-indicator-not-equality', ('','old',False,3,3,True,'','spinner')), False)
check('commit-clears-only-current-pending scenario 1', solve('commit-clears-only-current-pending', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('commit-clears-only-current-pending scenario 2', solve('commit-clears-only-current-pending', ('','',False,1,1,False,'old','wait')), False)
check('commit-clears-only-current-pending scenario 3', solve('commit-clears-only-current-pending', ('new','old',True,2,2,True,'screen','spinner')), False)
check('commit-clears-only-current-pending scenario 4', solve('commit-clears-only-current-pending', ('new','old',True,2,2,False,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 5', solve('commit-clears-only-current-pending', ('x','x',False,3,2,True,None,'spinner')), False)
check('commit-clears-only-current-pending scenario 6', solve('commit-clears-only-current-pending', ('','old',False,3,3,True,'','spinner')), False)
check('deferred-value-commit scenario 1', solve('deferred-value-commit', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), 'old')
check('deferred-value-commit scenario 2', solve('deferred-value-commit', ('','',False,1,1,False,'old','wait')), '')
check('deferred-value-commit scenario 3', solve('deferred-value-commit', ('new','old',True,2,2,True,'screen','spinner')), 'old')
check('deferred-value-commit scenario 4', solve('deferred-value-commit', ('new','old',True,2,2,False,None,'spinner')), 'new')
check('deferred-value-commit scenario 5', solve('deferred-value-commit', ('x','x',False,3,2,True,None,'spinner')), 'x')
check('deferred-value-commit scenario 6', solve('deferred-value-commit', ('','old',False,3,3,True,'','spinner')), 'old')
check('fallback-first-render scenario 1', solve('fallback-first-render', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), False)
check('fallback-first-render scenario 2', solve('fallback-first-render', ('','',False,1,1,False,'old','wait')), False)
check('fallback-first-render scenario 3', solve('fallback-first-render', ('new','old',True,2,2,True,'screen','spinner')), False)
check('fallback-first-render scenario 4', solve('fallback-first-render', ('new','old',True,2,2,False,None,'spinner')), False)
check('fallback-first-render scenario 5', solve('fallback-first-render', ('x','x',False,3,2,True,None,'spinner')), True)
check('fallback-first-render scenario 6', solve('fallback-first-render', ('','old',False,3,3,True,'','spinner')), False)
check('transition-target-identity scenario 1', solve('transition-target-identity', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), (2,'q'+str(N)))
check('transition-target-identity scenario 2', solve('transition-target-identity', ('','',False,1,1,False,'old','wait')), (1,''))
check('transition-target-identity scenario 3', solve('transition-target-identity', ('new','old',True,2,2,True,'screen','spinner')), (2,'new'))
check('transition-target-identity scenario 4', solve('transition-target-identity', ('new','old',True,2,2,False,None,'spinner')), (2,'new'))
check('transition-target-identity scenario 5', solve('transition-target-identity', ('x','x',False,3,2,True,None,'spinner')), (3,'x'))
check('transition-target-identity scenario 6', solve('transition-target-identity', ('','old',False,3,3,True,'','spinner')), (3,''))
check('previous-empty-screen scenario 1', solve('previous-empty-screen', ('q'+str(N),'old',True,2,1,False,'screen','spinner')), True)
check('previous-empty-screen scenario 2', solve('previous-empty-screen', ('','',False,1,1,False,'old','wait')), True)
check('previous-empty-screen scenario 3', solve('previous-empty-screen', ('new','old',True,2,2,True,'screen','spinner')), True)
check('previous-empty-screen scenario 4', solve('previous-empty-screen', ('new','old',True,2,2,False,None,'spinner')), False)
check('previous-empty-screen scenario 5', solve('previous-empty-screen', ('x','x',False,3,2,True,None,'spinner')), False)
check('previous-empty-screen scenario 6', solve('previous-empty-screen', ('','old',False,3,3,True,'','spinner')), True)
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:
Commit clears only current pending.

Urgent input echoes immediately while deferred content may lag. Only the active transition can commit or clear pending work. A suspended update retains any prior screen, including empty text; first render uses fallback. Operation commit-clears-only-current-pending has the six explicit input/output oracles below.

split: open-access