{"abstract":"A request that does not fit partially consumes free cache slots.","category":"KV cache position mapping","checks":7,"contract":"Return the requested count if it fits in capacity-used, else zero; never return a partial count.","contract_signature":"capacity, used, requested","evaluation_group":"w3-kv-map-atomic-capacity-admission","failed_approach":"Comparing the request to total capacity ignores slots already occupied and can admit too many tokens.","family":"w3-kv-cache-position-mapping-atomic-capacity-admission","id":"FA-98626","implementations":{"attempt":{"sha256":"a5c2b9696eb36f7c6302d0740d7a2dc55b0bf6e77e19301345381e84275301d9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(capacity, used, requested):\n    return requested if requested<=capacity else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fits exactly',solve(N+3,N,N+3-N),N+3-N)\ncheck('one free short',solve(N+3,N+1,3),0)\ncheck('partial would fit',solve(5,3,4),0)\ncheck('empty append',solve(5,3,0),0)\ncheck('empty cache',solve(N,0,N),N)\ncheck('full cache',solve(N,N,1),0)\ncheck('negative request',solve(5,0,-1),0)\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":"f0d709fa59ddb71be57562a4d7a7f871b1839700a6ccbef359a072b083c69be7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(capacity, used, requested):\n    return min(requested,capacity-used)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fits exactly',solve(N+3,N,N+3-N),N+3-N)\ncheck('one free short',solve(N+3,N+1,3),0)\ncheck('partial would fit',solve(5,3,4),0)\ncheck('empty append',solve(5,3,0),0)\ncheck('empty cache',solve(N,0,N),N)\ncheck('full cache',solve(N,N,1),0)\ncheck('negative request',solve(5,0,-1),0)\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":"These toy integer maps omit tensor layout, concurrency, device memory, and model-specific cache formats. 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":"w3-kv-cache-position-mapping-atomic-capacity-admission","generated_at":"2026-09-30T16:48:14.972284+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small in-memory model makes the cache address contract explicit for a serving component.","root_cause":"Each token is admitted independently before the full sequence capacity is known.","sha256":"4e01a54efd3e9e4a8d2d8d6392e2cb30cb3826fa2bf71bd0f4afebdc3e1ff4df","title":"Multi-token append reserves capacity atomically · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.018,"exit_code":1,"observations":[{"actual":3,"check":"fits exactly","expected":3,"passed":true},{"actual":3,"check":"one free short","expected":0,"passed":false},{"actual":4,"check":"partial would fit","expected":0,"passed":false},{"actual":0,"check":"empty append","expected":0,"passed":true},{"actual":1,"check":"empty cache","expected":1,"passed":true},{"actual":1,"check":"full cache","expected":0,"passed":false},{"actual":-1,"check":"negative request","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fits exactly\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"one free short\", \"actual\": 3, \"expected\": 0, \"passed\": false}, {\"check\": \"partial would fit\", \"actual\": 4, \"expected\": 0, \"passed\": false}, {\"check\": \"empty append\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"empty cache\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"full cache\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"negative request\", \"actual\": -1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.79,"exit_code":1,"observations":[{"actual":3,"check":"fits exactly","expected":3,"passed":true},{"actual":2,"check":"one free short","expected":0,"passed":false},{"actual":2,"check":"partial would fit","expected":0,"passed":false},{"actual":0,"check":"empty append","expected":0,"passed":true},{"actual":1,"check":"empty cache","expected":1,"passed":true},{"actual":0,"check":"full cache","expected":0,"passed":true},{"actual":-1,"check":"negative request","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fits exactly\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"one free short\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"partial would fit\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"empty append\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"empty cache\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"full cache\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative request\", \"actual\": -1, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}