FA-1546 / Concurrency / Open access
Steal a task from another worker deque: Work stealing exceeds the thief execution slots · case 01
The work steal operation is admitted even though work stealing exceeds the thief execution slots.
ROOT CAUSE
The admission path omits the thief capacity invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['thief_capacity'][0] < r['thief_capacity'][1] together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the thief capacity check repairs the reported defect, but replacing the adjacent task unstarted check loses that independent invariant.
Case contract
Return a Boolean admission decision for steal a task from another worker deque. The record r must satisfy all of: r['task_unstarted'] == 'queued'; r['deque_revision'][0] == r['deque_revision'][1]; set(r['capability_match'][0]) <= set(r['capability_match'][1]); r['locality_constraint'][0] is None or r['locality_constraint'][0] == r['locality_constraint'][1]; r['thief_capacity'][0] < r['thief_capacity'][1]. Extra tracing fields are ignored; validation does not mutate the record.
Why this case matters
A deterministic local contract for concurrency. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['task_unstarted'] == 'queued') and (r['deque_revision'][0] == r['deque_revision'][1]) and (set(r['capability_match'][0]) <= set(r['capability_match'][1])) and (r['locality_constraint'][0] is None or r['locality_constraint'][0] == r['locality_constraint'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'task_unstarted': 'queued', 'deque_revision': [10, 10], 'capability_match': [['gpu'], ['gpu', 'cpu']], 'locality_constraint': ['z1', 'z1'], 'thief_capacity': [2, 3]}
check('valid operation', solve(r), True)
check('A thief executes a task already started by its owner', solve(dict(r, **{'task_unstarted': 'running'})), False)
check('A thief uses a deque position after the deque changed', solve(dict(r, **{'deque_revision': [9, 10]})), False)
check('A worker steals a task requiring unsupported capabilities', solve(dict(r, **{'capability_match': [['gpu'], ['cpu']]})), False)
check('A pinned task leaves its required execution locality', solve(dict(r, **{'locality_constraint': ['z1', 'z2']})), False)
check('Work stealing exceeds the thief execution slots', solve(dict(r, **{'thief_capacity': [3, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'task_unstarted': 'running', 'deque_revision': [9, 10], 'capability_match': [['gpu'], ['cpu']], 'locality_constraint': ['z1', 'z2'], 'thief_capacity': [3, 3]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A thief executes a task already started by its owner | False | False | Passed |
| A thief uses a deque position after the deque changed | False | False | Passed |
| A worker steals a task requiring unsupported capabilities | False | False | Passed |
| A pinned task leaves its required execution locality | False | False | Passed |
| Work stealing exceeds the thief execution slots | True | False | Failed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 739bab102aa9a18d1d0ed79b41e83a165776134e6bef3d40e87cf5ce57680741
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['deque_revision'][0] == r['deque_revision'][1]) and (set(r['capability_match'][0]) <= set(r['capability_match'][1])) and (r['locality_constraint'][0] is None or r['locality_constraint'][0] == r['locality_constraint'][1]) and (r['thief_capacity'][0] < r['thief_capacity'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'task_unstarted': 'queued', 'deque_revision': [10, 10], 'capability_match': [['gpu'], ['gpu', 'cpu']], 'locality_constraint': ['z1', 'z1'], 'thief_capacity': [2, 3]}
check('valid operation', solve(r), True)
check('A thief executes a task already started by its owner', solve(dict(r, **{'task_unstarted': 'running'})), False)
check('A thief uses a deque position after the deque changed', solve(dict(r, **{'deque_revision': [9, 10]})), False)
check('A worker steals a task requiring unsupported capabilities', solve(dict(r, **{'capability_match': [['gpu'], ['cpu']]})), False)
check('A pinned task leaves its required execution locality', solve(dict(r, **{'locality_constraint': ['z1', 'z2']})), False)
check('Work stealing exceeds the thief execution slots', solve(dict(r, **{'thief_capacity': [3, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'task_unstarted': 'running', 'deque_revision': [9, 10], 'capability_match': [['gpu'], ['cpu']], 'locality_constraint': ['z1', 'z2'], 'thief_capacity': [3, 3]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A thief executes a task already started by its owner | True | False | Failed |
| A thief uses a deque position after the deque changed | False | False | Passed |
| A worker steals a task requiring unsupported capabilities | False | False | Passed |
| A pinned task leaves its required execution locality | False | False | Passed |
| Work stealing exceeds the thief execution slots | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 655110110611e623f82926d14feef4ad68ccb8d5f6539248bbb2fc70e2e05d9b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['task_unstarted'] == 'queued') and (r['deque_revision'][0] == r['deque_revision'][1]) and (set(r['capability_match'][0]) <= set(r['capability_match'][1])) and (r['locality_constraint'][0] is None or r['locality_constraint'][0] == r['locality_constraint'][1]) and (r['thief_capacity'][0] < r['thief_capacity'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'task_unstarted': 'queued', 'deque_revision': [10, 10], 'capability_match': [['gpu'], ['gpu', 'cpu']], 'locality_constraint': ['z1', 'z1'], 'thief_capacity': [2, 3]}
check('valid operation', solve(r), True)
check('A thief executes a task already started by its owner', solve(dict(r, **{'task_unstarted': 'running'})), False)
check('A thief uses a deque position after the deque changed', solve(dict(r, **{'deque_revision': [9, 10]})), False)
check('A worker steals a task requiring unsupported capabilities', solve(dict(r, **{'capability_match': [['gpu'], ['cpu']]})), False)
check('A pinned task leaves its required execution locality', solve(dict(r, **{'locality_constraint': ['z1', 'z2']})), False)
check('Work stealing exceeds the thief execution slots', solve(dict(r, **{'thief_capacity': [3, 3]})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'task_unstarted': 'running', 'deque_revision': [9, 10], 'capability_match': [['gpu'], ['cpu']], 'locality_constraint': ['z1', 'z2'], 'thief_capacity': [3, 3]}
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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A thief executes a task already started by its owner | False | False | Passed |
| A thief uses a deque position after the deque changed | False | False | Passed |
| A worker steals a task requiring unsupported capabilities | False | False | Passed |
| A pinned task leaves its required execution locality | False | False | Passed |
| Work stealing exceeds the thief execution slots | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / dee7b72dcd9a63402bc4b8fdb78bcda7d827bb35300feceaf98b64192a4a9ed0
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:37:03.596880+00:00.
Case digest / 4cf50f87fe6921310cb7de0d7af01ae382f6bf0d88162a1dee1ec917bf29ac79