//! Spec: a bluff catch respects the price. Facing a tiny bet, a made pair is priced in by //! pot odds even against a value-only range (the bettor almost never bluffs). The old gate //! removed the call unconditionally and folded a hand whose call was hugely +EV (live //! 8.11.: 6h on Kd4d6c, 133 into 2293 -> break-even 5 %, equity 39 %, "EV call +807" -> FOLD). mod spot_fixture; use rechner::engine::postflop::choose_postflop; use rechner::exploit::profile::Profile; use rechner::exploit::thresholds::Thresholds; use rechner::game::{ActionKind, ActionRecord, Choice, SeenAction, Spot, Street, Villain}; use rechner::read::draw::Draw; use rechner::read::made::Made; use rechner::read::suit_pattern::SuitPattern; use spot_fixture::*; const BASE: Thresholds = Thresholds::BASE; /// A nit (vpip 10 %): classified value-heavy, its small bet keeps almost no bluffs. fn nit() -> Villain { Villain { seat: 2, stack: 10.0, folded: false, profile: Some(Profile { vpip: Some(0.10), pfr: Some(0.05), ..Profile::default() }), } } /// Hero faces the nit's flop bet of 200 into 1000 (ratio 0.2): value floor middle pair, /// bluff share ~3 % < 5 %. Price now: 200 into 1200 -> break-even 0.143. Only fold or call. fn facing_small_value_bet() -> Spot { Spot { pot: 1200.0, to_call: 200.0, legal: vec![ActionKind::Fold, ActionKind::Call], villains: vec![nit()], history: vec![ ActionRecord { street: Street::Preflop, seat: 2, action: SeenAction::Call, amount: Some(500.0) }, ActionRecord { street: Street::Preflop, seat: 5, action: SeenAction::Call, amount: Some(500.0) }, ActionRecord { street: Street::Flop, seat: 2, action: SeenAction::Bet, amount: Some(200.0) }, ], ..flop() } } #[test] fn a_made_pair_calls_a_tiny_value_bet_on_pot_odds() { // bottom pair sits below the value floor and the bettor barely bluffs - yet at 0.143 // break-even and 45 % equity the call is trivially +EV. The engine must take it. let read = read_of(Made::BottomPair, Draw::None, 0, SuitPattern::Rainbow, 0.4); let d = choose_postflop(&facing_small_value_bet(), &estimate(0.45, 0.005), &BASE, &read); assert_eq!(d.choice, Choice::Call, "{}", d.reason); } #[test] fn a_made_pair_still_folds_the_no_bluff_range_at_a_real_price() { // A low-aggression villain pot-bets (900 into 900 -> break-even 0.333): a value-only range // with ~1 % bluffs. Here the pot odds do NOT price a hand below the value floor in, so the // bluff catch stays a fold even though the generic 40 % estimate would otherwise call - the // price guard only lifts the block for cheap bets, it does not disable the bluff catch. let villain = Villain { profile: Some(Profile { aggression: Some(0.02), ..Profile::default() }), ..nit() }; let spot = Spot { pot: 1800.0, to_call: 900.0, villains: vec![villain], history: vec![ ActionRecord { street: Street::Preflop, seat: 2, action: SeenAction::Call, amount: Some(450.0) }, ActionRecord { street: Street::Preflop, seat: 5, action: SeenAction::Call, amount: Some(450.0) }, ActionRecord { street: Street::Flop, seat: 2, action: SeenAction::Bet, amount: Some(900.0) }, ], ..facing_small_value_bet() }; let read = read_of(Made::BottomPair, Draw::None, 0, SuitPattern::Rainbow, 0.4); let d = choose_postflop(&spot, &estimate(0.40, 0.005), &BASE, &read); assert_eq!(d.choice, Choice::Fold, "{}", d.reason); }