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

N = 1
observations = []
def solve(r):
    return (r['permit_capacity'][0]+r['permit_capacity'][1] <= r['permit_capacity'][2]) and (r['positive_request'] > 0) and (r['request_not_granted'][0] not in r['request_not_granted'][1]) and (r['grant_session'] in ['active'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'permit_capacity': [3, 2, 5], 'positive_request': 1, 'request_not_granted': ['r2', ['r1']], 'weighted_fifo': ['big', ['big', 'small']], 'grant_session': 'active'}
check('valid operation', solve(r), True)
check('The grant exceeds the configured total permit count', solve(dict(r, **{'permit_capacity': [4, 2, 5]})), False)
check('A zero or negative grant corrupts permit accounting', solve(dict(r, **{'positive_request': 0})), False)
check('A retried grant allocates the same request twice', solve(dict(r, **{'request_not_granted': ['r1', ['r1']]})), False)
check('A later small request overtakes the queued weighted head', solve(dict(r, **{'weighted_fifo': ['small', ['big', 'small']]})), False)
check('A session destroyed while waiting receives permits', solve(dict(r, **{'grant_session': 'closed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'permit_capacity': [4, 2, 5], 'positive_request': 0, 'request_not_granted': ['r1', ['r1']], 'weighted_fifo': ['small', ['big', 'small']], 'grant_session': 'closed'}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-semaphore-grant

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

N = 1
observations = []
def solve(r):
    return (r['permit_capacity'][0]+r['permit_capacity'][1] <= r['permit_capacity'][2]) and (r['positive_request'] > 0) and (r['request_not_granted'][0] not in r['request_not_granted'][1]) and (r['weighted_fifo'][0] == r['weighted_fifo'][1][0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'permit_capacity': [3, 2, 5], 'positive_request': 1, 'request_not_granted': ['r2', ['r1']], 'weighted_fifo': ['big', ['big', 'small']], 'grant_session': 'active'}
check('valid operation', solve(r), True)
check('The grant exceeds the configured total permit count', solve(dict(r, **{'permit_capacity': [4, 2, 5]})), False)
check('A zero or negative grant corrupts permit accounting', solve(dict(r, **{'positive_request': 0})), False)
check('A retried grant allocates the same request twice', solve(dict(r, **{'request_not_granted': ['r1', ['r1']]})), False)
check('A later small request overtakes the queued weighted head', solve(dict(r, **{'weighted_fifo': ['small', ['big', 'small']]})), False)
check('A session destroyed while waiting receives permits', solve(dict(r, **{'grant_session': 'closed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'permit_capacity': [4, 2, 5], 'positive_request': 0, 'request_not_granted': ['r1', ['r1']], 'weighted_fifo': ['small', ['big', 'small']], 'grant_session': 'closed'}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The semaphore grant operation is admitted even though a later small request overtakes the queued weighted head.

Return a Boolean admission decision for grant permits from a distributed semaphore. The record r must satisfy all of: r['permit_capacity'][0]+r['permit_capacity'][1] <= r['permit_capacity'][2]; r['positive_request'] > 0; r['request_not_granted'][0] not in r['request_not_granted'][1]; r['weighted_fifo'][0] == r['weighted_fifo'][1][0]; r['grant_session'] in ['active']. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['permit_capacity'][0]+r['permit_capacity'][1] <= r['permit_capacity'][2]) and (r['positive_request'] > 0) and (r['request_not_granted'][0] not in r['request_not_granted'][1]) and (r['weighted_fifo'][0] == r['weighted_fifo'][1][0])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'permit_capacity': [3, 2, 5], 'positive_request': 1, 'request_not_granted': ['r2', ['r1']], 'weighted_fifo': ['big', ['big', 'small']], 'grant_session': 'active'}
check('valid operation', solve(r), True)
check('The grant exceeds the configured total permit count', solve(dict(r, **{'permit_capacity': [4, 2, 5]})), False)
check('A zero or negative grant corrupts permit accounting', solve(dict(r, **{'positive_request': 0})), False)
check('A retried grant allocates the same request twice', solve(dict(r, **{'request_not_granted': ['r1', ['r1']]})), False)
check('A later small request overtakes the queued weighted head', solve(dict(r, **{'weighted_fifo': ['small', ['big', 'small']]})), False)
check('A session destroyed while waiting receives permits', solve(dict(r, **{'grant_session': 'closed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'permit_capacity': [4, 2, 5], 'positive_request': 0, 'request_not_granted': ['r1', ['r1']], 'weighted_fifo': ['small', ['big', 'small']], 'grant_session': 'closed'}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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

evaluation_group: xd-semaphore-grant

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

N = 1
observations = []
def solve(r):
    return (r['positive_request'] > 0) and (r['request_not_granted'][0] not in r['request_not_granted'][1]) and (r['weighted_fifo'][0] == r['weighted_fifo'][1][0]) and (r['grant_session'] in ['active'])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'permit_capacity': [3, 2, 5], 'positive_request': 1, 'request_not_granted': ['r2', ['r1']], 'weighted_fifo': ['big', ['big', 'small']], 'grant_session': 'active'}
check('valid operation', solve(r), True)
check('The grant exceeds the configured total permit count', solve(dict(r, **{'permit_capacity': [4, 2, 5]})), False)
check('A zero or negative grant corrupts permit accounting', solve(dict(r, **{'positive_request': 0})), False)
check('A retried grant allocates the same request twice', solve(dict(r, **{'request_not_granted': ['r1', ['r1']]})), False)
check('A later small request overtakes the queued weighted head', solve(dict(r, **{'weighted_fifo': ['small', ['big', 'small']]})), False)
check('A session destroyed while waiting receives permits', solve(dict(r, **{'grant_session': 'closed'})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'permit_capacity': [4, 2, 5], 'positive_request': 0, 'request_not_granted': ['r1', ['r1']], 'weighted_fifo': ['small', ['big', 'small']], 'grant_session': 'closed'}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The semaphore grant operation is admitted even though a session destroyed while waiting receives permits.

Return a Boolean admission decision for grant permits from a distributed semaphore. The record r must satisfy all of: r['permit_capacity'][0]+r['permit_capacity'][1] <= r['permit_capacity'][2]; r['positive_request'] > 0; r['request_not_granted'][0] not in r['request_not_granted'][1]; r['weighted_fifo'][0] == r['weighted_fifo'][1][0]; r['grant_session'] in ['active']. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-barrier-release

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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The barrier release operation is admitted even though a barrier opens before enough distinct participants arrive.

Return a Boolean admission decision for release a distributed generation barrier. The record r must satisfy all of: len(set(r['participant_count'][0])) >= r['participant_count'][1]; all(x == r['generation_match'][0] for x in r['generation_match'][1]); set(r['registered_members'][0]) <= set(r['registered_members'][1]); r['barrier_not_broken'] is False; r['release_persisted'] is True. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-barrier-release

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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The barrier release operation is admitted even though arrivals from another barrier round count toward this round.

Return a Boolean admission decision for release a distributed generation barrier. The record r must satisfy all of: len(set(r['participant_count'][0])) >= r['participant_count'][1]; all(x == r['generation_match'][0] for x in r['generation_match'][1]); set(r['registered_members'][0]) <= set(r['registered_members'][1]); r['barrier_not_broken'] is False; r['release_persisted'] is True. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-barrier-release

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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The barrier release operation is admitted even though unregistered arrivals manufacture barrier completion.

Return a Boolean admission decision for release a distributed generation barrier. The record r must satisfy all of: len(set(r['participant_count'][0])) >= r['participant_count'][1]; all(x == r['generation_match'][0] for x in r['generation_match'][1]); set(r['registered_members'][0]) <= set(r['registered_members'][1]); r['barrier_not_broken'] is False; r['release_persisted'] is True. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-barrier-release

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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The barrier release operation is admitted even though a failed barrier round is released as successful.

Return a Boolean admission decision for release a distributed generation barrier. The record r must satisfy all of: len(set(r['participant_count'][0])) >= r['participant_count'][1]; all(x == r['generation_match'][0] for x in r['generation_match'][1]); set(r['registered_members'][0]) <= set(r['registered_members'][1]); r['barrier_not_broken'] is False; r['release_persisted'] is True. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (len(set(r['participant_count'][0])) >= r['participant_count'][1]) and (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-barrier-release

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

N = 1
observations = []
def solve(r):
    return (all(x == r['generation_match'][0] for x in r['generation_match'][1])) and (set(r['registered_members'][0]) <= set(r['registered_members'][1])) and (r['barrier_not_broken'] is False) and (r['release_persisted'] is True)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'participant_count': [['a', 'b'], 2], 'generation_match': [3, [3, 3]], 'registered_members': [['a', 'b'], ['a', 'b', 'c']], 'barrier_not_broken': False, 'release_persisted': True}
check('valid operation', solve(r), True)
check('A barrier opens before enough distinct participants arrive', solve(dict(r, **{'participant_count': [['a', 'a'], 2]})), False)
check('Arrivals from another barrier round count toward this round', solve(dict(r, **{'generation_match': [3, [2, 3]]})), False)
check('Unregistered arrivals manufacture barrier completion', solve(dict(r, **{'registered_members': [['a', 'x'], ['a', 'b', 'c']]})), False)
check('A failed barrier round is released as successful', solve(dict(r, **{'barrier_not_broken': True})), False)
check('Waiters proceed before the generation release is durable', solve(dict(r, **{'release_persisted': False})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'participant_count': [['a', 'a'], 2], 'generation_match': [3, [2, 3]], 'registered_members': [['a', 'x'], ['a', 'b', 'c']], 'barrier_not_broken': True, 'release_persisted': False}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The barrier release operation is admitted even though waiters proceed before the generation release is durable.

Return a Boolean admission decision for release a distributed generation barrier. The record r must satisfy all of: len(set(r['participant_count'][0])) >= r['participant_count'][1]; all(x == r['generation_match'][0] for x in r['generation_match'][1]); set(r['registered_members'][0]) <= set(r['registered_members'][1]); r['barrier_not_broken'] is False; r['release_persisted'] is True. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-compare-and-swap

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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The compare and swap operation is admitted even though a stale writer replaces a newer revision.

Return a Boolean admission decision for apply a remote conditional state update. The record r must satisfy all of: r['revision_match'][0] == r['revision_match'][1]; r['object_incarnation'][0] == r['object_incarnation'][1]; r['expected_existence'] is False; tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]; r['revision_increment'][0] == r['revision_increment'][1]+1. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-compare-and-swap

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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The compare and swap operation is admitted even though delete and recreate produces an aba match on reused revision.

Return a Boolean admission decision for apply a remote conditional state update. The record r must satisfy all of: r['revision_match'][0] == r['revision_match'][1]; r['object_incarnation'][0] == r['object_incarnation'][1]; r['expected_existence'] is False; tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]; r['revision_increment'][0] == r['revision_increment'][1]+1. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-compare-and-swap

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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The compare and swap operation is admitted even though a create-only write replaces an existing object.

Return a Boolean admission decision for apply a remote conditional state update. The record r must satisfy all of: r['revision_match'][0] == r['revision_match'][1]; r['object_incarnation'][0] == r['object_incarnation'][1]; r['expected_existence'] is False; tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]; r['revision_increment'][0] == r['revision_increment'][1]+1. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-compare-and-swap

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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The compare and swap operation is admitted even though a conditional update performs an illegal lifecycle transition.

Return a Boolean admission decision for apply a remote conditional state update. The record r must satisfy all of: r['revision_match'][0] == r['revision_match'][1]; r['object_incarnation'][0] == r['object_incarnation'][1]; r['expected_existence'] is False; tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]; r['revision_increment'][0] == r['revision_increment'][1]+1. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['revision_match'][0] == r['revision_match'][1]) and (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-compare-and-swap

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

N = 1
observations = []
def solve(r):
    return (r['object_incarnation'][0] == r['object_incarnation'][1]) and (r['expected_existence'] is False) and (tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]) and (r['revision_increment'][0] == r['revision_increment'][1]+1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'revision_match': [7, 7], 'object_incarnation': ['g2', 'g2'], 'expected_existence': False, 'transition_allowed': [['open', 'closed'], [['open', 'closed']]], 'revision_increment': [8, 7]}
check('valid operation', solve(r), True)
check('A stale writer replaces a newer revision', solve(dict(r, **{'revision_match': [6, 7]})), False)
check('Delete and recreate produces an ABA match on reused revision', solve(dict(r, **{'object_incarnation': ['g1', 'g2']})), False)
check('A create-only write replaces an existing object', solve(dict(r, **{'expected_existence': True})), False)
check('A conditional update performs an illegal lifecycle transition', solve(dict(r, **{'transition_allowed': [['closed', 'open'], [['open', 'closed']]]})), False)
check('A successful update fails to advance the revision', solve(dict(r, **{'revision_increment': [7, 7]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'revision_match': [6, 7], 'object_incarnation': ['g1', 'g2'], 'expected_existence': True, 'transition_allowed': [['closed', 'open'], [['open', 'closed']]], 'revision_increment': [7, 7]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The compare and swap operation is admitted even though a successful update fails to advance the revision.

Return a Boolean admission decision for apply a remote conditional state update. The record r must satisfy all of: r['revision_match'][0] == r['revision_match'][1]; r['object_incarnation'][0] == r['object_incarnation'][1]; r['expected_existence'] is False; tuple(r['transition_allowed'][0]) in [tuple(x) for x in r['transition_allowed'][1]]; r['revision_increment'][0] == r['revision_increment'][1]+1. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-distributed-transaction

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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The distributed transaction operation is admitted even though commit proceeds while a participant has not prepared.

Return a Boolean admission decision for commit a two-phase transaction. The record r must satisfy all of: all(x == 'prepared' for x in r['all_prepared']); 'abort' not in r['no_abort_vote']; r['decision_durable'] is True; set(r['participant_set'][0]) == set(r['participant_set'][1]); r['coordinator_epoch'][0] == r['coordinator_epoch'][1]. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-distributed-transaction

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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The distributed transaction operation is admitted even though a participant abort vote is ignored.

Return a Boolean admission decision for commit a two-phase transaction. The record r must satisfy all of: all(x == 'prepared' for x in r['all_prepared']); 'abort' not in r['no_abort_vote']; r['decision_durable'] is True; set(r['participant_set'][0]) == set(r['participant_set'][1]); r['coordinator_epoch'][0] == r['coordinator_epoch'][1]. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-distributed-transaction

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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The distributed transaction operation is admitted even though commit messages precede the durable coordinator decision.

Return a Boolean admission decision for commit a two-phase transaction. The record r must satisfy all of: all(x == 'prepared' for x in r['all_prepared']); 'abort' not in r['no_abort_vote']; r['decision_durable'] is True; set(r['participant_set'][0]) == set(r['participant_set'][1]); r['coordinator_epoch'][0] == r['coordinator_epoch'][1]. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-distributed-transaction

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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The distributed transaction operation is admitted even though a newly enlisted participant is omitted from the decision.

Return a Boolean admission decision for commit a two-phase transaction. The record r must satisfy all of: all(x == 'prepared' for x in r['all_prepared']); 'abort' not in r['no_abort_vote']; r['decision_durable'] is True; set(r['participant_set'][0]) == set(r['participant_set'][1]); r['coordinator_epoch'][0] == r['coordinator_epoch'][1]. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (all(x == 'prepared' for x in r['all_prepared'])) and ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-distributed-transaction

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

N = 1
observations = []
def solve(r):
    return ('abort' not in r['no_abort_vote']) and (r['decision_durable'] is True) and (set(r['participant_set'][0]) == set(r['participant_set'][1])) and (r['coordinator_epoch'][0] == r['coordinator_epoch'][1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'all_prepared': ['prepared', 'prepared'], 'no_abort_vote': ['yes', 'yes'], 'decision_durable': True, 'participant_set': [['a', 'b'], ['a', 'b']], 'coordinator_epoch': [5, 5]}
check('valid operation', solve(r), True)
check('Commit proceeds while a participant has not prepared', solve(dict(r, **{'all_prepared': ['prepared', 'working']})), False)
check('A participant abort vote is ignored', solve(dict(r, **{'no_abort_vote': ['yes', 'abort']})), False)
check('Commit messages precede the durable coordinator decision', solve(dict(r, **{'decision_durable': False})), False)
check('A newly enlisted participant is omitted from the decision', solve(dict(r, **{'participant_set': [['a', 'b'], ['a']]})), False)
check('A recovered coordinator accepts the prior instance decision', solve(dict(r, **{'coordinator_epoch': [4, 5]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'all_prepared': ['prepared', 'working'], 'no_abort_vote': ['yes', 'abort'], 'decision_durable': False, 'participant_set': [['a', 'b'], ['a']], 'coordinator_epoch': [4, 5]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The distributed transaction operation is admitted even though a recovered coordinator accepts the prior instance decision.

Return a Boolean admission decision for commit a two-phase transaction. The record r must satisfy all of: all(x == 'prepared' for x in r['all_prepared']); 'abort' not in r['no_abort_vote']; r['decision_durable'] is True; set(r['participant_set'][0]) == set(r['participant_set'][1]); r['coordinator_epoch'][0] == r['coordinator_epoch'][1]. Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-prepared-recovery

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

N = 1
observations = []
def solve(r):
    return (r['decision_known'] in ['commit','abort']) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The prepared recovery operation is admitted even though an uncertain participant guesses commit without evidence.

Return a Boolean admission decision for resolve a prepared participant after recovery. The record r must satisfy all of: r['decision_known'] in ['commit','abort']; r['transaction_identity'][0] == r['transaction_identity'][1]; r['prepare_record'] is True; r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]; set(r['locks_retained'][0]) <= set(r['locks_retained'][1]). Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['decision_known'] in ['commit','abort']) and (r['prepare_record'] is True) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-prepared-recovery

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

N = 1
observations = []
def solve(r):
    return (r['decision_known'] in ['commit','abort']) and (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The prepared recovery operation is admitted even though recovery applies another transaction decision.

Return a Boolean admission decision for resolve a prepared participant after recovery. The record r must satisfy all of: r['decision_known'] in ['commit','abort']; r['transaction_identity'][0] == r['transaction_identity'][1]; r['prepare_record'] is True; r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]; set(r['locks_retained'][0]) <= set(r['locks_retained'][1]). Extra tracing fields are ignored; validation does not mutate the record.

split: open-access


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

N = 1
observations = []
def solve(r):
    return (r['decision_known'] in ['commit','abort']) and (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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)

evaluation_group: xd-prepared-recovery

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

N = 1
observations = []
def solve(r):
    return (r['decision_known'] in ['commit','abort']) and (r['transaction_identity'][0] == r['transaction_identity'][1]) and (r['prepare_record'] is True) and (set(r['locks_retained'][0]) <= set(r['locks_retained'][1]))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'decision_known': 'commit', 'transaction_identity': ['t2', 't2'], 'prepare_record': True, 'decision_consistent': ['commit', 'commit'], 'locks_retained': [['k1'], ['k1', 'k2']]}
check('valid operation', solve(r), True)
check('An uncertain participant guesses commit without evidence', solve(dict(r, **{'decision_known': 'unknown'})), False)
check('Recovery applies another transaction decision', solve(dict(r, **{'transaction_identity': ['t1', 't2']})), False)
check('Recovery commits a transaction with no durable prepare record', solve(dict(r, **{'prepare_record': False})), False)
check('Recovery reverses a previously recorded final decision', solve(dict(r, **{'decision_consistent': ['abort', 'commit']})), False)
check('Prepared data becomes visible after losing its write locks', solve(dict(r, **{'locks_retained': [['k1'], ['k2']]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'decision_known': 'unknown', 'transaction_identity': ['t1', 't2'], 'prepare_record': False, 'decision_consistent': ['abort', 'commit'], 'locks_retained': [['k1'], ['k2']]}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), 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:
The prepared recovery operation is admitted even though recovery commits a transaction with no durable prepare record.

Return a Boolean admission decision for resolve a prepared participant after recovery. The record r must satisfy all of: r['decision_known'] in ['commit','abort']; r['transaction_identity'][0] == r['transaction_identity'][1]; r['prepare_record'] is True; r['decision_consistent'][0] is None or r['decision_consistent'][0] == r['decision_consistent'][1]; set(r['locks_retained'][0]) <= set(r['locks_retained'][1]). Extra tracing fields are ignored; validation does not mutate the record.

split: open-access