{"abstract":"The reduction disagrees with its explicit aggregation oracle.","category":"Numerical aggregation","checks":8,"contract":"Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.","contract_signature":"a, b","evaluation_group":"s3-na-frequency-cosine-squared","failed_approach":"Sorting frequencies independently destroys label alignment.","family":"s3-numerical-aggregation-frequency-cosine-squared-cosine-coincidental-order","id":"FA-14146","implementations":{"attempt":{"sha256":"d7b40122b1d13e96fe7d4abc4a199fad05a19d03ea3d238c9f4deca776f5f2b6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(a, b):\n    ca,cb=Counter(a),Counter(b)\n    keys=set(ca)|set(cb)\n    dot=sum(x*y for x,y in zip(sorted(ca.values()),sorted(cb.values())))\n    na=sum(v*v for v in ca.values())\n    nb=sum(v*v for v in cb.values())\n    return str(Fraction(dot*dot,na*nb)) if na and nb else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')\ncheck('regression 2', solve(*([1, 2], [1, 2])), '1')\ncheck('regression 3', solve(*([], [])), None)\ncheck('regression 4', solve(*([0], [1])), '0')\ncheck('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')\ncheck('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')\ncheck('regression 7', solve(*([2, 2], [])), None)\ncheck(\"variable cosine concentration\",solve([0]*N+[1],[0]),str(Fraction(N*N,N*N+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":"759a472c67dab9418e883107f868098fb54540ce7b4d01c35e1bc0254184bf79","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nfrom collections import Counter, defaultdict\nimport math\nimport itertools\nN = 1\nobservations = []\ndef solve(a, b):\n    ca,cb=Counter(a),Counter(b)\n    keys=set(ca)|set(cb)\n    dot=sum(x*y for x,y in zip(ca.values(),cb.values()))\n    na=sum(v*v for v in ca.values())\n    nb=sum(v*v for v in cb.values())\n    return str(Fraction(dot*dot,na*nb)) if na and nb else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')\ncheck('regression 2', solve(*([1, 2], [1, 2])), '1')\ncheck('regression 3', solve(*([], [])), None)\ncheck('regression 4', solve(*([0], [1])), '0')\ncheck('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')\ncheck('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')\ncheck('regression 7', solve(*([2, 2], [])), None)\ncheck(\"variable cosine concentration\",solve([0]*N+[1],[0]),str(Fraction(N*N,N*N+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":"Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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":"s3-numerical-aggregation-frequency-cosine-squared-cosine-coincidental-order","generated_at":"2026-09-29T14:39:14.060407+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact bounded examples isolate a reduction defect without floating-point or external-service effects.","root_cause":"Frequency vectors are dotted by insertion order rather than matching labels.","sha256":"7d874cd06ddb66a1dbdd973db72b4f3420b2577bd0341468e6f0a663557ce7bf","title":"Frequency cosine squared: Frequency vectors are dotted by insertion order rather than matching labels. · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.444,"exit_code":1,"observations":[{"actual":"1","check":"regression 1","expected":"16/25","passed":false},{"actual":"1","check":"regression 2","expected":"1","passed":true},{"actual":null,"check":"regression 3","expected":null,"passed":true},{"actual":"1","check":"regression 4","expected":"0","passed":false},{"actual":"4/5","check":"regression 5","expected":"4/5","passed":true},{"actual":"9/10","check":"regression 6","expected":"2/5","passed":false},{"actual":null,"check":"regression 7","expected":null,"passed":true},{"actual":"1/2","check":"variable cosine concentration","expected":"1/2","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": \"1\", \"expected\": \"16/25\", \"passed\": false}, {\"check\": \"regression 2\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"regression 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression 4\", \"actual\": \"1\", \"expected\": \"0\", \"passed\": false}, {\"check\": \"regression 5\", \"actual\": \"4/5\", \"expected\": \"4/5\", \"passed\": true}, {\"check\": \"regression 6\", \"actual\": \"9/10\", \"expected\": \"2/5\", \"passed\": false}, {\"check\": \"regression 7\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"variable cosine concentration\", \"actual\": \"1/2\", \"expected\": \"1/2\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.446,"exit_code":1,"observations":[{"actual":"16/25","check":"regression 1","expected":"16/25","passed":true},{"actual":"1","check":"regression 2","expected":"1","passed":true},{"actual":null,"check":"regression 3","expected":null,"passed":true},{"actual":"1","check":"regression 4","expected":"0","passed":false},{"actual":"4/5","check":"regression 5","expected":"4/5","passed":true},{"actual":"9/10","check":"regression 6","expected":"2/5","passed":false},{"actual":null,"check":"regression 7","expected":null,"passed":true},{"actual":"1/2","check":"variable cosine concentration","expected":"1/2","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 1\", \"actual\": \"16/25\", \"expected\": \"16/25\", \"passed\": true}, {\"check\": \"regression 2\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"regression 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression 4\", \"actual\": \"1\", \"expected\": \"0\", \"passed\": false}, {\"check\": \"regression 5\", \"actual\": \"4/5\", \"expected\": \"4/5\", \"passed\": true}, {\"check\": \"regression 6\", \"actual\": \"9/10\", \"expected\": \"2/5\", \"passed\": false}, {\"check\": \"regression 7\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"variable cosine concentration\", \"actual\": \"1/2\", \"expected\": \"1/2\", \"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."}}