{"abstract":"Weighted pooling normalizes token vectors before combining them.","category":"Embedding vector normalization","checks":6,"contract":"Return the L2-unit direction of the weighted mean; zero total weight or a zero pooled vector returns empty.","contract_signature":"vectors, weights","evaluation_group":"embedding-weighted-pool-then-unit","failed_approach":"Returning the weighted mean without a final unit-length step leaves a nonunit pooled vector.","family":"w3-embedding-vector-normalization-unit-after-weighted-pool","id":"FA-99386","implementations":{"attempt":{"sha256":"442299ecbb532c438db08e450c7ae19e056323086b1a5b848adb9fed4454161d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(vectors, weights):\n    p=[sum(w*v[j] for v,w in zip(vectors,weights)) for j in range(len(vectors[0]))] if vectors else []\n    return [x/sum(weights) for x in p] if p and sum(weights) else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('magnitudes matter', solve([[N,0],[0,3*N]],[1,1]), [1/10**0.5,3/10**0.5])\ncheck('weighted direction', solve([[N,N],[0,N]],[3,1]), [0.6,0.8])\ncheck('zero total', solve([[N],[2*N]],[0,0]), [])\ncheck('empty', solve([],[]), [])\ncheck('cancels', solve([[N],[-N]],[1,1]), [])\ncheck('singleton', solve([[3*N,4*N]],[N]), [0.6,0.8])\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":"ecd81a1f1f06c8d4ccb9b0d08f8ab52b34ae6929ba9cd8d98615b7a40535ad94","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(vectors, weights):\n    return [sum(w*v[j]/(sum(x*x for x in v)**0.5) for v,w in zip(vectors,weights))/sum(weights) for j in range(len(vectors[0]))] if vectors and sum(weights) else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('magnitudes matter', solve([[N,0],[0,3*N]],[1,1]), [1/10**0.5,3/10**0.5])\ncheck('weighted direction', solve([[N,N],[0,N]],[3,1]), [0.6,0.8])\ncheck('zero total', solve([[N],[2*N]],[0,0]), [])\ncheck('empty', solve([],[]), [])\ncheck('cancels', solve([[N],[-N]],[1,1]), [])\ncheck('singleton', solve([[3*N,4*N]],[N]), [0.6,0.8])\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":"Inputs are finite toy vectors or token rows; this contract makes no claim about model quality or production embedding behavior. 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-embedding-vector-normalization-unit-after-weighted-pool","generated_at":"2026-09-30T16:48:23.555102+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small embedding preparation contract can be checked without a model or retrieval system.","root_cause":"Each token is normalized before weighting, which discards the supplied token magnitudes.","sha256":"7fd98672d7ce8326379a27cf198cb6c48336433056b588ecacbe6e64eb70a233","title":"Weighted pooling normalizes token vectors before combining them · 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":32.952,"exit_code":1,"observations":[{"actual":[0.5,1.5],"check":"magnitudes matter","expected":[0.31622776601683794,0.9486832980505138],"passed":false},{"actual":[0.75,1.0],"check":"weighted direction","expected":[0.6,0.8],"passed":false},{"actual":[],"check":"zero total","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0.0],"check":"cancels","expected":[],"passed":false},{"actual":[3.0,4.0],"check":"singleton","expected":[0.6,0.8],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"magnitudes matter\", \"actual\": [0.5, 1.5], \"expected\": [0.31622776601683794, 0.9486832980505138], \"passed\": false}, {\"check\": \"weighted direction\", \"actual\": [0.75, 1.0], \"expected\": [0.6, 0.8], \"passed\": false}, {\"check\": \"zero total\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"cancels\", \"actual\": [0.0], \"expected\": [], \"passed\": false}, {\"check\": \"singleton\", \"actual\": [3.0, 4.0], \"expected\": [0.6, 0.8], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":30.411,"exit_code":1,"observations":[{"actual":[0.5,0.5],"check":"magnitudes matter","expected":[0.31622776601683794,0.9486832980505138],"passed":false},{"actual":[0.5303300858899106,0.7803300858899106],"check":"weighted direction","expected":[0.6,0.8],"passed":false},{"actual":[],"check":"zero total","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[0.0],"check":"cancels","expected":[],"passed":false},{"actual":[0.6,0.8],"check":"singleton","expected":[0.6,0.8],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"magnitudes matter\", \"actual\": [0.5, 0.5], \"expected\": [0.31622776601683794, 0.9486832980505138], \"passed\": false}, {\"check\": \"weighted direction\", \"actual\": [0.5303300858899106, 0.7803300858899106], \"expected\": [0.6, 0.8], \"passed\": false}, {\"check\": \"zero total\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"cancels\", \"actual\": [0.0], \"expected\": [], \"passed\": false}, {\"check\": \"singleton\", \"actual\": [0.6, 0.8], \"expected\": [0.6, 0.8], \"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."}}