FAILURE MAP
← Case archive

FA-1536 / Concurrency / Open access

Steal a task from another worker deque: A worker steals a task requiring unsupported capabilities · case 01

The work steal operation is admitted even though a worker steals a task requiring unsupported capabilities.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The admission path omits the capability match invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require set(r['capability_match'][0]) <= set(r['capability_match'][1]) together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the capability match check repairs the reported defect, but replacing the adjacent locality constraint 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 (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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A thief executes a task already started by its ownerFalseFalsePassed
A thief uses a deque position after the deque changedFalseFalsePassed
A worker steals a task requiring unsupported capabilitiesTrueFalseFailed
A pinned task leaves its required execution localityFalseFalsePassed
Work stealing exceeds the thief execution slotsFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / bcc929099da8945e58c09e41bdbf2242972fc2106cda73edc2b4f68c7a34d949

2 / The unsuccessful fix

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['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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A thief executes a task already started by its ownerFalseFalsePassed
A thief uses a deque position after the deque changedFalseFalsePassed
A worker steals a task requiring unsupported capabilitiesFalseFalsePassed
A pinned task leaves its required execution localityTrueFalseFailed
Work stealing exceeds the thief execution slotsFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / eb178dffc6ef8966b6b2ba687edec91942621c2841ed515ac2148128ecce8bed

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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A thief executes a task already started by its ownerFalseFalsePassed
A thief uses a deque position after the deque changedFalseFalsePassed
A worker steals a task requiring unsupported capabilitiesFalseFalsePassed
A pinned task leaves its required execution localityFalseFalsePassed
Work stealing exceeds the thief execution slotsFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

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.052654+00:00.

Case digest / bc54e4ae39665b680f7d87935c3f70ae5bd57685af81d17dd90f8a51a1c55029