{"abstract":"A partial cache block is claimed as reusable.","category":"KV cache position mapping","checks":6,"contract":"Return the longest common token prefix length rounded down to a multiple of positive block_size.","contract_signature":"cached_tokens, requested_tokens, block_size","evaluation_group":"w3-kv-map-prefix-block-boundary","failed_approach":"Rounding up preserves more prefix tokens but references an incomplete block.","family":"w3-kv-cache-position-mapping-prefix-block-boundary","id":"FA-98636","implementations":{"attempt":{"sha256":"8212d8303336f183f303fa9c386a46a34629bae859ca02911ca4aba48462da3b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cached_tokens, requested_tokens, block_size):\n    common=0\n    while common<min(len(cached_tokens),len(requested_tokens)) and cached_tokens[common]==requested_tokens[common]: common+=1\n    return ((common+block_size-1)//block_size)*block_size\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial block',solve(['a']*N+['x'],['a']*N+['y'],4),(N//4)*4)\ncheck('exact boundary',solve(['a']*8,['a']*8,4),8)\ncheck('prefix shorter than block',solve(['a','b'],['a','b','c'],4),0)\ncheck('mismatch before boundary',solve(['a','b','x'],['a','b','y'],2),2)\ncheck('no match',solve(['x'],['y'],3),0)\ncheck('empty',solve([],['a'],2),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":"cb038460121d94c6a44b9de3f8ba03ad2a1cc9cbac9d7dc883712a4350b1f5c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(cached_tokens, requested_tokens, block_size):\n    return min(len(cached_tokens),len(requested_tokens))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('partial block',solve(['a']*N+['x'],['a']*N+['y'],4),(N//4)*4)\ncheck('exact boundary',solve(['a']*8,['a']*8,4),8)\ncheck('prefix shorter than block',solve(['a','b'],['a','b','c'],4),0)\ncheck('mismatch before boundary',solve(['a','b','x'],['a','b','y'],2),2)\ncheck('no match',solve(['x'],['y'],3),0)\ncheck('empty',solve([],['a'],2),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-prefix-block-boundary","generated_at":"2026-09-30T16:48:14.972213+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":"The shared token count is returned without respecting cache block granularity.","sha256":"a0b36f309b0ca75dbdb1f1852275a4daf546b6999064f6d979af9e5d3c31c19d","title":"Prefix reuse rounds down to complete cache blocks · 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":26.99,"exit_code":1,"observations":[{"actual":4,"check":"partial block","expected":0,"passed":false},{"actual":8,"check":"exact boundary","expected":8,"passed":true},{"actual":4,"check":"prefix shorter than block","expected":0,"passed":false},{"actual":2,"check":"mismatch before boundary","expected":2,"passed":true},{"actual":0,"check":"no match","expected":0,"passed":true},{"actual":0,"check":"empty","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial block\", \"actual\": 4, \"expected\": 0, \"passed\": false}, {\"check\": \"exact boundary\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"prefix shorter than block\", \"actual\": 4, \"expected\": 0, \"passed\": false}, {\"check\": \"mismatch before boundary\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"no match\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.551,"exit_code":1,"observations":[{"actual":2,"check":"partial block","expected":0,"passed":false},{"actual":8,"check":"exact boundary","expected":8,"passed":true},{"actual":2,"check":"prefix shorter than block","expected":0,"passed":false},{"actual":3,"check":"mismatch before boundary","expected":2,"passed":false},{"actual":1,"check":"no match","expected":0,"passed":false},{"actual":0,"check":"empty","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"partial block\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"exact boundary\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"prefix shorter than block\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"mismatch before boundary\", \"actual\": 3, \"expected\": 2, \"passed\": false}, {\"check\": \"no match\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"empty\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"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."}}