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 False
    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 is None
    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 commit_version-render_version>1
    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 is None
    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:
Commit tearing recheck.

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 commit-tearing-recheck 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):
    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 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 is None
    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)

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):
    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 selected is 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 is None
    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:
Selector type equality.

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 selector-type-equality 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):
    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 'read-then-subscribe'
    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 is None
    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 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 is None
    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:
Subscription install read.

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 subscription-install-read 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):
    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 '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 is None
    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 selected!=previous 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 is None
    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:
Stale render retry.

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 stale-render-retry 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):
    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 selected!=previous
    if operation == 'snapshot-null-initialization':
        return selected is None
    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 True
    if operation == 'snapshot-null-initialization':
        return selected is None
    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:
Notify selected change.

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 notify-selected-change has the six explicit input/output oracles below.

split: open-access