FA-14146 / Numerical aggregation / Open access
Frequency cosine squared: Frequency vectors are dotted by insertion order rather than matching labels. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Frequency vectors are dotted by insertion order rather than matching labels.
THE FAILURE
Frequency vectors are dotted by insertion order rather than matching labels.
Unsuccessful approach: Sorting frequencies independently destroys label alignment.
Case 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.
Why this case matters
Exact bounded examples isolate a reduction defect without floating-point or external-service effects.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(a, b):
ca,cb=Counter(a),Counter(b)
keys=set(ca)|set(cb)
dot=sum(x*y for x,y in zip(ca.values(),cb.values()))
na=sum(v*v for v in ca.values())
nb=sum(v*v for v in cb.values())
return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,N*N+1)))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 16/25 | 16/25 | Passed |
| regression 2 | 1 | 1 | Passed |
| regression 3 | None | None | Passed |
| regression 4 | 1 | 0 | Failed |
| regression 5 | 4/5 | 4/5 | Passed |
| regression 6 | 9/10 | 2/5 | Failed |
| regression 7 | None | None | Passed |
| variable cosine concentration | 1/2 | 1/2 | Passed |
SHA-256 / 759a472c67dab9418e883107f868098fb54540ce7b4d01c35e1bc0254184bf79
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(a, b):
ca,cb=Counter(a),Counter(b)
keys=set(ca)|set(cb)
dot=sum(x*y for x,y in zip(sorted(ca.values()),sorted(cb.values())))
na=sum(v*v for v in ca.values())
nb=sum(v*v for v in cb.values())
return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,N*N+1)))
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 1 | 16/25 | Failed |
| regression 2 | 1 | 1 | Passed |
| regression 3 | None | None | Passed |
| regression 4 | 1 | 0 | Failed |
| regression 5 | 4/5 | 4/5 | Passed |
| regression 6 | 9/10 | 2/5 | Failed |
| regression 7 | None | None | Passed |
| variable cosine concentration | 1/2 | 1/2 | Passed |
SHA-256 / d7b40122b1d13e96fe7d4abc4a199fad05a19d03ea3d238c9f4deca776f5f2b6
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:39:14.060407+00:00.
Case digest / 7d874cd06ddb66a1dbdd973db72b4f3420b2577bd0341468e6f0a663557ce7bf