{"abstract":"With two deuces showing, the deuce of hearts brings in instead of the deuce of clubs.","category":"Poker hand evaluation","checks":8,"contract":"Input: {\"variant\": \"stud\", \"stud8\" or \"razz\", \"up\": {player: door card}}. In stud and stud8 the lowest door card brings in (ace high); ties are broken by suit with clubs lowest, then diamonds, hearts, spades. In razz the highest door card brings in (ace low), ties going to the highest suit. Return the bring-in player.","contract_signature":"x","evaluation_group":"w2-poker_hand_evaluation-stud-bring-in","failed_approach":"Swapping clubs and diamonds still misorders the two lowest suits.","family":"w2-poker_hand_evaluation-stud-bring-in-suit-ranking-table","id":"FA-82231","implementations":{"attempt":{"sha256":"7ad3698b05135378c22bd39e2c79b964b1e676f528e9e7661320f68dccd493d9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'; S='dchs'\n    razz=x['variant']=='razz'\n    def rv(c):\n        if razz and c[0]=='A': return 1\n        return R.index(c[0])+2\n    def k(p):\n        c=x['up'][p]\n        return (rv(c), S.index(c[1]))\n    players=sorted(x['up'])\n    return max(players, key=k) if razz else min(players, key=k)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b')],\n [('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('spade vs heart tie stud', {'up': {'a': '4s', 'b': '4h', 'c': 'Js'}, 'variant': 'stud'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('spade vs heart tie stud', {'up': {'a': '4s', 'b': '4h', 'c': 'Js'}, 'variant': 'stud'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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":"69d96733c251342c767be54d964234ff1cfb95f877023407997ddf4f84ab2aa3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'; S='shdc'\n    razz=x['variant']=='razz'\n    def rv(c):\n        if razz and c[0]=='A': return 1\n        return R.index(c[0])+2\n    def k(p):\n        c=x['up'][p]\n        return (rv(c), S.index(c[1]))\n    players=sorted(x['up'])\n    return max(players, key=k) if razz else min(players, key=k)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b')],\n [('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('spade vs heart tie stud', {'up': {'a': '4s', 'b': '4h', 'c': 'Js'}, 'variant': 'stud'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz suit tie', {'up': {'a': 'Kc', 'b': 'Ks', 'c': '5s'}, 'variant': 'razz'}, 'b'),\n  ('spade vs heart tie stud', {'up': {'a': '4s', 'b': '4h', 'c': 'Js'}, 'variant': 'stud'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('lowest deuce', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')],\n [('deuce suit tie', {'up': {'a': '2h', 'b': '2c', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('ace is high in stud', {'up': {'a': 'Ah', 'b': '3d', 'c': '9s'}, 'variant': 'stud'}, 'b'),\n  ('razz ace low', {'up': {'a': 'Ah', 'b': '3d', 'c': 'Ks'}, 'variant': 'razz'}, 'c'),\n  ('razz ace vs deuce', {'up': {'a': 'Ah', 'b': '2d', 'c': '5s'}, 'variant': 'razz'}, 'c'),\n  ('stud8 uses stud rule', {'up': {'a': 'Kh', 'b': '2d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('stud8 ace high', {'up': {'a': 'Ad', 'b': '4d', 'c': '9s'}, 'variant': 'stud8'}, 'b'),\n  ('diamond vs club tie stud', {'up': {'a': '5d', 'b': '5c'}, 'variant': 'stud'}, 'b'),\n  ('razz heart vs diamond', {'up': {'a': 'Qd', 'b': 'Qh', 'c': '2s'}, 'variant': 'razz'}, 'b')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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 toy model with an explicitly stated contract; card strings are rank+suit (for example \"As\", \"Td\"); no claim of conformance to any casino or tournament rulebook. 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":"w2-poker_hand_evaluation-stud-bring-in-suit-ranking-table","generated_at":"2026-09-29T14:50:10.152540+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"The bring-in decides who is forced to act first on third street.","root_cause":"The suit table is written spades-first, reversing the tiebreak order.","sha256":"477f12d19b24a2fa19e0ca0d12d2eb04a4d450ccb7e42f6ed7bffb9218984fe2","title":"Bring-in suit ranking stored strongest first · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.474,"exit_code":1,"observations":[{"actual":"b","check":"lowest deuce","expected":"b","passed":true},{"actual":"b","check":"deuce suit tie","expected":"b","passed":true},{"actual":"b","check":"ace is high in stud","expected":"b","passed":true},{"actual":"c","check":"razz ace low","expected":"c","passed":true},{"actual":"c","check":"razz ace vs deuce","expected":"c","passed":true},{"actual":"b","check":"razz suit tie","expected":"b","passed":true},{"actual":"b","check":"stud8 uses stud rule","expected":"b","passed":true},{"actual":"a","check":"diamond vs club tie stud","expected":"b","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lowest deuce\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"deuce suit tie\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"ace is high in stud\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"razz ace low\", \"actual\": \"c\", \"expected\": \"c\", \"passed\": true}, {\"check\": \"razz ace vs deuce\", \"actual\": \"c\", \"expected\": \"c\", \"passed\": true}, {\"check\": \"razz suit tie\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"stud8 uses stud rule\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"diamond vs club tie stud\", \"actual\": \"a\", \"expected\": \"b\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.106,"exit_code":1,"observations":[{"actual":"b","check":"lowest deuce","expected":"b","passed":true},{"actual":"a","check":"deuce suit tie","expected":"b","passed":false},{"actual":"b","check":"ace is high in stud","expected":"b","passed":true},{"actual":"c","check":"razz ace low","expected":"c","passed":true},{"actual":"c","check":"razz ace vs deuce","expected":"c","passed":true},{"actual":"a","check":"razz suit tie","expected":"b","passed":false},{"actual":"b","check":"stud8 uses stud rule","expected":"b","passed":true},{"actual":"a","check":"diamond vs club tie stud","expected":"b","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lowest deuce\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"deuce suit tie\", \"actual\": \"a\", \"expected\": \"b\", \"passed\": false}, {\"check\": \"ace is high in stud\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"razz ace low\", \"actual\": \"c\", \"expected\": \"c\", \"passed\": true}, {\"check\": \"razz ace vs deuce\", \"actual\": \"c\", \"expected\": \"c\", \"passed\": true}, {\"check\": \"razz suit tie\", \"actual\": \"a\", \"expected\": \"b\", \"passed\": false}, {\"check\": \"stud8 uses stud rule\", \"actual\": \"b\", \"expected\": \"b\", \"passed\": true}, {\"check\": \"diamond vs club tie stud\", \"actual\": \"a\", \"expected\": \"b\", \"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."}}