{"abstract":"duplicate rows consume the result cap.","category":"Dataset deduplication grouping","checks":6,"contract":"Rows [key,id]. Return first representatives for distinct keys, truncated to nonnegative limit.","contract_signature":"rows, limit","evaluation_group":"dedup-dedupe-limit","failed_approach":"Deduplicating with a last-write map changes which representatives survive.","family":"w3-dataset-deduplication-grouping-dedupe-before-limit","id":"FA-100331","implementations":{"attempt":{"sha256":"336e5ac78da35f128bbaaffef446d41f6dfb32f4d4fbd42f60e8ef9cf1ac1d47","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, limit):\n    out={};\n    for k,i in rows: out[k]=i\n    return list(out.values())[:limit]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicates before cap',solve([['a','a1'],['a','a2'],['b','b1']],2),['a1','b1'])\ncheck('zero limit',solve([['a','a1']],0),[])\ncheck('empty rows',solve([],N),[])\ncheck('limit beyond unique',solve([['a','a1']],N+2),['a1'])\ncheck('cap one',solve([['x','x1'],['x','x2'],['y','y1']],1),['x1'])\ncheck('preserve order',solve([['b','b1'],['a','a1']],2),['b1','a1'])\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":"b9c22df08d0d20d4acea0d8d5e22dfefcf2a7a9dfefb6a1a3dcb198d9d1e4f45","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, limit):\n    return [i for k,i in rows[:limit]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicates before cap',solve([['a','a1'],['a','a2'],['b','b1']],2),['a1','b1'])\ncheck('zero limit',solve([['a','a1']],0),[])\ncheck('empty rows',solve([],N),[])\ncheck('limit beyond unique',solve([['a','a1']],N+2),['a1'])\ncheck('cap one',solve([['x','x1'],['x','x2'],['y','y1']],1),['x1'])\ncheck('preserve order',solve([['b','b1'],['a','a1']],2),['b1','a1'])\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 in-memory fixtures with the stated contract; results do not claim production deduplication quality. 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-dataset-deduplication-grouping-dedupe-before-limit","generated_at":"2026-09-30T16:48:34.472025+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This deterministic toy operation makes one dataset equivalence or representative rule explicit.","root_cause":"The output limit is applied before exact duplicate removal.","sha256":"92eeeba928053adaf0bf38f93d7220d194ebdee307356cef2e74b3f6e4073293","title":"Dataset deduplication: duplicate rows consume the result cap · 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":29.776,"exit_code":1,"observations":[{"actual":["a2","b1"],"check":"duplicates before cap","expected":["a1","b1"],"passed":false},{"actual":[],"check":"zero limit","expected":[],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":["a1"],"check":"limit beyond unique","expected":["a1"],"passed":true},{"actual":["x2"],"check":"cap one","expected":["x1"],"passed":false},{"actual":["b1","a1"],"check":"preserve order","expected":["b1","a1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicates before cap\", \"actual\": [\"a2\", \"b1\"], \"expected\": [\"a1\", \"b1\"], \"passed\": false}, {\"check\": \"zero limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"limit beyond unique\", \"actual\": [\"a1\"], \"expected\": [\"a1\"], \"passed\": true}, {\"check\": \"cap one\", \"actual\": [\"x2\"], \"expected\": [\"x1\"], \"passed\": false}, {\"check\": \"preserve order\", \"actual\": [\"b1\", \"a1\"], \"expected\": [\"b1\", \"a1\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.03,"exit_code":1,"observations":[{"actual":["a1","a2"],"check":"duplicates before cap","expected":["a1","b1"],"passed":false},{"actual":[],"check":"zero limit","expected":[],"passed":true},{"actual":[],"check":"empty rows","expected":[],"passed":true},{"actual":["a1"],"check":"limit beyond unique","expected":["a1"],"passed":true},{"actual":["x1"],"check":"cap one","expected":["x1"],"passed":true},{"actual":["b1","a1"],"check":"preserve order","expected":["b1","a1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicates before cap\", \"actual\": [\"a1\", \"a2\"], \"expected\": [\"a1\", \"b1\"], \"passed\": false}, {\"check\": \"zero limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"limit beyond unique\", \"actual\": [\"a1\"], \"expected\": [\"a1\"], \"passed\": true}, {\"check\": \"cap one\", \"actual\": [\"x1\"], \"expected\": [\"x1\"], \"passed\": true}, {\"check\": \"preserve order\", \"actual\": [\"b1\", \"a1\"], \"expected\": [\"b1\", \"a1\"], \"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."}}