{"abstract":"The exact multiset permutation unrank result violates the stated contract at multiset alphabet order.","category":"Numerics","checks":8,"contract":"Input [sorted multiset of small integer symbols, rank], valid zero-based lexicographic rank among distinct permutations.","evaluation_group":"s3-numerics-multiset-permutation-unrank","failed_approach":"The partial repair list(reversed(list(counts))) still violates the multiset alphabet order invariant.","family":"s3-numerics-multiset-permutation-unrank-multiset-alphabet-order","id":"FA-15216","implementations":{"attempt":{"sha256":"e64deac9028479f94a1c347e79f30042505089fc9d6c04e37578797081bbec01","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    items,r=x\n    from collections import Counter\n    counts=Counter(items);out=[]\n    def ways(c):\n     v=math.factorial(sum(c.values()))\n     for n in c.values():v//=math.factorial(n)\n     return v\n    for _ in range(len(items)):\n     for symbol in list(reversed(list(counts))):\n      if counts[symbol]==0:continue\n      counts[symbol]-=1\n      block=ways(counts)\n      if r<block:\n       out.append(symbol)\n       break\n      r=r-block\n      counts[symbol]=counts[symbol]+1\n     else:return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1], 1], [0, 1, 0]), ([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 3], [1, 0, 1, 2])], [([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1, 1], 2], [0, 1, 1, 0]), ([[0, 0, 1, 1], 3], [1, 0, 0, 1]), ([[0, 0, 1, 1], 4], [1, 0, 1, 0]), ([[0, 0, 1, 1], 5], [1, 1, 0, 0])], [([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 4], [1, 0, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 0, 1, 2], 13], [1, 0, 0, 2, 0]), ([[0, 0, 0, 1, 2], 14], [1, 0, 2, 0, 0]), ([[0, 0, 0, 1, 2], 15], [1, 2, 0, 0, 0]), ([[0, 0, 0, 1, 2], 16], [2, 0, 0, 0, 1])], [([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 7], [1, 2, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 1, 2, 3], 10], [1, 3, 0, 2]), ([[0, 1, 2, 3], 11], [1, 3, 2, 0]), ([[0, 1, 2, 3], 12], [2, 0, 1, 3]), ([[0, 1, 2, 3], 13], [2, 0, 3, 1])], [([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 10], [2, 1, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[1, 1, 2, 2, 3], 3], [1, 2, 1, 2, 3]), ([[1, 1, 2, 2, 3], 4], [1, 2, 1, 3, 2]), ([[1, 1, 2, 2, 3], 5], [1, 2, 2, 1, 3]), ([[1, 1, 2, 2, 3], 6], [1, 2, 2, 3, 1])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"d5e84813d7295d7521abaf7e5fa82447c5aeaac3d74f3e6a7519ffe76be0945a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    items,r=x\n    from collections import Counter\n    counts=Counter(items);out=[]\n    def ways(c):\n     v=math.factorial(sum(c.values()))\n     for n in c.values():v//=math.factorial(n)\n     return v\n    for _ in range(len(items)):\n     for symbol in sorted(counts,reverse=True):\n      if counts[symbol]==0:continue\n      counts[symbol]-=1\n      block=ways(counts)\n      if r<block:\n       out.append(symbol)\n       break\n      r=r-block\n      counts[symbol]=counts[symbol]+1\n     else:return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1], 1], [0, 1, 0]), ([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 3], [1, 0, 1, 2])], [([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1, 1], 2], [0, 1, 1, 0]), ([[0, 0, 1, 1], 3], [1, 0, 0, 1]), ([[0, 0, 1, 1], 4], [1, 0, 1, 0]), ([[0, 0, 1, 1], 5], [1, 1, 0, 0])], [([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 4], [1, 0, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 0, 1, 2], 13], [1, 0, 0, 2, 0]), ([[0, 0, 0, 1, 2], 14], [1, 0, 2, 0, 0]), ([[0, 0, 0, 1, 2], 15], [1, 2, 0, 0, 0]), ([[0, 0, 0, 1, 2], 16], [2, 0, 0, 0, 1])], [([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 7], [1, 2, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 1, 2, 3], 10], [1, 3, 0, 2]), ([[0, 1, 2, 3], 11], [1, 3, 2, 0]), ([[0, 1, 2, 3], 12], [2, 0, 1, 3]), ([[0, 1, 2, 3], 13], [2, 0, 3, 1])], [([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 10], [2, 1, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[1, 1, 2, 2, 3], 3], [1, 2, 1, 2, 3]), ([[1, 1, 2, 2, 3], 4], [1, 2, 1, 3, 2]), ([[1, 1, 2, 2, 3], 5], [1, 2, 2, 1, 3]), ([[1, 1, 2, 2, 3], 6], [1, 2, 2, 3, 1])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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"},"fixed":{"sha256":"e542a36e1149cf1696b5fe7d7ee023f4a2d027a8f6fdcc54c78a26eaf3dda774","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    items,r=x\n    from collections import Counter\n    counts=Counter(items);out=[]\n    def ways(c):\n     v=math.factorial(sum(c.values()))\n     for n in c.values():v//=math.factorial(n)\n     return v\n    for _ in range(len(items)):\n     for symbol in sorted(counts):\n      if counts[symbol]==0:continue\n      counts[symbol]-=1\n      block=ways(counts)\n      if r<block:\n       out.append(symbol)\n       break\n      r=r-block\n      counts[symbol]=counts[symbol]+1\n     else:return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1], 1], [0, 1, 0]), ([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 3], [1, 0, 1, 2])], [([[0, 0, 1], 2], [1, 0, 0]), ([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 1, 1], 2], [0, 1, 1, 0]), ([[0, 0, 1, 1], 3], [1, 0, 0, 1]), ([[0, 0, 1, 1], 4], [1, 0, 1, 0]), ([[0, 0, 1, 1], 5], [1, 1, 0, 0])], [([[0, 1, 1, 2], 0], [0, 1, 1, 2]), ([[0, 1, 1, 2], 4], [1, 0, 2, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 0, 0, 1, 2], 13], [1, 0, 0, 2, 0]), ([[0, 0, 0, 1, 2], 14], [1, 0, 2, 0, 0]), ([[0, 0, 0, 1, 2], 15], [1, 2, 0, 0, 0]), ([[0, 0, 0, 1, 2], 16], [2, 0, 0, 0, 1])], [([[0, 1, 1, 2], 1], [0, 1, 2, 1]), ([[0, 1, 1, 2], 7], [1, 2, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[0, 1, 2, 3], 10], [1, 3, 0, 2]), ([[0, 1, 2, 3], 11], [1, 3, 2, 0]), ([[0, 1, 2, 3], 12], [2, 0, 1, 3]), ([[0, 1, 2, 3], 13], [2, 0, 3, 1])], [([[0, 1, 1, 2], 2], [0, 2, 1, 1]), ([[0, 1, 1, 2], 10], [2, 1, 0, 1]), ([[0, 0, 1], 0], [0, 0, 1]), ([[1, 1, 2, 2, 3], 29], [3, 2, 2, 1, 1]), ([[1, 1, 2, 2, 3], 3], [1, 2, 1, 2, 3]), ([[1, 1, 2, 2, 3], 4], [1, 2, 1, 3, 2]), ([[1, 1, 2, 2, 3], 5], [1, 2, 2, 1, 3]), ([[1, 1, 2, 2, 3], 6], [1, 2, 2, 3, 1])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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-numerics-multiset-permutation-unrank-multiset-alphabet-order","generated_at":"2026-09-29T14:39:24.562867+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.","repair":"Use sorted(counts) at the multiset alphabet order step.","root_cause":"The multiset alphabet order step uses sorted(counts,reverse=True) instead of sorted(counts).","sha256":"ad019ff92134f8473bc893868e6422881bc7f113d63b80af1637794cc971d996","title":"Multiset permutation unrank: multiset alphabet order · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.634,"exit_code":1,"observations":[{"actual":[1,0,0],"check":"explicit oracle 0","expected":[0,0,1],"passed":false},{"actual":[1,1,2,2,3],"check":"explicit oracle 1","expected":[3,2,2,1,1],"passed":false},{"actual":[0,1,0],"check":"explicit oracle 2","expected":[0,1,0],"passed":true},{"actual":[0,0,1],"check":"explicit oracle 3","expected":[1,0,0],"passed":false},{"actual":[2,1,1,0],"check":"explicit oracle 4","expected":[0,1,1,2],"passed":false},{"actual":[2,1,0,1],"check":"explicit oracle 5","expected":[0,1,2,1],"passed":false},{"actual":[2,0,1,1],"check":"explicit oracle 6","expected":[0,2,1,1],"passed":false},{"actual":[1,2,1,0],"check":"explicit oracle 7","expected":[1,0,1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [1, 0, 0], \"expected\": [0, 0, 1], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [1, 1, 2, 2, 3], \"expected\": [3, 2, 2, 1, 1], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [0, 1, 0], \"expected\": [0, 1, 0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [0, 0, 1], \"expected\": [1, 0, 0], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [2, 1, 1, 0], \"expected\": [0, 1, 1, 2], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [2, 1, 0, 1], \"expected\": [0, 1, 2, 1], \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [2, 0, 1, 1], \"expected\": [0, 2, 1, 1], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [1, 2, 1, 0], \"expected\": [1, 0, 1, 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.724,"exit_code":1,"observations":[{"actual":[1,0,0],"check":"explicit oracle 0","expected":[0,0,1],"passed":false},{"actual":[1,1,2,2,3],"check":"explicit oracle 1","expected":[3,2,2,1,1],"passed":false},{"actual":[0,1,0],"check":"explicit oracle 2","expected":[0,1,0],"passed":true},{"actual":[0,0,1],"check":"explicit oracle 3","expected":[1,0,0],"passed":false},{"actual":[2,1,1,0],"check":"explicit oracle 4","expected":[0,1,1,2],"passed":false},{"actual":[2,1,0,1],"check":"explicit oracle 5","expected":[0,1,2,1],"passed":false},{"actual":[2,0,1,1],"check":"explicit oracle 6","expected":[0,2,1,1],"passed":false},{"actual":[1,2,1,0],"check":"explicit oracle 7","expected":[1,0,1,2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [1, 0, 0], \"expected\": [0, 0, 1], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [1, 1, 2, 2, 3], \"expected\": [3, 2, 2, 1, 1], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [0, 1, 0], \"expected\": [0, 1, 0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [0, 0, 1], \"expected\": [1, 0, 0], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [2, 1, 1, 0], \"expected\": [0, 1, 1, 2], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [2, 1, 0, 1], \"expected\": [0, 1, 2, 1], \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [2, 0, 1, 1], \"expected\": [0, 2, 1, 1], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [1, 2, 1, 0], \"expected\": [1, 0, 1, 2], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.078,"exit_code":0,"observations":[{"actual":[0,0,1],"check":"explicit oracle 0","expected":[0,0,1],"passed":true},{"actual":[3,2,2,1,1],"check":"explicit oracle 1","expected":[3,2,2,1,1],"passed":true},{"actual":[0,1,0],"check":"explicit oracle 2","expected":[0,1,0],"passed":true},{"actual":[1,0,0],"check":"explicit oracle 3","expected":[1,0,0],"passed":true},{"actual":[0,1,1,2],"check":"explicit oracle 4","expected":[0,1,1,2],"passed":true},{"actual":[0,1,2,1],"check":"explicit oracle 5","expected":[0,1,2,1],"passed":true},{"actual":[0,2,1,1],"check":"explicit oracle 6","expected":[0,2,1,1],"passed":true},{"actual":[1,0,1,2],"check":"explicit oracle 7","expected":[1,0,1,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 1], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [3, 2, 2, 1, 1], \"expected\": [3, 2, 2, 1, 1], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [0, 1, 0], \"expected\": [0, 1, 0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [1, 0, 0], \"expected\": [1, 0, 0], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [0, 1, 1, 2], \"expected\": [0, 1, 1, 2], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [0, 1, 2, 1], \"expected\": [0, 1, 2, 1], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [0, 2, 1, 1], \"expected\": [0, 2, 1, 1], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [1, 0, 1, 2], \"expected\": [1, 0, 1, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}