{"abstract":"A wheel is reported as no straight although the ace bit is mirrored.","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":"Starting at 13 finds the wheel but never checks the broadway window.","family":"w2-poker_hand_evaluation-rank-mask-straight-scan-range","id":"FA-81941","implementations":{"attempt":{"sha256":"f3802987bac80d130ada7823f2b2709a51b84f4ed1d18ccc19c296b6b9a6a077","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(13,4,-1):\n        need=0b11111<<(top-4)\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  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\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  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\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  ('two pair inside straight', ['8h', '8d', '9c', '9s', 'Th', 'Jd', 'Qc'], 12),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\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),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)],\n [('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  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)]]\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":"ff29a957df6ec0f3d2f6b2d5edfcc1a50b7121699383c8d7a4bd2e39d883a187","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,5,-1):\n        need=0b11111<<(top-4)\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  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\n  ('trips inside straight', ['5h', '5d', '5c', '6s', '7h', '8d', '9c'], 9),\n  ('no straight', ['2h', '5d', '7c', '9s', 'Jh', 'Kd', 'Ac'], 0),\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  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\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  ('two pair inside straight', ['8h', '8d', '9c', '9s', 'Th', 'Jd', 'Qc'], 12),\n  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5)],\n [('wheel in seven', ['Ah', '2d', '3c', '4s', '5h', 'Kd', 'Kc'], 5),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah', '2c', '2d'], 14),\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),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)],\n [('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  ('wheel without king', ['Ah', '2d', '3c', '4s', '5h', '9d', 'Jc'], 5),\n  ('king with low run', ['Kh', '2d', '3c', '4s', '5h', '9d'], 0),\n  ('no straight low cards', ['2h', '3d', '4c', '8s', '9h', 'Qd', 'Qc'], 0)]]\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-scan-range","generated_at":"2026-09-29T14:50:07.613922+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 top-rank loop ends at 6, so the window topped by 5 is never checked.","sha256":"13c5155ffada44141749cdca080f7ddf6176b4b95e6b8f064a091a02345f204e","title":"Scan stops before the five-high window · 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":44.767,"exit_code":1,"observations":[{"actual":5,"check":"wheel in seven","expected":5,"passed":true},{"actual":0,"check":"broadway","expected":14,"passed":false},{"actual":6,"check":"six-high over wheel","expected":6,"passed":true},{"actual":0,"check":"four-straight only","expected":0,"passed":true},{"actual":9,"check":"paired straight","expected":9,"passed":true},{"actual":9,"check":"trips inside straight","expected":9,"passed":true},{"actual":0,"check":"no straight","expected":0,"passed":true},{"actual":5,"check":"wheel without king","expected":5,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel in seven\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"broadway\", \"actual\": 0, \"expected\": 14, \"passed\": false}, {\"check\": \"six-high over wheel\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"four-straight only\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"paired straight\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"trips inside straight\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"no straight\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"wheel without king\", \"actual\": 5, \"expected\": 5, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.158,"exit_code":1,"observations":[{"actual":0,"check":"wheel in seven","expected":5,"passed":false},{"actual":14,"check":"broadway","expected":14,"passed":true},{"actual":6,"check":"six-high over wheel","expected":6,"passed":true},{"actual":0,"check":"four-straight only","expected":0,"passed":true},{"actual":9,"check":"paired straight","expected":9,"passed":true},{"actual":9,"check":"trips inside straight","expected":9,"passed":true},{"actual":0,"check":"no straight","expected":0,"passed":true},{"actual":0,"check":"wheel without king","expected":5,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel in seven\", \"actual\": 0, \"expected\": 5, \"passed\": false}, {\"check\": \"broadway\", \"actual\": 14, \"expected\": 14, \"passed\": true}, {\"check\": \"six-high over wheel\", \"actual\": 6, \"expected\": 6, \"passed\": true}, {\"check\": \"four-straight only\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"paired straight\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"trips inside straight\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"no straight\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"wheel without king\", \"actual\": 0, \"expected\": 5, \"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."}}