{"abstract":"Reservation starts at the head instead of the write cursor.","category":"Bounded deques","checks":6,"contract":"Reserve up to requested free positions in a reject-on-full ring. Return [grant,tail,first-span,second-span,free-after]. Head and size are valid, capacity positive.","evaluation_group":"s3-bounded-deques-ring-reservation","failed_approach":"The partial repair still applies the incorrect transition to an admitted boundary or multi-element case.","family":"s3-bounded-deques-ring-reservation-tail-origin","id":"FA-45851","implementations":{"attempt":{"sha256":"f5be97ce9de96942de6a80e581220d59afb23a30b2f54068b9f15db9fbd7ba89","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cap, head, size, requested = x\n    free = cap - size\n    grant = min(requested, free)\n    tail = (head + 1) % cap if size == 1 else head\n    first = min(grant, cap - tail)\n    second = grant - first\n    return [grant, tail, first, second, free - grant]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('wrapped free region', solve([N+5, N+3, 1, 3]), [3,N+4,1,2,N+1])\ncheck('limited free space', solve([N+5, 2, N+3, 4]), [2,0,2,0,0])\ncheck('empty shifted ring', solve([N+5,N+4,0,4]), [4,N+4,1,3,N+1])\ncheck('empty request', solve([N+5,1,2,0]), [0,3,0,0,N+3])\ncheck('full ring', solve([N+5,2,N+5,3]), [0,2,0,0,0])\ncheck('contiguous grant', solve([N+5,0,1,2]), [2,1,2,0,N+2])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"552ca8321389679488a60922a833f5f483e43d8202034f601a7a1853a601b682","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cap, head, size, requested = x\n    free = cap - size\n    grant = min(requested, free)\n    tail = head\n    first = min(grant, cap - tail)\n    second = grant - first\n    return [grant, tail, first, second, free - grant]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('wrapped free region', solve([N+5, N+3, 1, 3]), [3,N+4,1,2,N+1])\ncheck('limited free space', solve([N+5, 2, N+3, 4]), [2,0,2,0,0])\ncheck('empty shifted ring', solve([N+5,N+4,0,4]), [4,N+4,1,3,N+1])\ncheck('empty request', solve([N+5,1,2,0]), [0,3,0,0,N+3])\ncheck('full ring', solve([N+5,2,N+5,3]), [0,2,0,0,0])\ncheck('contiguous grant', solve([N+5,0,1,2]), [2,1,2,0,N+2])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"332a2660d47d9317be78811befb39cc107de6e34c3631bc80e3c9577273f7d39","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cap, head, size, requested = x\n    free = cap - size\n    grant = min(requested, free)\n    tail = (head + size) % cap\n    first = min(grant, cap - tail)\n    second = grant - first\n    return [grant, tail, first, second, free - grant]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('wrapped free region', solve([N+5, N+3, 1, 3]), [3,N+4,1,2,N+1])\ncheck('limited free space', solve([N+5, 2, N+3, 4]), [2,0,2,0,0])\ncheck('empty shifted ring', solve([N+5,N+4,0,4]), [4,N+4,1,3,N+1])\ncheck('empty request', solve([N+5,1,2,0]), [0,3,0,0,N+3])\ncheck('full ring', solve([N+5,2,N+5,3]), [0,2,0,0,0])\ncheck('contiguous grant', solve([N+5,0,1,2]), [2,1,2,0,N+2])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Offline finite deterministic model; no claim of production implementation or concurrent memory-model conformance. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-bounded-deques-ring-reservation-tail-origin","generated_at":"2026-09-29T14:44:26.404751+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Controlled bounded deque implementation model with explicit storage and lifecycle observations.","repair":"Restore the documented tail origin invariant in ring-reservation.","root_cause":"The read cursor is substituted for the end of the occupied arc.","sha256":"6a864f96baaf1391da234bfa381dee6d7e5d4a53a6b4922624f7356bd2d6b9f0","title":"Reservation starts at the head instead of the write cursor · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.348,"exit_code":1,"observations":[{"actual":[3,5,1,2,2],"check":"wrapped free region","expected":[3,5,1,2,2],"passed":true},{"actual":[2,2,2,0,0],"check":"limited free space","expected":[2,0,2,0,0],"passed":false},{"actual":[4,5,1,3,2],"check":"empty shifted ring","expected":[4,5,1,3,2],"passed":true},{"actual":[0,1,0,0,4],"check":"empty request","expected":[0,3,0,0,4],"passed":false},{"actual":[0,2,0,0,0],"check":"full ring","expected":[0,2,0,0,0],"passed":true},{"actual":[2,1,2,0,3],"check":"contiguous grant","expected":[2,1,2,0,3],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapped free region\", \"actual\": [3, 5, 1, 2, 2], \"expected\": [3, 5, 1, 2, 2], \"passed\": true}, {\"check\": \"limited free space\", \"actual\": [2, 2, 2, 0, 0], \"expected\": [2, 0, 2, 0, 0], \"passed\": false}, {\"check\": \"empty shifted ring\", \"actual\": [4, 5, 1, 3, 2], \"expected\": [4, 5, 1, 3, 2], \"passed\": true}, {\"check\": \"empty request\", \"actual\": [0, 1, 0, 0, 4], \"expected\": [0, 3, 0, 0, 4], \"passed\": false}, {\"check\": \"full ring\", \"actual\": [0, 2, 0, 0, 0], \"expected\": [0, 2, 0, 0, 0], \"passed\": true}, {\"check\": \"contiguous grant\", \"actual\": [2, 1, 2, 0, 3], \"expected\": [2, 1, 2, 0, 3], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.783,"exit_code":1,"observations":[{"actual":[3,4,2,1,2],"check":"wrapped free region","expected":[3,5,1,2,2],"passed":false},{"actual":[2,2,2,0,0],"check":"limited free space","expected":[2,0,2,0,0],"passed":false},{"actual":[4,5,1,3,2],"check":"empty shifted ring","expected":[4,5,1,3,2],"passed":true},{"actual":[0,1,0,0,4],"check":"empty request","expected":[0,3,0,0,4],"passed":false},{"actual":[0,2,0,0,0],"check":"full ring","expected":[0,2,0,0,0],"passed":true},{"actual":[2,0,2,0,3],"check":"contiguous grant","expected":[2,1,2,0,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapped free region\", \"actual\": [3, 4, 2, 1, 2], \"expected\": [3, 5, 1, 2, 2], \"passed\": false}, {\"check\": \"limited free space\", \"actual\": [2, 2, 2, 0, 0], \"expected\": [2, 0, 2, 0, 0], \"passed\": false}, {\"check\": \"empty shifted ring\", \"actual\": [4, 5, 1, 3, 2], \"expected\": [4, 5, 1, 3, 2], \"passed\": true}, {\"check\": \"empty request\", \"actual\": [0, 1, 0, 0, 4], \"expected\": [0, 3, 0, 0, 4], \"passed\": false}, {\"check\": \"full ring\", \"actual\": [0, 2, 0, 0, 0], \"expected\": [0, 2, 0, 0, 0], \"passed\": true}, {\"check\": \"contiguous grant\", \"actual\": [2, 0, 2, 0, 3], \"expected\": [2, 1, 2, 0, 3], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.069,"exit_code":0,"observations":[{"actual":[3,5,1,2,2],"check":"wrapped free region","expected":[3,5,1,2,2],"passed":true},{"actual":[2,0,2,0,0],"check":"limited free space","expected":[2,0,2,0,0],"passed":true},{"actual":[4,5,1,3,2],"check":"empty shifted ring","expected":[4,5,1,3,2],"passed":true},{"actual":[0,3,0,0,4],"check":"empty request","expected":[0,3,0,0,4],"passed":true},{"actual":[0,2,0,0,0],"check":"full ring","expected":[0,2,0,0,0],"passed":true},{"actual":[2,1,2,0,3],"check":"contiguous grant","expected":[2,1,2,0,3],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapped free region\", \"actual\": [3, 5, 1, 2, 2], \"expected\": [3, 5, 1, 2, 2], \"passed\": true}, {\"check\": \"limited free space\", \"actual\": [2, 0, 2, 0, 0], \"expected\": [2, 0, 2, 0, 0], \"passed\": true}, {\"check\": \"empty shifted ring\", \"actual\": [4, 5, 1, 3, 2], \"expected\": [4, 5, 1, 3, 2], \"passed\": true}, {\"check\": \"empty request\", \"actual\": [0, 3, 0, 0, 4], \"expected\": [0, 3, 0, 0, 4], \"passed\": true}, {\"check\": \"full ring\", \"actual\": [0, 2, 0, 0, 0], \"expected\": [0, 2, 0, 0, 0], \"passed\": true}, {\"check\": \"contiguous grant\", \"actual\": [2, 1, 2, 0, 3], \"expected\": [2, 1, 2, 0, 3], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}