{"abstract":"Top-k selection crosses a group boundary.","category":"Mixture of experts dispatch","checks":6,"contract":"Input (group,expert,score) rows; return up to k per group by score descending and expert ID, preserving group lexical order then rank.","contract_signature":"rows,k","evaluation_group":"moe-grouped-topk","failed_approach":"Taking k candidates globally still underfills a group with weaker scores.","family":"w3-mixture-of-experts-dispatch-group-topk","id":"FA-100586","implementations":{"attempt":{"sha256":"91806274cba7b988b7e30b789c1d988318adc0b21726dace1c42cc84a85f5e9a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows,k):\n    return sorted(rows,key=lambda r:(r[0],-r[2],r[1]))[:k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[('g2','b',N+2),('g1','z',N+1),('g1','a',N),('g2','c',N-1)]\ncheck('per group',solve(rows,1),[['g1','z',N+1],['g2','b',N+2]])\ncheck('two per group',solve(rows,2),[['g1','z',N+1],['g1','a',N],['g2','b',N+2],['g2','c',N-1]])\ncheck('zero',solve(rows,0),[])\ncheck('empty',solve([],N),[])\ncheck('one group',solve([('g','b',N),('g','a',N+1)],1),[['g','a',N+1]])\ncheck('tie expert',solve([('g','z',N),('g','a',N)],2),[['g','a',N],['g','z',N]])\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":"d8be8206f1f0b6d558fbd3a1df73575e236cc9bd371fab7266a5119abf9427b3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows,k):\n    return sorted(rows,key=lambda r:(-r[2],r[1]))[:k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nrows=[('g2','b',N+2),('g1','z',N+1),('g1','a',N),('g2','c',N-1)]\ncheck('per group',solve(rows,1),[['g1','z',N+1],['g2','b',N+2]])\ncheck('two per group',solve(rows,2),[['g1','z',N+1],['g1','a',N],['g2','b',N+2],['g2','c',N-1]])\ncheck('zero',solve(rows,0),[])\ncheck('empty',solve([],N),[])\ncheck('one group',solve([('g','b',N),('g','a',N+1)],1),[['g','a',N+1]])\ncheck('tie expert',solve([('g','z',N),('g','a',N)],2),[['g','a',N],['g','z',N]])\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 scores and routes; the contract does not model a production model, accelerator, or learned routing 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-mixture-of-experts-dispatch-group-topk","generated_at":"2026-09-30T16:48:37.193948+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic toy router makes this dispatch decision independently inspectable.","root_cause":"Global ranking is used when each router group has its own quota.","sha256":"d11eaf3473a15adf7fc2674c7677d4b6e18510132aab7b41fd29b8ab73e9c6dd","title":"Top-k selection crosses a group boundary · 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":34.54,"exit_code":1,"observations":[{"actual":[["g1","z",2]],"check":"per group","expected":[["g1","z",2],["g2","b",3]],"passed":false},{"actual":[["g1","z",2],["g1","a",1]],"check":"two per group","expected":[["g1","z",2],["g1","a",1],["g2","b",3],["g2","c",0]],"passed":false},{"actual":[],"check":"zero","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["g","a",2]],"check":"one group","expected":[["g","a",2]],"passed":false},{"actual":[["g","a",1],["g","z",1]],"check":"tie expert","expected":[["g","a",1],["g","z",1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"per group\", \"actual\": [[\"g1\", \"z\", 2]], \"expected\": [[\"g1\", \"z\", 2], [\"g2\", \"b\", 3]], \"passed\": false}, {\"check\": \"two per group\", \"actual\": [[\"g1\", \"z\", 2], [\"g1\", \"a\", 1]], \"expected\": [[\"g1\", \"z\", 2], [\"g1\", \"a\", 1], [\"g2\", \"b\", 3], [\"g2\", \"c\", 0]], \"passed\": false}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one group\", \"actual\": [[\"g\", \"a\", 2]], \"expected\": [[\"g\", \"a\", 2]], \"passed\": false}, {\"check\": \"tie expert\", \"actual\": [[\"g\", \"a\", 1], [\"g\", \"z\", 1]], \"expected\": [[\"g\", \"a\", 1], [\"g\", \"z\", 1]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.302,"exit_code":1,"observations":[{"actual":[["g2","b",3]],"check":"per group","expected":[["g1","z",2],["g2","b",3]],"passed":false},{"actual":[["g2","b",3],["g1","z",2]],"check":"two per group","expected":[["g1","z",2],["g1","a",1],["g2","b",3],["g2","c",0]],"passed":false},{"actual":[],"check":"zero","expected":[],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[["g","a",2]],"check":"one group","expected":[["g","a",2]],"passed":false},{"actual":[["g","a",1],["g","z",1]],"check":"tie expert","expected":[["g","a",1],["g","z",1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"per group\", \"actual\": [[\"g2\", \"b\", 3]], \"expected\": [[\"g1\", \"z\", 2], [\"g2\", \"b\", 3]], \"passed\": false}, {\"check\": \"two per group\", \"actual\": [[\"g2\", \"b\", 3], [\"g1\", \"z\", 2]], \"expected\": [[\"g1\", \"z\", 2], [\"g1\", \"a\", 1], [\"g2\", \"b\", 3], [\"g2\", \"c\", 0]], \"passed\": false}, {\"check\": \"zero\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"one group\", \"actual\": [[\"g\", \"a\", 2]], \"expected\": [[\"g\", \"a\", 2]], \"passed\": false}, {\"check\": \"tie expert\", \"actual\": [[\"g\", \"a\", 1], [\"g\", \"z\", 1]], \"expected\": [[\"g\", \"a\", 1], [\"g\", \"z\", 1]], \"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."}}