{"abstract":"Weighted pooling divides by token count.","category":"Embedding vector normalization","checks":6,"contract":"Pool equal-width vectors with nonnegative weights into a weighted mean; total weight zero or no vectors returns empty.","contract_signature":"vectors, weights","evaluation_group":"embedding-weighted-mean-pooling","failed_approach":"Dividing by the number of vectors is only correct when weights sum to that count.","family":"w3-embedding-vector-normalization-weighted-mean-pooling","id":"FA-99366","implementations":{"attempt":{"sha256":"82cf7bf7535ea1abe512f6caf6b3372f3ff51b44e913f1ccb269513250f3b1ea","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] for v,w in zip(vectors,weights))/len(vectors) for j in range(len(vectors[0]))] if vectors else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('unequal weights', solve([[0,N],[N,2*N]],[1,3]), [3*N/4,7*N/4])\ncheck('equal weights', solve([[N,0],[0,N]],[1,1]), [N/2,N/2])\ncheck('zero total', solve([[N],[2*N]],[0,0]), [])\ncheck('empty rows', solve([],[]), [])\ncheck('one vector', solve([[N,2*N]],[N]), [N,2*N])\ncheck('weighted zero vector', solve([[0,N],[2*N,0]],[0,1]), [2*N,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":"15934326bc3ff8357e02746e19ce524292aaeff8dfb989bb643a21a201273ba9","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] for v,w in zip(vectors,weights)) for j in range(len(vectors[0]))] if vectors else []\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('unequal weights', solve([[0,N],[N,2*N]],[1,3]), [3*N/4,7*N/4])\ncheck('equal weights', solve([[N,0],[0,N]],[1,1]), [N/2,N/2])\ncheck('zero total', solve([[N],[2*N]],[0,0]), [])\ncheck('empty rows', solve([],[]), [])\ncheck('one vector', solve([[N,2*N]],[N]), [N,2*N])\ncheck('weighted zero vector', solve([[0,N],[2*N,0]],[0,1]), [2*N,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":"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-weighted-mean-pooling","generated_at":"2026-09-30T16:48:23.555583+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":"Weighted vector contributions are summed but the total weight is ignored.","sha256":"ee2bacd62414b1563c9b4b94333d6cba5e4e9be6ac8996b36335048bddfc5781","title":"Weighted pooling divides by token count · 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.295,"exit_code":1,"observations":[{"actual":[1.5,3.5],"check":"unequal weights","expected":[0.75,1.75],"passed":false},{"actual":[0.5,0.5],"check":"equal weights","expected":[0.5,0.5],"passed":true},{"actual":[0.0],"check":"zero total","expected":[],"passed":false},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[1.0,2.0],"check":"one vector","expected":[1,2],"passed":true},{"actual":[1.0,0.0],"check":"weighted zero vector","expected":[2,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal weights\", \"actual\": [1.5, 3.5], \"expected\": [0.75, 1.75], \"passed\": false}, {\"check\": \"equal weights\", \"actual\": [0.5, 0.5], \"expected\": [0.5, 0.5], \"passed\": true}, {\"check\": \"zero total\", \"actual\": [0.0], \"expected\": [], \"passed\": false}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one vector\", \"actual\": [1.0, 2.0], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"weighted zero vector\", \"actual\": [1.0, 0.0], \"expected\": [2, 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":32.008,"exit_code":1,"observations":[{"actual":[3,7],"check":"unequal weights","expected":[0.75,1.75],"passed":false},{"actual":[1,1],"check":"equal weights","expected":[0.5,0.5],"passed":false},{"actual":[0],"check":"zero total","expected":[],"passed":false},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":[1,2],"check":"one vector","expected":[1,2],"passed":true},{"actual":[2,0],"check":"weighted zero vector","expected":[2,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal weights\", \"actual\": [3, 7], \"expected\": [0.75, 1.75], \"passed\": false}, {\"check\": \"equal weights\", \"actual\": [1, 1], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"zero total\", \"actual\": [0], \"expected\": [], \"passed\": false}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one vector\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"weighted zero vector\", \"actual\": [2, 0], \"expected\": [2, 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."}}