{"abstract":"Reservation treats a wrapping region as contiguous.","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-first-span","id":"FA-45856","implementations":{"attempt":{"sha256":"a2ac766d0048682a3b03b532e41e396f31d7f5d73e5de41129887ec25426bf94","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) if tail else grant\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":"1f5561063a0ad28502355c22a358863b8b7c090fe2914151fb461de088963c0b","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 = grant\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-first-span","generated_at":"2026-09-29T14:44:26.445331+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 first span invariant in ring-reservation.","root_cause":"The physical array boundary is omitted from the first contiguous span.","sha256":"84f27e85ecd3334e8c5bc35f88667b84654f390d1d9fb38101f57fcd302e2d72","title":"Reservation treats a wrapping region as contiguous · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.431,"exit_code":1,"observations":[{"actual":[3,5,3,0,2],"check":"wrapped free region","expected":[3,5,1,2,2],"passed":false},{"actual":[2,0,2,0,0],"check":"limited free space","expected":[2,0,2,0,0],"passed":true},{"actual":[4,5,4,0,2],"check":"empty shifted ring","expected":[4,5,1,3,2],"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapped free region\", \"actual\": [3, 5, 3, 0, 2], \"expected\": [3, 5, 1, 2, 2], \"passed\": false}, {\"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, 4, 0, 2], \"expected\": [4, 5, 1, 3, 2], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":39.772,"exit_code":1,"observations":[{"actual":[3,5,3,0,2],"check":"wrapped free region","expected":[3,5,1,2,2],"passed":false},{"actual":[2,0,2,0,0],"check":"limited free space","expected":[2,0,2,0,0],"passed":true},{"actual":[4,5,4,0,2],"check":"empty shifted ring","expected":[4,5,1,3,2],"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrapped free region\", \"actual\": [3, 5, 3, 0, 2], \"expected\": [3, 5, 1, 2, 2], \"passed\": false}, {\"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, 4, 0, 2], \"expected\": [4, 5, 1, 3, 2], \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":41.788,"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"}