{"abstract":"A cache write past the final slot escapes the circular buffer.","category":"KV cache position mapping","checks":6,"contract":"Map each inclusive logical position to (position, (slot_origin + position - logical_origin) modulo capacity). Capacity is positive.","contract_signature":"logical_origin, slot_origin, capacity, end","evaluation_group":"w3-kv-map-ring-write-address","failed_approach":"Wrapping the absolute position ignores the ring’s logical origin.","family":"w3-kv-cache-position-mapping-ring-write-address","id":"FA-98546","implementations":{"attempt":{"sha256":"0afc78bec9ab04052815d718ac030534de33a2a78f1cca0fe221513cf3e45cc4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(logical_origin, slot_origin, capacity, end):\n    return [(p, p%capacity) for p in range(logical_origin,end+1)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('wrap once',solve(10,2,4,12),[(10,2),(11,3),(12,0)])\ncheck('wrap twice',solve(0,1,3,6),[(0,1),(1,2),(2,0),(3,1),(4,2),(5,0),(6,1)])\ncheck('capacity one',solve(N,0,1,N+2),[(N,0),(N+1,0),(N+2,0)])\ncheck('no wrap',solve(5,3,8,7),[(5,3),(6,4),(7,5)])\ncheck('empty append',solve(4,2,5,3),[])\ncheck('nonzero slot origin wrap',solve(20,7,5,24),[(20,2),(21,3),(22,4),(23,0),(24,1)])\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":"546bceec60c4e594aa8b4867f13d395c7739de749da3627429c1ee2eb2fcc5cb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(logical_origin, slot_origin, capacity, end):\n    return [(p, slot_origin+p-logical_origin) for p in range(logical_origin,end+1)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('wrap once',solve(10,2,4,12),[(10,2),(11,3),(12,0)])\ncheck('wrap twice',solve(0,1,3,6),[(0,1),(1,2),(2,0),(3,1),(4,2),(5,0),(6,1)])\ncheck('capacity one',solve(N,0,1,N+2),[(N,0),(N+1,0),(N+2,0)])\ncheck('no wrap',solve(5,3,8,7),[(5,3),(6,4),(7,5)])\ncheck('empty append',solve(4,2,5,3),[])\ncheck('nonzero slot origin wrap',solve(20,7,5,24),[(20,2),(21,3),(22,4),(23,0),(24,1)])\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-ring-write-address","generated_at":"2026-09-30T16:48:14.105442+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 mapper computes a linear address and never wraps it.","sha256":"3bd92de0fc83706af073702c939918b4f914ede3d898b583012ca36f4ad223a3","title":"Ring writes wrap at capacity · 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.256,"exit_code":1,"observations":[{"actual":[[10,2],[11,3],[12,0]],"check":"wrap once","expected":[[10,2],[11,3],[12,0]],"passed":true},{"actual":[[0,0],[1,1],[2,2],[3,0],[4,1],[5,2],[6,0]],"check":"wrap twice","expected":[[0,1],[1,2],[2,0],[3,1],[4,2],[5,0],[6,1]],"passed":false},{"actual":[[1,0],[2,0],[3,0]],"check":"capacity one","expected":[[1,0],[2,0],[3,0]],"passed":true},{"actual":[[5,5],[6,6],[7,7]],"check":"no wrap","expected":[[5,3],[6,4],[7,5]],"passed":false},{"actual":[],"check":"empty append","expected":[],"passed":true},{"actual":[[20,0],[21,1],[22,2],[23,3],[24,4]],"check":"nonzero slot origin wrap","expected":[[20,2],[21,3],[22,4],[23,0],[24,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrap once\", \"actual\": [[10, 2], [11, 3], [12, 0]], \"expected\": [[10, 2], [11, 3], [12, 0]], \"passed\": true}, {\"check\": \"wrap twice\", \"actual\": [[0, 0], [1, 1], [2, 2], [3, 0], [4, 1], [5, 2], [6, 0]], \"expected\": [[0, 1], [1, 2], [2, 0], [3, 1], [4, 2], [5, 0], [6, 1]], \"passed\": false}, {\"check\": \"capacity one\", \"actual\": [[1, 0], [2, 0], [3, 0]], \"expected\": [[1, 0], [2, 0], [3, 0]], \"passed\": true}, {\"check\": \"no wrap\", \"actual\": [[5, 5], [6, 6], [7, 7]], \"expected\": [[5, 3], [6, 4], [7, 5]], \"passed\": false}, {\"check\": \"empty append\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"nonzero slot origin wrap\", \"actual\": [[20, 0], [21, 1], [22, 2], [23, 3], [24, 4]], \"expected\": [[20, 2], [21, 3], [22, 4], [23, 0], [24, 1]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.318,"exit_code":1,"observations":[{"actual":[[10,2],[11,3],[12,4]],"check":"wrap once","expected":[[10,2],[11,3],[12,0]],"passed":false},{"actual":[[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7]],"check":"wrap twice","expected":[[0,1],[1,2],[2,0],[3,1],[4,2],[5,0],[6,1]],"passed":false},{"actual":[[1,0],[2,1],[3,2]],"check":"capacity one","expected":[[1,0],[2,0],[3,0]],"passed":false},{"actual":[[5,3],[6,4],[7,5]],"check":"no wrap","expected":[[5,3],[6,4],[7,5]],"passed":true},{"actual":[],"check":"empty append","expected":[],"passed":true},{"actual":[[20,7],[21,8],[22,9],[23,10],[24,11]],"check":"nonzero slot origin wrap","expected":[[20,2],[21,3],[22,4],[23,0],[24,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wrap once\", \"actual\": [[10, 2], [11, 3], [12, 4]], \"expected\": [[10, 2], [11, 3], [12, 0]], \"passed\": false}, {\"check\": \"wrap twice\", \"actual\": [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]], \"expected\": [[0, 1], [1, 2], [2, 0], [3, 1], [4, 2], [5, 0], [6, 1]], \"passed\": false}, {\"check\": \"capacity one\", \"actual\": [[1, 0], [2, 1], [3, 2]], \"expected\": [[1, 0], [2, 0], [3, 0]], \"passed\": false}, {\"check\": \"no wrap\", \"actual\": [[5, 3], [6, 4], [7, 5]], \"expected\": [[5, 3], [6, 4], [7, 5]], \"passed\": true}, {\"check\": \"empty append\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"nonzero slot origin wrap\", \"actual\": [[20, 7], [21, 8], [22, 9], [23, 10], [24, 11]], \"expected\": [[20, 2], [21, 3], [22, 4], [23, 0], [24, 1]], \"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."}}