{"abstract":"9-T-J-Q with no eight or king is reported as a queen-high straight.","category":"Poker hand evaluation","checks":8,"contract":"Input: 5 to 7 distinct cards \"Rs\". Build a rank bitmask (bit r for rank value r, 2..14; the ace also sets bit 1). Return the top rank of the highest five-card straight contained in the ranks (5 for the wheel), or 0 if none.","contract_signature":"x","evaluation_group":"w2-poker_hand_evaluation-rank-mask-straight","failed_approach":"Keeping five bits but shifting by top-5 reports each straight one rank low.","family":"w2-poker_hand_evaluation-rank-mask-straight-window-width","id":"FA-81946","implementations":{"attempt":{"sha256":"96085c0a3505a9669d7fa50c488755d636839202eb2ff0cf8e859bf8471b745d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    m=0\n    for c in x:\n        m|=1<<(R.index(c[0])+2)\n    if m & (1<<14): m|=1<<1\n    for top in range(14,4,-1):\n        need=0b11111<<(top-5)\n        if m & need == need: return top\n    return 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)],\n [('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0)],\n [('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('five cards straight', ['6h', '7d', '8c', '9s', 'Th'], 10),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0)],\n [('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('five cards straight', ['6h', '7d', '8c', '9s', 'Th'], 10),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0),\n  ('pair of fours with straight', ['3h', '4d', '4c', '5s', '6h', '7d', 'Ac'], 7),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0)],\n [('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('pair of fours with straight', ['3h', '4d', '4c', '5s', '6h', '7d', 'Ac'], 7),\n  ('two pair inside straight', ['8h', '8d', '9c', '9s', 'Th', 'Jd', 'Qc'], 12),\n  ('king-high straight', ['9h', 'Td', 'Jc', 'Qs', 'Kh', '3d', '2c'], 13),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)]]\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":"991507c896de77e97072deed3c4dce54f93490aeb70eb8fbd08406e761802e25","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    m=0\n    for c in x:\n        m|=1<<(R.index(c[0])+2)\n    if m & (1<<14): m|=1<<1\n    for top in range(14,4,-1):\n        need=0b1111<<(top-3)\n        if m & need == need: return top\n    return 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)],\n [('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0)],\n [('six-high over wheel', ['Ah', '2d', '3c', '4s', '5h', '6d', 'Jc'], 6),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('five cards straight', ['6h', '7d', '8c', '9s', 'Th'], 10),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0)],\n [('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('paired straight', ['5h', '5d', '6c', '7s', '8h', '9d', 'Kc'], 9),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('five cards straight', ['6h', '7d', '8c', '9s', 'Th'], 10),\n  ('ace-king-queen-jack only', ['Ah', 'Kd', 'Qc', 'Js', '9h'], 0),\n  ('pair of fours with straight', ['3h', '4d', '4c', '5s', '6h', '7d', 'Ac'], 7),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0)],\n [('four-straight only', ['9h', 'Td', 'Jc', 'Qs', '2h', '2d', '3c'], 0),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('seven-card long straight', ['4h', '5d', '6c', '7s', '8h', '9d', 'Tc'], 10),\n  ('gap straight', ['2h', '3d', '4c', '6s', '7h', '8d', '9c'], 0),\n  ('pair of fours with straight', ['3h', '4d', '4c', '5s', '6h', '7d', 'Ac'], 7),\n  ('two pair inside straight', ['8h', '8d', '9c', '9s', 'Th', 'Jd', 'Qc'], 12),\n  ('king-high straight', ['9h', 'Td', 'Jc', 'Qs', 'Kh', '3d', '2c'], 13),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)]]\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\", \"10h\"); 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-rank-mask-straight-window-width","generated_at":"2026-09-29T14:50:07.620500+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Bitmask evaluators are the standard fast path for seven-card hold'em straights.","root_cause":"The window mask has four bits set, so any four consecutive ranks match.","sha256":"99cb787e8c86bd53a600ed7b8dd944e4a2ae820f0bdfff951cefc4629dea2168","title":"Four-card run accepted as a straight · 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":45.826,"exit_code":1,"observations":[{"actual":6,"check":"wheel in seven","expected":5,"passed":false},{"actual":0,"check":"broadway","expected":14,"passed":false},{"actual":7,"check":"six-high over wheel","expected":6,"passed":false},{"actual":0,"check":"four-straight only","expected":0,"passed":true},{"actual":10,"check":"paired straight","expected":9,"passed":false},{"actual":0,"check":"no straight","expected":0,"passed":true},{"actual":0,"check":"gap straight","expected":0,"passed":true},{"actual":0,"check":"no straight low cards","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel in seven\", \"actual\": 6, \"expected\": 5, \"passed\": false}, {\"check\": \"broadway\", \"actual\": 0, \"expected\": 14, \"passed\": false}, {\"check\": \"six-high over wheel\", \"actual\": 7, \"expected\": 6, \"passed\": false}, {\"check\": \"four-straight only\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"paired straight\", \"actual\": 10, \"expected\": 9, \"passed\": false}, {\"check\": \"no straight\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"gap straight\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"no straight low cards\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.32,"exit_code":1,"observations":[{"actual":5,"check":"wheel in seven","expected":5,"passed":true},{"actual":14,"check":"broadway","expected":14,"passed":true},{"actual":6,"check":"six-high over wheel","expected":6,"passed":true},{"actual":12,"check":"four-straight only","expected":0,"passed":false},{"actual":9,"check":"paired straight","expected":9,"passed":true},{"actual":0,"check":"no straight","expected":0,"passed":true},{"actual":9,"check":"gap straight","expected":0,"passed":false},{"actual":0,"check":"no straight low cards","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel in seven\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"broadway\", \"actual\": 14, \"expected\": 14, \"passed\": true}, {\"check\": \"six-high over wheel\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"four-straight only\", \"actual\": 12, \"expected\": 0, \"passed\": false}, {\"check\": \"paired straight\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"no straight\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"gap straight\", \"actual\": 9, \"expected\": 0, \"passed\": false}, {\"check\": \"no straight low cards\", \"actual\": 0, \"expected\": 0, \"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."}}