{"abstract":"MMR repeatedly selects the top relevance score.","category":"Vector retrieval ranking","checks":6,"contract":"Rows [id,relevance,{other_id: similarity}]; choose max relevance - lambda*maximum similarity to selected IDs iteratively.","contract_signature":"rows, k, lam","evaluation_group":"vector-retrieval-max-marginal-relevance","failed_approach":"A fixed-anchor penalty cannot account for redundancy with later selected vectors.","family":"w3-vector-retrieval-ranking-max-marginal-relevance","id":"FA-99516","implementations":{"attempt":{"sha256":"96950219bed84b5684e684512c2f37fcedb5923a3351dc40969c793034fbc08b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, k, lam):\n    anchor=max(rows,key=lambda r:r[1])[0] if rows else None\n    return [r[0] for r in sorted(rows,key=lambda r:(-(r[1]-lam*r[2].get(anchor,0)),r[0]))[:k]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['a',0.9,{'b':0.9,'c':0.0}],['b',0.8,{'a':0.9,'c':0.1}],['c',0.7,{'a':0.0,'b':0.1}]]\ncheck('penalty changes second',solve(rows,2,1.0),['a','c'])\ncheck('later redundancy update',solve([['a',0.9,{'b':0.0,'x':0.1,'c':0.0}],['b',0.8,{'a':0.0,'x':0.9,'c':0.0}],['x',0.85,{'a':0.1,'b':0.9,'c':0.0}],['c',0.7,{'a':0.0,'b':0.0,'x':0.0}]],3,1.0),['a','b','c'])\ncheck('lower relevance wins diversity',solve(rows,2,0.5),['a','c'])\ncheck('one choice',solve(rows,1,1.0),['a'])\ncheck('empty',solve([],N,1),[])\ncheck('diverse beats near duplicate',solve([['x',0.8,{'y':0.9,'z':0.1}],['y',0.7,{'x':0.9,'z':0.2}],['z',0.6,{'x':0.1,'y':0.2}]],2,1.0),['x','z'])\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":"582783a9999324e2271ab11fb45336e9a87e8194034300b8a905423738b1732f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, k, lam):\n    return [r[0] for r in sorted(rows,key=lambda r:(-r[1],r[0]))[:k]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[['a',0.9,{'b':0.9,'c':0.0}],['b',0.8,{'a':0.9,'c':0.1}],['c',0.7,{'a':0.0,'b':0.1}]]\ncheck('penalty changes second',solve(rows,2,1.0),['a','c'])\ncheck('later redundancy update',solve([['a',0.9,{'b':0.0,'x':0.1,'c':0.0}],['b',0.8,{'a':0.0,'x':0.9,'c':0.0}],['x',0.85,{'a':0.1,'b':0.9,'c':0.0}],['c',0.7,{'a':0.0,'b':0.0,'x':0.0}]],3,1.0),['a','b','c'])\ncheck('lower relevance wins diversity',solve(rows,2,0.5),['a','c'])\ncheck('one choice',solve(rows,1,1.0),['a'])\ncheck('empty',solve([],N,1),[])\ncheck('diverse beats near duplicate',solve([['x',0.8,{'y':0.9,'z':0.1}],['y',0.7,{'x':0.9,'z':0.2}],['z',0.6,{'x':0.1,'y':0.2}]],2,1.0),['x','z'])\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 small exact toy vectors and scores. No production index, ANN recall, embedding quality, or latency claim is implied. 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-vector-retrieval-ranking-max-marginal-relevance","generated_at":"2026-09-30T16:48:24.912931+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline vector retrieval toy model isolates one ranking contract from embedding generation, storage, and serving.","root_cause":"The first implementation ignores redundancy, and the attempted ranking measures redundancy only against a fixed first choice.","sha256":"1fa128348987629b0c61cacd67c726a03b3250e76d5d1dc06bbaf4806341e6ce","title":"Vector retrieval: MMR repeatedly selects the top relevance score · 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.484,"exit_code":1,"observations":[{"actual":["a","c"],"check":"penalty changes second","expected":["a","c"],"passed":true},{"actual":["a","b","x"],"check":"later redundancy update","expected":["a","b","c"],"passed":false},{"actual":["a","c"],"check":"lower relevance wins diversity","expected":["a","c"],"passed":true},{"actual":["a"],"check":"one choice","expected":["a"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x","z"],"check":"diverse beats near duplicate","expected":["x","z"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"penalty changes second\", \"actual\": [\"a\", \"c\"], \"expected\": [\"a\", \"c\"], \"passed\": true}, {\"check\": \"later redundancy update\", \"actual\": [\"a\", \"b\", \"x\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"lower relevance wins diversity\", \"actual\": [\"a\", \"c\"], \"expected\": [\"a\", \"c\"], \"passed\": true}, {\"check\": \"one choice\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"diverse beats near duplicate\", \"actual\": [\"x\", \"z\"], \"expected\": [\"x\", \"z\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":25.728,"exit_code":1,"observations":[{"actual":["a","b"],"check":"penalty changes second","expected":["a","c"],"passed":false},{"actual":["a","x","b"],"check":"later redundancy update","expected":["a","b","c"],"passed":false},{"actual":["a","b"],"check":"lower relevance wins diversity","expected":["a","c"],"passed":false},{"actual":["a"],"check":"one choice","expected":["a"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":["x","y"],"check":"diverse beats near duplicate","expected":["x","z"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"penalty changes second\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"c\"], \"passed\": false}, {\"check\": \"later redundancy update\", \"actual\": [\"a\", \"x\", \"b\"], \"expected\": [\"a\", \"b\", \"c\"], \"passed\": false}, {\"check\": \"lower relevance wins diversity\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"c\"], \"passed\": false}, {\"check\": \"one choice\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"diverse beats near duplicate\", \"actual\": [\"x\", \"y\"], \"expected\": [\"x\", \"z\"], \"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."}}