{"abstract":"A new packed sequence inherits the prior segment’s final position.","category":"KV cache position mapping","checks":6,"contract":"Given one segment ID per token, assign positions starting at zero within each contiguous segment run.","contract_signature":"segments","evaluation_group":"w3-kv-map-packed-sequence-position","failed_approach":"Counting positions by segment ID merges separated runs that reuse the same ID.","family":"w3-kv-cache-position-mapping-packed-sequence-position","id":"FA-98576","implementations":{"attempt":{"sha256":"d5baccaf4c70cdd0f094c6e0db752a5eb7e3bfb1d84b060dc88e7cf9aac0dbe6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(segments):\n    out=[]; counts={}\n    for s in segments:\n        out.append(counts.get(s,0)); counts[s]=counts.get(s,0)+1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two segments',solve(['a']*N+['b']*2),list(range(N))+[0,1])\ncheck('alternating runs',solve(['a','b','a']),[0,0,0])\ncheck('same run',solve(['x']*3),[0,1,2])\ncheck('empty',solve([]),[])\ncheck('single segment',solve(['q']),[0])\ncheck('repeated after intervening segment',solve([1,1,2,1]),[0,1,0,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":"b2181f97252868308aba4f6a354ec834a6ede8c1a6cf7ea0b64a096123ea9932","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(segments):\n    return list(range(len(segments)))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two segments',solve(['a']*N+['b']*2),list(range(N))+[0,1])\ncheck('alternating runs',solve(['a','b','a']),[0,0,0])\ncheck('same run',solve(['x']*3),[0,1,2])\ncheck('empty',solve([]),[])\ncheck('single segment',solve(['q']),[0])\ncheck('repeated after intervening segment',solve([1,1,2,1]),[0,1,0,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-packed-sequence-position","generated_at":"2026-09-30T16:48:14.544856+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":"Position IDs are generated over the flattened row without segment awareness.","sha256":"d5ab8ee91fdfed24f8fde4b7d00a2f8f4e1488dbd6232f9c4111c523532d97c9","title":"Packed segments reset logical positions at boundaries · 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.63,"exit_code":1,"observations":[{"actual":[0,0,1],"check":"two segments","expected":[0,0,1],"passed":true},{"actual":[0,0,1],"check":"alternating runs","expected":[0,0,0],"passed":false},{"actual":[0,1,2],"check":"same run","expected":[0,1,2],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0],"check":"single segment","expected":[0],"passed":true},{"actual":[0,1,0,2],"check":"repeated after intervening segment","expected":[0,1,0,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two segments\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 1], \"passed\": true}, {\"check\": \"alternating runs\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 0], \"passed\": false}, {\"check\": \"same run\", \"actual\": [0, 1, 2], \"expected\": [0, 1, 2], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single segment\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"repeated after intervening segment\", \"actual\": [0, 1, 0, 2], \"expected\": [0, 1, 0, 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.444,"exit_code":1,"observations":[{"actual":[0,1,2],"check":"two segments","expected":[0,0,1],"passed":false},{"actual":[0,1,2],"check":"alternating runs","expected":[0,0,0],"passed":false},{"actual":[0,1,2],"check":"same run","expected":[0,1,2],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0],"check":"single segment","expected":[0],"passed":true},{"actual":[0,1,2,3],"check":"repeated after intervening segment","expected":[0,1,0,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two segments\", \"actual\": [0, 1, 2], \"expected\": [0, 0, 1], \"passed\": false}, {\"check\": \"alternating runs\", \"actual\": [0, 1, 2], \"expected\": [0, 0, 0], \"passed\": false}, {\"check\": \"same run\", \"actual\": [0, 1, 2], \"expected\": [0, 1, 2], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single segment\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"repeated after intervening segment\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 0, 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."}}